Applying Hardware Reset
|Top Previous Next|
Once the RST line has been properly configured, you can reset the GA1000 or WA2000 at any time by executing a simple code shown below. Note that the Wi-Fi module has to be reset in the beginning. The proper hardware reset is not optional!
If your design has no GPIO line to spare, the reset signal can be derived from the combination of CS and CLK line signals (check Connecting GA1000 and WA2000, diagram B). When there is a dedicated RST line, this line is manipulated directly.
The RST line is active low. The WA2000 requires the reset pulse to be at least 1ms long. The GA1000 doesn't care how short the reset pulse is (within the range that you can achieve on Tibbo devices). The code below takes care of the reset for both Wi-Fi devices and on all platforms.
Notice also the while...wend loop. It is there for the proper module reset after it has already been up and running. When the hardware reset is applied, the GA1000 or WA2000 will go offline, and the wln. object will detect this in a matter of milliseconds. Your program should not try to work with the wln. object again until the wln.enabled property goes to 0- NO in response to the hardware reset. Your code can stay and wait for this (as shown below) or rely on the on_wln_event(PL_WLN_EVENT_DISABLED). Once the event is triggered, you are free to repeat the whole process of bringing up Wi-Fi interface.