XCORE SDK
XCORE Software Development Kit
Modules | Functions
DRIVER_API

Modules

 FULL_MAC_DRIVER_API
 
 GENERAL_DRIVER_API
 

Functions

sl_status_t sl_wfx_init (sl_wfx_context_t *context)
 Init the Wi-Fi chip. More...
 
sl_status_t sl_wfx_deinit (void)
 Deinit the Wi-Fi chip. More...
 
sl_status_t sl_wfx_send_command (uint8_t command_id, void *data, uint32_t data_size, sl_wfx_interface_t interface, sl_wfx_generic_confirmation_t **response)
 Send a command to WF200. More...
 
sl_status_t sl_wfx_send_request (uint8_t command_id, sl_wfx_generic_message_t *request, uint16_t request_length)
 Send a request to the Wi-Fi chip. More...
 
sl_status_t sl_wfx_receive_frame (uint16_t *ctrl_reg)
 Receive available frame from the Wi-Fi chip. More...
 
sl_status_t sl_wfx_enable_irq (void)
 Enable the Wi-Fi chip irq. More...
 
sl_status_t sl_wfx_disable_irq (void)
 Disable the Wi-Fi chip irq. More...
 
sl_status_t sl_wfx_set_access_mode_message (void)
 Set access mode message. More...
 
sl_status_t sl_wfx_set_wake_up_bit (uint8_t state)
 Set the Wi-Fi chip wake up bit. More...
 
sl_status_t sl_wfx_enable_device_power_save (void)
 Active the power save feature in the FMAC driver and let the WFx go in sleep mode. More...
 
sl_status_t sl_wfx_disable_device_power_save (void)
 Disable the power save feature in the FMAC driver and prevent the WFx going in sleep mode. More...
 
sl_status_t sl_wfx_set_antenna_config (sl_wfx_antenna_config_t config)
 Configure the antenna setting (done through the PDS) More...
 
sl_status_t sl_wfx_get_hardware_revision_and_type (uint8_t *revision, uint8_t *type)
 Retrieve the hardware version and type. More...
 
sl_status_t sl_wfx_get_opn (uint8_t **opn)
 Get the part opn. More...
 
sl_status_t sl_wfx_get_status_code (uint32_t wfx_status, uint8_t command_id)
 Extract status code from WFx message. More...
 
sl_status_t sl_wfx_allocate_command_buffer (sl_wfx_generic_message_t **buffer, uint32_t command_id, sl_wfx_buffer_type_t type, uint32_t buffer_size)
 Allocate a buffer for the Wi-Fi driver. More...
 
sl_status_t sl_wfx_free_command_buffer (sl_wfx_generic_message_t *buffer, uint32_t command_id, sl_wfx_buffer_type_t type)
 Free a buffer for the Wi-Fi driver. More...
 

Detailed Description

Function Documentation

◆ sl_wfx_allocate_command_buffer()

sl_status_t sl_wfx_allocate_command_buffer ( sl_wfx_generic_message_t **  buffer,
uint32_t  command_id,
sl_wfx_buffer_type_t  type,
uint32_t  buffer_size 
)

Allocate a buffer for the Wi-Fi driver.

Parameters
buffer
command_idis the ID of the command to check if encryption is required
typeof the buffer to allocate
buffer_sizeis the size of the buffer to allocate
Returns
SL_STATUS_OK if the values are retrieved correctly, SL_STATUS_TIMEOUT if the buffer is not allocated in time, SL_STATUS_FAIL otherwise

◆ sl_wfx_deinit()

sl_status_t sl_wfx_deinit ( void  )

Deinit the Wi-Fi chip.

Returns
Returns SL_STATUS_OK if the deinitialization is successful, SL_STATUS_FAIL otherwise

◆ sl_wfx_disable_device_power_save()

sl_status_t sl_wfx_disable_device_power_save ( void  )

Disable the power save feature in the FMAC driver and prevent the WFx going in sleep mode.

Returns
SL_STATUS_OK if the bit has been set correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_disable_irq()

sl_status_t sl_wfx_disable_irq ( void  )

Disable the Wi-Fi chip irq.

Returns
SL_STATUS_OK if the irq is disabled correctly, SL_STATUS_FAIL otherwise
Note
Disable the host irq and set the Wi-Fi chip register accordingly

◆ sl_wfx_enable_device_power_save()

sl_status_t sl_wfx_enable_device_power_save ( void  )

Active the power save feature in the FMAC driver and let the WFx go in sleep mode.

Returns
SL_STATUS_OK if the bit has been set correctly, SL_STATUS_FAIL otherwise
Note
In connected state, it is required to activate the Wi-Fi power mode using sl_wfx_set_power_mode() to allow the WFx chip to go to sleep.

◆ sl_wfx_enable_irq()

sl_status_t sl_wfx_enable_irq ( void  )

