HOST_API

Functions

sl_status_t sl_wfx_host_init (void)
Driver hook to initialize the host resources.
sl_status_t sl_wfx_host_get_firmware_data (const uint8_t **data, uint32_t data_size)
Driver hook to retrieve a firmware chunk.
sl_status_t sl_wfx_host_get_firmware_size (uint32_t *firmware_size)
Driver hook to retrieve the firmware size.
sl_status_t sl_wfx_host_get_pds_data (const char **pds_data, uint16_t index)
Driver hook to retrieve a PDS line.
sl_status_t sl_wfx_host_get_pds_size (uint16_t *pds_size)
Driver hook to get the number of line of the PDS.
sl_status_t sl_wfx_host_deinit (void)
Driver hook to deinitialize the host resources.
sl_status_t sl_wfx_host_reset_chip (void)
Implement the reset of the WFx chip.
sl_status_t sl_wfx_host_set_wake_up_pin (uint8_t state)
Drive the wake up pin in the requested state.
sl_status_t sl_wfx_host_wait_for_wake_up (void)
Function called once the WFx chip is waking up.
sl_status_t sl_wfx_host_sleep_grant ( sl_wfx_host_bus_tranfer_type_t type, sl_wfx_register_address_t address, uint32_t length)
Function called when the driver is considering putting the WFx in sleep mode.
sl_status_t sl_wfx_host_hold_in_reset (void)
Hold the WFx chip in reset mode.
sl_status_t sl_wfx_host_setup_waited_event (uint8_t event_id)
Function called to setup the next event that the driver will wait.
sl_status_t sl_wfx_host_wait_for_confirmation (uint8_t confirmation_id, uint32_t timeout_ms, void **event_payload_out)
Function called when the driver is waiting for a confirmation.
sl_status_t sl_wfx_host_wait (uint32_t wait_ms)
Called when the FMAC driver wants to add a delay.
sl_status_t sl_wfx_host_post_event ( sl_wfx_generic_message_t *event_payload)
Function called when a message is received from the WFx chip.
sl_status_t sl_wfx_host_allocate_buffer (void **buffer, sl_wfx_buffer_type_t type, uint32_t buffer_size)
Function called when the driver wants to allocate memory.
sl_status_t sl_wfx_host_free_buffer (void *buffer, sl_wfx_buffer_type_t type)
Function called when the driver wants to free memory.
sl_status_t sl_wfx_host_transmit_frame (void *frame, uint32_t frame_len)
Function called when the driver sends a frame to the WFx chip.
sl_status_t sl_wfx_host_init_bus (void)
Function called to initialize the host bus.
sl_status_t sl_wfx_host_deinit_bus (void)
Function called to deinitialize the host bus.
sl_status_t sl_wfx_host_enable_platform_interrupt (void)
Function called to enable the bus interrupt.
sl_status_t sl_wfx_host_disable_platform_interrupt (void)
Function called to disable the bus interrupt.
sl_status_t sl_wfx_host_spi_cs_assert (void)
Function called to assert the SPI Chip Select pin.
sl_status_t sl_wfx_host_spi_cs_deassert (void)
Function called to deassert the SPI Chip Select pin.
sl_status_t sl_wfx_host_spi_transfer_no_cs_assert ( sl_wfx_host_bus_tranfer_type_t type, uint8_t *header, uint16_t header_length, uint8_t *buffer, uint16_t buffer_length)
Function called to send data on the SPI bus.
sl_status_t sl_wfx_host_sdio_transfer_cmd52 ( sl_wfx_host_bus_tranfer_type_t type, uint8_t function, uint32_t address, uint8_t *buffer)
Function called to send command 52 on the SDIO bus.
sl_status_t sl_wfx_host_sdio_transfer_cmd53 ( sl_wfx_host_bus_tranfer_type_t type, uint8_t function, uint32_t address, uint8_t *buffer, uint16_t buffer_length)
Function called to send command 53 on the SDIO bus.
sl_status_t sl_wfx_host_sdio_enable_high_speed_mode (void)
Function called to enable the SDIO high speed mode.

Function Documentation

sl_wfx_host_allocate_buffer()

sl_status_t sl_wfx_host_allocate_buffer ( void ** buffer,
sl_wfx_buffer_type_t type,
uint32_t buffer_size
)

Function called when the driver wants to allocate memory.

