G.2 GPIO Capability
GPIO Capability
www.ti.com
The USB-MODEVM has seven GPIO lines. Access them by specifying the interface to be 0x08, and thenusing the standard format for packets—but addresses are unnecessary. The GPIO lines are mapped intoone byte (see Table G-3 ):
Table G-3. GPIO Pin AssignmentsBit76543210
x P3.5 P3.4 P3.3 P1.3 P1.2 P1.1 P1.0
Example: write P3.5 to a 1, set all others to 0:[0] 0x18 --> write, GPIO[1] 0x00 --> this value is ignored[2] 0x01 --> length - ALWAYS a 1[3] 0x00 --> this value is ignored[4] 0x40 --> 01000000
The user may also read back from the GPIO to see the state of the pins. Let's say we just wrote theprevious example to the port pins.
Example: read the GPIO[0] 0x08 --> read, GPIO[1] 0x00 --> this value is ignored[2] 0x01 --> length - ALWAYS a 1[3] 0x00 --> this value is ignored
The return packet should be:[0] 0x28[1] 0x00[2] 0x01[3] 0x00[4] 0x40
USB-MODEVM Protocol48 SLAU286 – June 2009Submit Documentation Feedback