SBL2e Dual Serial-to-Ethernet User's Manual
Page 24
8.5
GPIO Server and Analog to Digital Readback
In addition to the system and serial configuration, you can also use AT commands to send
commands and receive status information from the GPIO Server. For example, you can set pins
GPIO pins high or low, or read the analog-to-digital inputs.
A very important point to remember when accessing the GPIO and A/D pins is that the operations
will occur immediately upon issuing the AT command. The typical sequence of events in this case
are:
1.
Enter command mode
2.
Send configuration change commands
3.
Exit command mode with “AT&X” or “ATO” to avoid losing any existing TCP serial
connections.
Example:
AT#P07?<cr> or AT#P07M=GPIO<cr>
#Pnn
// Where n or nn is the pin number
#Pn
?
// Read a GPIO or A/D pin, ERR if pin is not a GPIO or A/D.
=<0|1>
// Write GPIP pin high or low, ERR if not GPIO
M=<mode>
// Modes: GPIO, RX, TX, RTS, CTS, AD
M?
// Return the current mode of the pin
#PD?
// Return the system pin current drive level: 0 = 2mA, 1 = 10mA
#PD=<1|0>
// Set all pin current drive levels: 0 = 2mA, 1 = 10mA
electronic components distributor