Parameters
buffer is a pointer to the data
type is the type of buffer to allocate (see sl_wfx_buffer_type_t )
buffer_size represents the amount of memory to allocate
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called by the driver everytime it needs memory

Referenced by sl_wfx_allocate_command_buffer() .

sl_wfx_host_deinit()

sl_status_t sl_wfx_host_deinit ( void )

Driver hook to deinitialize the host resources.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called if an error occurs during the initialization phase

Referenced by sl_wfx_download_run_firmware() .

sl_wfx_host_deinit_bus()

sl_status_t sl_wfx_host_deinit_bus ( void )

Function called to deinitialize the host bus.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called if an error occurs during the initialization phase

sl_wfx_host_disable_platform_interrupt()

sl_status_t sl_wfx_host_disable_platform_interrupt ( void )

Function called to disable the bus interrupt.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_enable_platform_interrupt()

sl_status_t sl_wfx_host_enable_platform_interrupt ( void )

Function called to enable the bus interrupt.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

Referenced by sl_wfx_enable_irq() .

sl_wfx_host_free_buffer()

sl_status_t sl_wfx_host_free_buffer ( void * buffer,
sl_wfx_buffer_type_t type
)

Function called when the driver wants to free memory.

Parameters
buffer is the pointer to the memory to free
type is the type of buffer to free (see sl_wfx_buffer_type_t )
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

Referenced by sl_wfx_free_command_buffer() .

sl_wfx_host_get_firmware_data()

sl_status_t sl_wfx_host_get_firmware_data ( const uint8_t ** data,
uint32_t data_size
)

Driver hook to retrieve a firmware chunk.

Parameters
data is a pointer to the firmware data
data_size is the size of data requested by the driver
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called multiple times during the driver initialization phase

Referenced by sl_wfx_download_run_firmware() .

sl_wfx_host_get_firmware_size()

sl_status_t sl_wfx_host_get_firmware_size ( uint32_t * firmware_size )

Driver hook to retrieve the firmware size.

Parameters
firmware_size is a pointer to the firmware size value
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called once during the driver initialization phase

Referenced by sl_wfx_download_run_firmware() .

sl_wfx_host_get_pds_data()

sl_status_t sl_wfx_host_get_pds_data ( const char ** pds_data,
uint16_t index
)

Driver hook to retrieve a PDS line.

Parameters
pds_data is a pointer to the PDS data
index is the index of the line requested by the driver
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called multiple times during the driver initialization phase

Referenced by sl_wfx_init() .

sl_wfx_host_get_pds_size()

sl_status_t sl_wfx_host_get_pds_size ( uint16_t * pds_size )

Driver hook to get the number of line of the PDS.

Parameters
pds_size is a pointer to the PDS size value
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called once during the driver initialization phase

Referenced by sl_wfx_init() .

sl_wfx_host_hold_in_reset()

sl_status_t sl_wfx_host_hold_in_reset ( void )

Hold the WFx chip in reset mode.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
The reset pin is asserted by the host to keep the WFx chip in reset

sl_wfx_host_init()

sl_status_t sl_wfx_host_init ( void )

Driver hook to initialize the host resources.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called once during the driver initialization phase

Referenced by sl_wfx_download_run_firmware() .

sl_wfx_host_init_bus()

sl_status_t sl_wfx_host_init_bus ( void )

Function called to initialize the host bus.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called once during the driver initialization phase

sl_wfx_host_post_event()

sl_status_t sl_wfx_host_post_event ( sl_wfx_generic_message_t * event_payload )

Function called when a message is received from the WFx chip.

Parameters
event_payload is a pointer to the data received
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called by sl_wfx_receive_frame function

sl_wfx_host_reset_chip()

sl_status_t sl_wfx_host_reset_chip ( void )

Implement the reset of the WFx chip.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
This function asserts the reset pin of the WFx chip for a while before returning

sl_wfx_host_sdio_enable_high_speed_mode()

sl_status_t sl_wfx_host_sdio_enable_high_speed_mode ( void )

Function called to enable the SDIO high speed mode.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_sdio_transfer_cmd52()

sl_status_t sl_wfx_host_sdio_transfer_cmd52 ( sl_wfx_host_bus_tranfer_type_t type,
uint8_t function,
uint32_t address,
uint8_t * buffer
)

Function called to send command 52 on the SDIO bus.

Parameters
type is the type of bus action (see sl_wfx_host_bus_tranfer_type_t )
function is the function to use in the SDIO command
address is the address to use in the SDIO command
buffer is a pointer to the buffer data
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_sdio_transfer_cmd53()

sl_status_t sl_wfx_host_sdio_transfer_cmd53 ( sl_wfx_host_bus_tranfer_type_t type,
uint8_t function,
uint32_t address,
uint8_t * buffer,
uint16_t buffer_length
)

Function called to send command 53 on the SDIO bus.

Parameters
type is the type of bus action (see sl_wfx_host_bus_tranfer_type_t )
function is the function to use in the SDIO command
address is the address to use in the SDIO command
buffer is a pointer to the buffer data
buffer_length is the length of the buffer data
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_set_wake_up_pin()

sl_status_t sl_wfx_host_set_wake_up_pin ( uint8_t state )

Drive the wake up pin in the requested state.

Parameters
state to be applied to the wake up pin
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called if the sleep mode is enabled

Referenced by sl_wfx_init() .

sl_wfx_host_setup_waited_event()

sl_status_t sl_wfx_host_setup_waited_event ( uint8_t event_id )

Function called to setup the next event that the driver will wait.

Parameters
event_id is the ID to be waited
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called every time a API command is called

Referenced by sl_wfx_init() , and sl_wfx_send_request() .

sl_wfx_host_sleep_grant()

sl_status_t sl_wfx_host_sleep_grant ( sl_wfx_host_bus_tranfer_type_t type,
sl_wfx_register_address_t address,
uint32_t length
)

Function called when the driver is considering putting the WFx in sleep mode.

Parameters
type is the type of the message sent
address is the address of the message sent
length is the length of the message to be sent
Returns
Returns SL_WIFI_SLEEP_GRANTED to let the WFx go to sleep, SL_WIFI_SLEEP_NOT_GRANTED otherwise
Note
The parameters are given as information for the host to take a decision on whether or not the WFx is put back to sleep mode.

sl_wfx_host_spi_cs_assert()

sl_status_t sl_wfx_host_spi_cs_assert ( void )

Function called to assert the SPI Chip Select pin.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_spi_cs_deassert()

sl_status_t sl_wfx_host_spi_cs_deassert ( void )

Function called to deassert the SPI Chip Select pin.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_spi_transfer_no_cs_assert()

sl_status_t sl_wfx_host_spi_transfer_no_cs_assert ( sl_wfx_host_bus_tranfer_type_t type,
uint8_t * header,
uint16_t header_length,
uint8_t * buffer,
uint16_t buffer_length
)

Function called to send data on the SPI bus.

Parameters
type is the type of bus action (see sl_wfx_host_bus_tranfer_type_t )
header is a pointer to the header data
header_length is the length of the header data
buffer is a pointer to the buffer data
buffer_length is the length of the buffer data
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

sl_wfx_host_transmit_frame()

sl_status_t sl_wfx_host_transmit_frame ( void * frame,
uint32_t frame_len
)

Function called when the driver sends a frame to the WFx chip.

Parameters
frame is a pointer to the frame data
frame_len is size of the frame
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise

Referenced by sl_wfx_send_request() .

sl_wfx_host_wait()

sl_status_t sl_wfx_host_wait ( uint32_t wait_ms )

Called when the FMAC driver wants to add a delay.

Parameters
wait_ms is the time to wait
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Can be a passive wait or in a RTOS context a task sleep

Referenced by sl_wfx_poll_for_value() .

sl_wfx_host_wait_for_confirmation()

sl_status_t sl_wfx_host_wait_for_confirmation ( uint8_t confirmation_id,
uint32_t timeout_ms,
void ** event_payload_out
)

Function called when the driver is waiting for a confirmation.

Parameters
confirmation_id is the ID to be waited
timeout_ms is the time before the command times out
event_payload_out is a pointer to the data returned by the confirmation
Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called every time a API command is called

Referenced by sl_wfx_init() .

sl_wfx_host_wait_for_wake_up()

sl_status_t sl_wfx_host_wait_for_wake_up ( void )

Function called once the WFx chip is waking up.

Returns
Returns SL_SUCCESS if successful, SL_ERROR otherwise
Note
Called if the sleep mode is enabled. The function waits for the WFx interruption