Examples - Lantronix XPort Direct+ User Manual

Device server
Table of Contents

Advertisement

Command 1Ah, Set Active Levels
Send:
Response:
Command 1Bh, Set States
Send:
Response:

Examples

Example 1: PC sends command 10h to find out which configurable pins are
available as GPIO.
PC -> XPort Direct+: 10h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
XPort Direct+ -> PC: 10h, 03h, 00h, 00h, 00h
Command details:
10h = command 10h
00h, 00h, 00h, 00h = ignored
00h, 00h, 00h, 00h = ignored
Response details:
10h = response to command 10h
03h, 00h, 00h, 00h =
Example 2: PC sends command 1Bh to change the current states of GPIO 0
and 1.
PC -> XPort Direct+: 1Bh, 01h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
XPort Direct+ -> PC: 1Bh, 05h, 00h, 00h, 00h
XPort Direct+ User Guide
2 parameters
Bytes 1-4: Mask
Bit X
1 means the direction for GPIO X will be updated with the value in the
second parameter.
0 means the active type for that GPIO will not change.
Bytes 5-8: New Active Levels
Bit X
1 means GPIO X will become active low.
0 means it will become active high.
1 parameter
Bytes 1-4: Updated active levels
2 parameters
Bytes 1-4: Mask
Bit X
1 means the state for GPIO X will be updated with the value in the
second parameter.
0 means the state for that GPIO will not change.
Bytes 5-8: New States
Bit X
1 means GPIO X will become active.
0 means it will become inactive.
1 parameter
Bytes 1-4: Updated states
bits 0 and 1 are 1 →CP1 and CP2 are configured as GPIOs.
The other bits are ignored because there are only two configurable pins on
the XPort Direct+.
9: GPIO Interface
67

Advertisement

Table of Contents
loading

Table of Contents