Control functions for the WiFi module. More...
Control functions for the WiFi module.
The WiFi Control functions setup and control the WiFi module.
struct ARM_WIFI_CAPABILITIESWiFi Driver Capabilities.
A WiFi driver can be implemented with different capabilities. The data fields of this structure encode the capabilities implemented by this driver.
Returned by:
Data Fields uint32_t station: 1 Station. uint32_t ap: 1 Access Point. uint32_t station_ap: 1 Concurrent Station and Access Point. uint32_t wps_station: 1 WiFi Protected Setup (WPS) for Station. uint32_t wps_ap: 1 WiFi Protected Setup (WPS) for Access Point. uint32_t event_ap_connect: 1 Access Point: event generated on Station connect. uint32_t event_ap_disconnect: 1 Access Point: event generated on Station disconnect. uint32_t event_eth_rx_frame: 1 Event generated on Ethernet frame reception in bypass mode. uint32_t bypass_mode: 1 Bypass or pass-through mode (Ethernet interface) uint32_t ip: 1 IP (UDP/TCP) (Socket interface) uint32_t ip6: 1 IPv6 (Socket interface) uint32_t ping: 1 Ping (ICMP) uint32_t reserved: 20 Reserved (must be zero)Get driver version.
The function ARM_WIFI_GetVersion returns version information of the driver implementation in ARM_DRIVER_VERSION.
API version is the version of the CMSIS-Driver specification used to implement this driver. Driver version is source code version of the actual driver implementation.
Example:
void get_wifi_version (void) {
wifi= &Driver_WiFi0;
if(version.
api< 0x100U) {
return;
}
}
Get driver capabilities.
The function ARM_WIFI_GetCapabilities retrieves information about capabilities in this driver implementation. The data fields of the struct ARM_WIFI_CAPABILITIES encode various capabilities, for example if a WiFi module supports the Access Point mode or the bypass mode, or is capable to signal events using the ARM_WIFI_SignalEvent callback function.
Example:
void get_wifi_capabilities (void) {
wifi = &Driver_WiFi0;
:
}
Initialize WiFi Module.
The function ARM_WIFI_Initialize initializes the WiFi module.
It is called when the middleware component starts operation.
The ARM_WIFI_Initialize function performs the following operations:
The parameter cb_event is a pointer to the ARM_WIFI_SignalEvent callback function; use a NULL pointer when no callback signals are required.
Example:
void initialize_wifi (void) {
wifi = &Driver_WiFi0;
}
int32_t ARM_WIFI_Uninitialize ( void )De-initialize WiFi Module.
The function ARM_WIFI_Uninitialize de-initializes the resources of the WiFi module.
It is called when the middleware component stops operation and releases the software resources used by the module.
Example:
void uninitialize_wifi (void) {
wifi = &Driver_WiFi0;
}
Control WiFi Module Power.
The function ARM_WIFI_PowerControl allows you to configure the power modes of the WiFi module.
The parameter state specifies the ARM_POWER_STATE.
Low-power mode depends on additional options set by ARM_WIFI_SetOption :
Deep-sleep mode (only for station): Module turns off the radio and also internal CPU thus reducing power consumption to minimum, only the timer is running that wakes-up the module after specified time. When timer expires the module reconnects to the access point.
This mode is used when power consumption is a priority (battery powered devices) and when WiFi is used in short intervals that do not occur very often (example: sending a temperature from a sensor to a cloud every 10 seconds).
Sleep mode (only for station): Module reduces power consumption by going into sleep and waking up periodically to listen for beacons.
Delivery Traffic Indication Message (DTIM) interval can be configured with option ARM_WIFI_DTIM (station and access point) and beacon interval with option ARM_WIFI_BEACON (only for access point).
Default module intervals are used when those options are not explicitly set.
If power state specifies an unsupported mode, the function returns ARM_DRIVER_ERROR_UNSUPPORTED as status information and the previous power state of the peripheral is unchanged. Multiple calls with the same state generate no error.
Example:
int32_t ARM_WIFI_GetModuleInfo ( char * module_info, uint32_t max_len )Get Module information.
The function ARM_WIFI_GetModuleInfo retrieves string containing information about the WiFi module.
The information might include module name, firmware version, ...
Example:
void initialize_wifi (void) {
char info[32];
wifi = &Driver_WiFi0;
}
void ARM_WIFI_SignalEvent ( uint32_t event, void * arg )Signal WiFi Events.
The function ARM_WIFI_SignalEvent is a callback function registered by the function ARM_WIFI_Initialize. It is called by the WiFi driver to notify the application about WiFi Events occurred during operation.
The parameter event indicates the event that occurred during driver operation.
The parameter arg provides additional information about the event.
The following events can be generated:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4