Macros to abstract out whether the LEDs & Buttons are wired high or active low.
Basic integration code for interfacing the WiFi Host Driver (WHD) with the Board Support Packages (BSPs).
Macros | |
#define | CY_WIFI_THREAD_STACK_SIZE (5120) |
Defines the amount of stack memory available for the wifi thread. | |
#define | CY_WIFI_THREAD_PRIORITY (CY_RTOS_PRIORITY_HIGH) |
Defines the priority of the thread that services wifi packets. More... | |
#define | CY_WIFI_COUNTRY (WHD_COUNTRY_AUSTRALIA) |
Defines the country this will operate in for wifi initialization parameters. More... | |
#define | CY_WIFI_OOB_INTR_PRIORITY (2) |
Defines the priority of the interrupt that handles out-of-band notifications from the wifi chip. More... | |
#define | CY_USE_OOB_INTR (1u) |
Defines whether to use the out-of-band pin to allow the WIFI chip to wake up the MCU. | |
#define | CYBSP_WIFI_WL_REG_ON_GPIO_DRIVE_MODE (CYHAL_GPIO_DRIVE_PULLUP) |
Default GPIO drive mode for CYBSP_WIFI_WL_REG_ON. More... | |
#define | CYBSP_WIFI_WL_HOSTWAKE_DRIVE_MODE (CYHAL_GPIO_DRIVE_NONE) |
Default GPIO drive mode for CYBSP_WIFI_WL_HOSTWAKE. More... | |
#define | CYBSP_WIFI_WL_HOSTWAKE_INIT_STATE (WHD_FALSE) |
Default GPIO drive mode for CYBSP_WIFI_WL_HOSTWAKE. More... | |
#define | CYBSP_RSLT_WIFI_INIT_FAILED (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_WHD_INTEGRATION, 0)) |
Initialization of the WiFi driver failed. | |
#define | CYBSP_RSLT_WIFI_SDIO_ENUM_TIMEOUT (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_WHD_INTEGRATION, 1)) |
SDIO enumeration failed. | |
#define | CYBSP_RSLT_WIFI_SDIO_ENUM_IO_NOT_SUPPORTED (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_WHD_INTEGRATION, 2)) |
SD device does not support IO functionality. | |
#define | CYBSP_RSLT_WIFI_SDIO_ENUM_NOT_READY (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_WHD_INTEGRATION, 3)) |
SDIO device is not ready. | |
#define | CYBSP_RSLT_WIFI_SDIO_HS_SWITCH_FAILED (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_WHD_INTEGRATION, 4)) |
SDIO switch to High Speed mode failed. | |
Functions | |
cy_rslt_t | cybsp_wifi_init_primary_extended (whd_interface_t *interface, whd_init_config_t *init_config, whd_resource_source_t *resource_if, whd_buffer_funcs_t *buffer_if, whd_netif_funcs_t *netif_if) |
Initializes the primary interface for the WiFi driver on the board. More... | |
static cy_rslt_t | cybsp_wifi_init_primary (whd_interface_t *interface) |
Initializes the primary interface for the WiFi driver on the board using the default configuration, resource, buffer, and network interfaces. More... | |
cy_rslt_t | cybsp_wifi_init_secondary (whd_interface_t *interface, whd_mac_t *mac_address) |
This function initializes and adds a secondary interface to the WiFi driver. More... | |
cy_rslt_t | cybsp_wifi_deinit (whd_interface_t interface) |
De-initializes all WiFi interfaces and the WiFi driver. More... | |
whd_driver_t | cybsp_get_wifi_driver (void) |
Gets the wifi driver instance initialized by the driver. More... | |
#define CY_WIFI_THREAD_PRIORITY (CY_RTOS_PRIORITY_HIGH) |
Defines the priority of the thread that services wifi packets.
Legal values are defined by the RTOS being used.
#define CY_WIFI_COUNTRY (WHD_COUNTRY_AUSTRALIA) |
Defines the country this will operate in for wifi initialization parameters.
See the wifi-host-driver's whd_country_code_t for legal options.
#define CY_WIFI_OOB_INTR_PRIORITY (2) |
Defines the priority of the interrupt that handles out-of-band notifications from the wifi chip.
Legal values are defined by the MCU running this code.
#define CYBSP_WIFI_WL_REG_ON_GPIO_DRIVE_MODE (CYHAL_GPIO_DRIVE_PULLUP) |
Default GPIO drive mode for CYBSP_WIFI_WL_REG_ON.
Override with Makefile define
#define CYBSP_WIFI_WL_HOSTWAKE_DRIVE_MODE (CYHAL_GPIO_DRIVE_NONE) |
Default GPIO drive mode for CYBSP_WIFI_WL_HOSTWAKE.
Override with Makefile define
#define CYBSP_WIFI_WL_HOSTWAKE_INIT_STATE (WHD_FALSE) |
Default GPIO drive mode for CYBSP_WIFI_WL_HOSTWAKE.
Override with Makefile define
cy_rslt_t cybsp_wifi_init_primary_extended | ( | whd_interface_t * | interface, |
whd_init_config_t * | init_config, | ||
whd_resource_source_t * | resource_if, | ||
whd_buffer_funcs_t * | buffer_if, | ||
whd_netif_funcs_t * | netif_if | ||
) |
Initializes the primary interface for the WiFi driver on the board.
This sets up the WHD interface to use the Buffer management APIs and to communicate over the SDIO interface on the board. This function does the following:
1) Initializes the WiFi driver.
2) Turns on the WiFi chip.
[out] | interface | Interface to be initialized |
[in] | init_config | Pointer to the configuration parameters to initialize the driver. Passing NULL will use default values. |
[in] | resource_if | Pointer to resource interface to provide resources to the driver initialization process. Passing NULL will use the default. |
[in] | buffer_if | Pointer to a buffer interface to provide buffer related services to the driver instance. Passing NULL will use the default. |
[in] | netif_if | Pointer to a whd_netif_funcs_t to provide network stack services to the driver instance. Passing NULL will use the default. |
|
inlinestatic |
Initializes the primary interface for the WiFi driver on the board using the default configuration, resource, buffer, and network interfaces.
See cybsp_wifi_init_primary_extended() for more details.
[out] | interface | Interface to be initialized |
cy_rslt_t cybsp_wifi_init_secondary | ( | whd_interface_t * | interface, |
whd_mac_t * | mac_address | ||
) |
This function initializes and adds a secondary interface to the WiFi driver.
[out] | interface | Interface to be initialized |
[in] | mac_address | Mac address for secondary interface |
cy_rslt_t cybsp_wifi_deinit | ( | whd_interface_t | interface | ) |
De-initializes all WiFi interfaces and the WiFi driver.
This function does the following:
1) Deinitializes all WiFi interfaces.
2) Deinitializes the WiFi driver.
3) Turns off the WiFi chip.
[in] | interface | Either the Primary or Secondary interface. |
whd_driver_t cybsp_get_wifi_driver | ( | void | ) |
Gets the wifi driver instance initialized by the driver.
This should only be called after being initialized by cybsp_wifi_init_primary() and before being deinitialized by cybsp_wifi_deinit(). This is also the only time where the driver reference is valid.