User`s guide

RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 63
ticular GPIO pin. If a bit is 0, then the corresponding GPIO pin is driven/read by the firm-
ware per the default function. The I/O function <mask> is encoded as shown in
Tabl e 3-11 .
If you disable the LEDs using bits 0, 1, and 2, you can then use the show i command
to read these GPIO pins. For example, the show i command might return Port=30.
To use the alternate LEDs functions, use the following commands:
set sys iofunc 0x70 // Enable alternate function for GPIO4 - 6
save // Store configuration
reboot // Reboot the module
Example 3-2 shows how to control the LEDs on the evaluation boards:
EXAMPLE 3-2: TOGGLE RED AND GREEN LEDS
3.6.2.3 CONTROLLING CONNECTIONS WITH GPIO PINS
In embedded applications it is useful to monitor and control the status of the TCP/IP
connection. To monitor and control the module’s connection status, enable the alter-
nate function of GPIO4 - 6. Using the alternate function for these GPIO pins, the mod-
ule connects to the stored remote host IP address and port when GPIO5 is driven high
and disconnects when driven low. You can monitor the TCP/IP connection status by
reading GPIO6; it is high when connected and low when not connected.
TABLE 3-11: GPIO PIN ALTERNATE FUNCTION BITMASK
Bit Signal Name Direction Function
0 GPIO4 Output Disable the LED function so the I/O can be used as a GPIO pin.
1 GPIO5 Output Disable the LED function so the I/O can be used as a GPIO pin.
2 GPIO6 Output Disable the LED function so the I/O can be used as a GPIO pin.
3 Unused - -
4 GPIO4 Output This pin goes high after the module has associated/authenticated and has an IP
address.
5 GPIO5 Input Set this pin high to trigger a TCP connection and low to disconnect.
6 GPIO6 Output This pin goes high when the module is connected over TCP and low when discon-
nected.
Note: Bits 0 - 3 are mutually exclusive with bits 4 – 6, i.e., 0x77 is an illegal value.
Green LED:
set sys iofunc 0x01 // Mask GPIO4 from WiFly functionality
set sys output 0x10 // Toggle GPIO4's state
Red LED:
set sys iofunc 0x04 // mask GPIO6 from WiFly functionality
set sys output 0x40 // toggle GPIO6's state
GReen and red LEDs:
set sys iofunc 0x05 // mask GPIO4 and GPIO6 from WiFly
// functionality
set sys output 0x50 // toggle GPIO 4& 6's state