CMSIS-Driver
Version 2.7.1
Peripheral Interface for Middleware and Application Code
|
Control functions for the WiFi module. More...
Content | |
WiFi Events | |
The WiFi driver generates call back events that are notified via the function ARM_WIFI_SignalEvent. | |
Data Structures | |
struct | ARM_WIFI_CAPABILITIES |
WiFi Driver Capabilities. More... | |
Typedefs | |
typedef void(* | ARM_WIFI_SignalEvent_t )(uint32_t event, void *arg) |
Pointer to ARM_WIFI_SignalEvent : Signal WiFi Event. More... | |
Functions | |
ARM_DRIVER_VERSION | ARM_WIFI_GetVersion (void) |
Get driver version. More... | |
ARM_WIFI_CAPABILITIES | ARM_WIFI_GetCapabilities (void) |
Get driver capabilities. More... | |
int32_t | ARM_WIFI_Initialize (ARM_WIFI_SignalEvent_t cb_event) |
Initialize WiFi Module. More... | |
int32_t | ARM_WIFI_Uninitialize (void) |
De-initialize WiFi Module. More... | |
int32_t | ARM_WIFI_PowerControl (ARM_POWER_STATE state) |
Control WiFi Module Power. More... | |
int32_t | ARM_WIFI_GetModuleInfo (char *module_info, uint32_t max_len) |
Get Module information. More... | |
void | ARM_WIFI_SignalEvent (uint32_t event, void *arg) |
Signal WiFi Events. More... | |
Control functions for the WiFi module.
The WiFi Control functions setup and control the WiFi module.
struct ARM_WIFI_CAPABILITIES |
WiFi 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:
ARM_WIFI_SignalEvent_t |
Pointer to ARM_WIFI_SignalEvent : Signal WiFi Event.
Provides the typedef for the callback function ARM_WIFI_SignalEvent.
Parameter for:
ARM_DRIVER_VERSION ARM_WIFI_GetVersion | ( | void | ) |
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:
ARM_WIFI_CAPABILITIES ARM_WIFI_GetCapabilities | ( | void | ) |
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:
int32_t ARM_WIFI_Initialize | ( | ARM_WIFI_SignalEvent_t | cb_event | ) |
Initialize WiFi Module.
[in] | cb_event | Pointer to ARM_WIFI_SignalEvent_t |
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:
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:
int32_t ARM_WIFI_PowerControl | ( | ARM_POWER_STATE | state | ) |
Control WiFi Module Power.
[in] | state | Power state
|
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.
[out] | module_info | Pointer to character buffer were info string will be returned |
[in] | max_len | Maximum length of string to return (including null terminator) |
The function ARM_WIFI_GetModuleInfo retrieves string containing information about the WiFi module.
The information might include module name, firmware version, ...
Example:
void ARM_WIFI_SignalEvent | ( | uint32_t | event, |
void * | arg | ||
) |
Signal WiFi Events.
[in] | event | WiFi Events notification mask |
[in] | arg | Pointer to argument of signaled event |
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:
Parameter event | Description |
---|---|
ARM_WIFI_EVENT_AP_CONNECT | Occurs in access point mode when a station has connected to the access point. |
ARM_WIFI_EVENT_AP_DISCONNECT | Occurs in access point mode when a station has disconnected from the access point. |
ARM_WIFI_EVENT_ETH_RX_FRAME | Occurs in WiFi Bypass Mode when an ethernet frame is received. |