We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-07-15
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: WIFI
Downloaded: 3966 times
Not followed.
License: MIT license
WiFi 9 Click is fully embedded stand-alone Wi-Fi module, equipped with the PAN9420 a 2.4 GHz ISM band Wi-Fi-embedded module which includes a wireless radio and an MCU for easy integration of Wi-Fi connectivity into various electronic devices.
Do you want to subscribe in order to receive notifications regarding "WiFi 9 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "WiFi 9 click" changes.
Do you want to report abuse regarding "WiFi 9 click".
Library Description
Library carries generic command parser adopted for WiFi 9 command based modules.
Generic parser
Key functions:
wifi9_cmdSingle
- Sends provided command to the module.wifi9_setHandler
- Handler assignation to the provied command.wifi9_modulePower
- Turn on module.Examples description
The application is composed of three sections :
void applicationInit()
{
// TIMER INIT
wifi9_configTimer();
// DRIVER INIT
wifi9_uartDriverInit((T_WIFI9_P)&_MIKROBUS1_GPIO, (T_WIFI9_P)&_MIKROBUS1_UART);
wifi9_coreInit( wifi9_default_handler, 1500 );
// MODULE POWER ON
wifi9_hfcEnable( 0 );
wifi9_modulePower( 1 );
wifi9_selectUart(_WIFI9_SELECT_CMD_UART);
Delay_ms( 4000 );
mikrobus_logWrite( "---------------------", _LOG_LINE );
mikrobus_logWrite( "---- System Info ----", _LOG_LINE );
mikrobus_logWrite( "---------------------", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_GET_SYSTEM_FIRMWARE[0]);
Delay_ms( 500 );
wifi9_cmdSingle(&_WIFI9_CMD_GET_SYSTEM_MAC_ADDR[0]);
Delay_ms( 500 );
wifi9_cmdSingle(&_WIFI9_CMD_GET_SYSTEM_SERIAL_NUM[0]);
Delay_ms( 500 );
wifi9_cmdSingle(&_WIFI9_CMD_GET_SYSTEM_RADIO_VER[0]);
Delay_ms( 500 );
wifi9_cmdSingle(&_WIFI9_CMD_GET_SYSTEM_BOOTL_VER[0]);
Delay_ms( 500 );
wifi9_cmdSingle(&_WIFI9_CMD_GET_SYSTEM_HW_REV[0]);
Delay_ms( 5000 );
mikrobus_logWrite( "--------------------------", _LOG_LINE );
mikrobus_logWrite( "---- Start NETCAT app ----", _LOG_LINE );
mikrobus_logWrite( "--------------------------", _LOG_LINE );
mikrobus_logWrite( "> Reads the current Station status", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_GET_WLAN_STATE_STA[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> Set Station to ON status", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_SET_WLAN_STATE_STA_ON[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> Sets Station SSID and PASSWORD", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_SET_WLAN_CFG_STA[0]);
Delay_ms( 4000 );
mikrobus_logWrite( "> Turn OFF - Netcat module", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_SET_NETCAT_STATE_OFF[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> Turn ON - Netcat module", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_SET_NETCAT_STATE_ON[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> Sets the Netcat module as a server with port 1234", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_SET_NETCAT_CFG_SERVER[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> Excludes Netcat authentication", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_SET_NETCAT_AUTH_OFF[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> Gets the current received IP address", _LOG_LINE );
wifi9_cmdSingle(&_WIFI9_CMD_GET_NET_CFG_STA[0]);
Delay_ms( 2000 );
mikrobus_logWrite( "> At the moment, a netcat server at port 1234 has been built", _LOG_LINE );
mikrobus_logWrite( "> The module is transferred to BIN-UART - for data collection", _LOG_LINE );
wifi9_selectUart(_WIFI9_SELECT_BIN_UART);
Delay_ms( 5000 );
}
Additional Functions :
All additional functions such as timer initialization and default handler.
Notes :
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.