By default, those GPIO pins are tied to the respective LED functionality. If you are using a Wifly with a carrier board then there are already LEDs wired to the pins. If you have just the raw SMT module then you wire those pins to your own LEDs. You only need to set the alternate functionality flags if you want to use those pins for your own IO. The alternate functionality mask will stop the Wifly from using those pins when connection states change. By default, the status pins should already be enabled (firmware 4.00.1 anyway).
The behavior I find is that the Wifly Associated Pin (GPIO4) will go LOW after a successful connection to the Wi-Fi network (this is contrary to the documentation). If the connection fails, the pin will alternate between high and low (blink). That's using code which simply creates a DigitalIn for the mBed pin tied to GPIO4 and a DigitalOut for the mBed pin tied to an LED driver. The code then just sets ledPin = mbedStatusPin. In operation, the light is off when the device is connected and blinks when there is a problem with the WiFi configuration.
I set up my wifly to auto connect to my access point and connect to my website when data is received at the wifly rx pin. I am NOT using the wiflyinterface library at all. On page 63 of http://ww1.microchip.com/downloads/en/DeviceDoc/rn-wiflycr-ug-v1.2r.pdf it explains the alternate functionality of GPIO4. I would like to enable the alternate functionality of GPIO4 so the mbed can monitor if the wifly is connected to the Access Point or not. Even though the manual explains how to achieve changing GPIO4 functionality I am still unsure what the bit code and command I am needing to use. For testing purposes I typed "$$$" in my terminal to enter wifly CMD mode. Next I typed "set sys iofunc 0x01", "save" and "reboot". I setup my mbed pin15 as DigitalInOut. I also set a while loop to monitor the status of pin15 and output "one" to the terminal if pin15 is high. The issue that I am having is, pin15 seems to always be high which causes "one" to be sent to my terminal. I made sure to type "leave" while connected to wiflys CMD mode to disconnect the wifly from my Access Point, but "one" is still being sent. The only time that pin15 of my mbed seems to be LOW is when I completely remove power from the Wifly I have no idea if the wiflys GPIO4 pin alternative functionality is enabled or if my mbed pin15 is setup correctly. Can anyone help me figure this out? What should I do to fix this?
Code: