Brining Up Wi-Fi Interface

Top  Previous  Next

The easiest way to make the Wi-Fi interface work is by calling wln_start() of the WLN library. This will save you a ton of effort, seriously!

If you can't or won't use the library, here is the sequence of steps that you just have to take in order to bring up the Wi-Fi interface:

Configure interface lines

Reset Wi-Fi module

Select the domain

Allocate buffer memory

Set MAC address (optional)

Boot up the GA1000 add-on module

Set the IP, gateway IP, and netmask

Set TX power (really optional)


The following is a simplified sample code that demonstrates the process. Typically, it would be called from the on_sys_init event handler, but you can actually call it from anywhere in your application. You can also call this code repeatedly and even after the Wi-Fi interface has already been running. We call the code simplified because it does not check for any error conditions.






 #define WLN_RESET_MODE 1 'reset is controlled by the combination of CS and CLK

 'there is no need to map CS, DI, DO, and CLK lines because they are fixed


 #define WLN_RESET_MODE 0 'there is a dedicated reset line

 #define WLN_RST PL_IO_NUM_11

 #define WLN_CS PL_IO_NUM_15

 #define WLN_DI PL_IO_NUM_12

 #define WLN_DO PL_IO_NUM_13

 #define WLN_CLK PL_IO_NUM_14


 #define WLN_RESET_MODE 0 'there is a dedicated reset line

 #define WLN_RST PL_IO_NUM_51

 #define WLN_CS PL_IO_NUM_49

 #define WLN_DI PL_IO_NUM_52

 #define WLN_Do PL_IO_NUM_50

 #define WLN_CLK PL_IO_NUM_53





 '----- configure interface lines -----

 '(on platforms with fixed mapping this will have no effect and do no harm)














 '----- reset Wi-Fi module -----


         'reset is controlled by the combination of CS and CLK                





         'there is a dedicated reset line                






 'in case we called wln_init() after it has already been up and running

 While wln.enabled=YES



 '----- set the domain -----



 '----- allocate buffers -----




 '----- set MAC address (optional) -----



 '----- boot up the GA1000 -----"ga1000fw.bin")



 '----- setup the IP, gateway, netmask -----





 '----- set TX power (REALLY optional) -----


 while wln.task<>PL_WLN_TASK_IDLE