Enable the Wi-Fi chip irq.

Returns
SL_STATUS_OK if the irq is enabled correctly, SL_STATUS_FAIL otherwise
Note
Enable the host irq and set the Wi-Fi chip register accordingly

◆ sl_wfx_free_command_buffer()

sl_status_t sl_wfx_free_command_buffer ( sl_wfx_generic_message_t buffer,
uint32_t  command_id,
sl_wfx_buffer_type_t  type 
)

Free a buffer for the Wi-Fi driver.

Parameters
buffer
command_idis the ID of the command to check if encryption is required
typeof the buffer to allocate
Returns
SL_STATUS_OK if the values are retrieved correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_get_hardware_revision_and_type()

sl_status_t sl_wfx_get_hardware_revision_and_type ( uint8_t *  revision,
uint8_t *  type 
)

Retrieve the hardware version and type.

Parameters
revisionis the pointer to retrieve the revision version
typeis the pointer to retrieve the type
Returns
SL_STATUS_OK if the values are retrieved correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_get_opn()

sl_status_t sl_wfx_get_opn ( uint8_t **  opn)

Get the part opn.

Parameters
opn
Returns
SL_STATUS_OK if the values are retrieved correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_get_status_code()

sl_status_t sl_wfx_get_status_code ( uint32_t  wfx_status,
uint8_t  command_id 
)

Extract status code from WFx message.

Parameters
wfx_statusis the status returned by the WFx
command_idis the ID of the command
Returns
corresponding driver status code enumerated in sl_status_t

◆ sl_wfx_init()

sl_status_t sl_wfx_init ( sl_wfx_context_t context)

Init the Wi-Fi chip.

Parameters
contextmaintain the Wi-Fi chip information
Returns
Returns SL_STATUS_OK if the initialization is successful, SL_STATUS_FAIL otherwise
Note
Actions performed by sl_wfx_init(): Reset -> load firmware -> send PDS

◆ sl_wfx_receive_frame()

sl_status_t sl_wfx_receive_frame ( uint16_t *  ctrl_reg)

Receive available frame from the Wi-Fi chip.

Parameters
ctrl_regis the control register value of the last call of sl_wfx_receive_frame(). If equal to 0, the driver will read the control register.
Returns
SL_STATUS_OK if the frame has been received correctly, SL_STATUS_WIFI_NO_PACKET_TO_RECEIVE if no frame are pending inside the Wi-Fi chip SL_STATUS_FAIL otherwise

◆ sl_wfx_send_command()

sl_status_t sl_wfx_send_command ( uint8_t  command_id,
void *  data,
uint32_t  data_size,
sl_wfx_interface_t  interface,
sl_wfx_generic_confirmation_t **  response 
)

Send a command to WF200.

Parameters
command_idis the ID of the command to be sent (cf. sl_wfx_cmd_api.h)
datais the pointer to the data to be sent by the command
data_sizeis the size of the data to be sent
interfaceis the interface affected by the command
responseis a pointer to the response retrieved
  • SL_WFX_STA_INTERFACE
  • SL_WFX_SOFTAP_INTERFACE
Returns
SL_STATUS_OK if the command is sent correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_send_request()

sl_status_t sl_wfx_send_request ( uint8_t  command_id,
sl_wfx_generic_message_t request,
uint16_t  request_length 
)

Send a request to the Wi-Fi chip.

Parameters
command_idis the ID of the command to be sent (cf. sl_wfx_cmd_api.h)
requestis the pointer to the request to be sent
request_lengthis the size of the request to be sent
Returns
SL_STATUS_OK if the command is sent correctly, SL_STATUS_WOULD_OVERFLOW if the HIF queue is full, SL_STATUS_FAIL otherwise

◆ sl_wfx_set_access_mode_message()

sl_status_t sl_wfx_set_access_mode_message ( void  )

Set access mode message.

Returns
SL_STATUS_OK if the message mode is enabled correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_set_antenna_config()

sl_status_t sl_wfx_set_antenna_config ( sl_wfx_antenna_config_t  config)

Configure the antenna setting (done through the PDS)

Parameters
configis the antenna configuration to be used.
  • SL_WFX_ANTENNA_1_ONLY
  • SL_WFX_ANTENNA_2_ONLY
  • SL_WFX_ANTENNA_TX1_RX2
  • SL_WFX_ANTENNA_TX2_RX1
  • SL_WFX_ANTENNA_DIVERSITY
Returns
SL_STATUS_OK if the setting is applied correctly, SL_STATUS_FAIL otherwise

◆ sl_wfx_set_wake_up_bit()

sl_status_t sl_wfx_set_wake_up_bit ( uint8_t  state)

Set the Wi-Fi chip wake up bit.

Parameters
stateis the state of the wake up bit to configure
Returns
SL_STATUS_OK if the bit has been set correctly, SL_STATUS_FAIL otherwise