...
- Perform device configuration validation. Since some devices require special configuration, the configuration structure received should be examined at the initialization of the device and set along with setting
*p_err
if and unacceptable value have been specified toerr
to returnNET_DEV_ERR_INVALID_CFG
must be returned if an unacceptable value has been specified. - Configure all necessary I/O pins for SPI, external interrupt, power pin , and reset pin. This is performed via the network device’s BSP function pointer,
NetDev_WiFi_CfgGPIO()
, implemented innet_bsp.c
. - Configure the host interrupt controller for to receive and transmit complete interrupts. Additional interrupt services may be initialized depending on the device and driver requirements. This is performed via the network device’s BSP function pointer,
NetDev_WiFi_CfgIntCtrl()
, implemented innet_bsp.c
. However, receive interrupt interrupts should not be enabled before starting the interface. - Allocate memory for all necessary local buffers. This is performed via calls to μC/LIB’s memory module.
- Initialize the SPI controller. This is performed via the network device’s BSP function pointer,
NetDev_WiFi_SPI_Init()
. The communication between the host and the wireless module should not be initialized, the wireless device should be powered down during and after the initialization. - Set
p_err
toNET_DEV_ERR_NONE
if initialization initializations proceeded as expected. Otherwise, setp_err
to an appropriate network device error code.
Warning |
---|
|