Configurable Pins

The protocol allows for control of up to 32 GPIOs. How many are actually available depends on the product. WiPort has only three.

The parameters are four bytes long and represent GPIOs 0-31, with GPIO0 in bit 0 of the first byte (Little Endian). Parameter bits for configurable pins not configured as GPIOs are undefined for Get commands and ignored on Set commands.

Every command consists of nine bytes: one command type of one byte and two parameters of four bytes each.

 

Command

 

 

 

Parameter 1

 

 

 

 

 

Parameter 2

 

 

Byte

0

 

1

2

 

3

4

5

 

6

 

7

8

Pin Number

 

0

 

7

8

 

15

16

23

24

31

0

 

7

8

 

15

16

23

24

31

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

On some commands, one or all parameters are ignored.

For UDP, command type and parameters need to be in the same datagram.

Responses to valid commands are always five bytes long, consisting of the returned command byte and as parameters in the current or updated values. In case of an invalid command, only one byte with value 0FFh is returned.

 

Command

 

 

 

Parameter 1

 

 

 

 

Byte

0

 

1

2

 

3

4

Pin Number

 

0

 

7

8

15

16

 

23

24

31

When sending a command (TCP and UDP), wait for the response before sending the next command.

Commands

Byte 0 Command Types

10h

Get functions

 

 

11h

Get directions (input or output)

 

 

12h

Get active levels (high active or low active)

 

 

13h

Get current states (active or not active)

 

 

19h

Set directions

 

 

1Ah

Set active levels

 

 

1Bh

Set current states

 

 

As you can, see there is no Set functions command. Since the pin’s function depends on the hardware in which the WiPort is embedded, that configuration is only allowed via 77FE. Settings changed by any of the Set commands are not stored and are lost when the unit is powered down or rebooted.

Command 10h, Get Functions

Send:

No parameters

Response:

1 parameter

Bytes 1-4: Functions

Bit X 1 means general purpose IO available to the user.

6-2

WiPort™ User Guide

Page 68
Image 68
Lantronix 900-332 manual Commands, Configurable Pins, Byte 0 Command Types, Command 10h, Get Functions, Send