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.
 
sl_status_t sl_wfx_deinit (void)
 Deinit the Wi-Fi chip.
 
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.
 
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.
 
sl_status_t sl_wfx_receive_frame (uint16_t *ctrl_reg)
 Receive available frame from the Wi-Fi chip.
 
sl_status_t sl_wfx_enable_irq (void)
 Enable the Wi-Fi chip irq.
 
sl_status_t sl_wfx_disable_irq (void)
 Disable the Wi-Fi chip irq.
 
sl_status_t sl_wfx_set_access_mode_message (void)
 Set access mode message.
 
sl_status_t sl_wfx_set_wake_up_bit (uint8_t state)
 Set the Wi-Fi chip wake up bit.
 
static sl_status_t sl_wfx_init_chip (void)
 Init the Wi-Fi chip.
 
static sl_status_t sl_wfx_download_run_bootloader (void)
 run the Wi-Fi chip bootloader
 
static sl_status_t sl_wfx_download_run_firmware (void)
 Download the Wi-Fi chip firmware.
 
static sl_status_t sl_wfx_poll_for_value (uint32_t address, uint32_t polled_value, uint32_t max_retries)
 Poll a value from the Wi-Fi chip.
 
static sl_status_t sl_wfx_compare_keysets (uint8_t chip_keyset, char *firmware_keyset)
 Compare the chip keyset and the firmware one to check compatibility.
 
sl_status_t sl_wfx_set_antenna_config (sl_wfx_antenna_config_t config)
 Configure the antenna setting (done through the PDS)
 
sl_status_t sl_wfx_get_hardware_revision_and_type (uint8_t *revision, uint8_t *type)
 Retrieve the hardware version and type.
 
sl_status_t sl_wfx_get_opn (uint8_t **opn)
 Get the part opn.
 
sl_status_t sl_wfx_allocate_command_buffer (sl_wfx_generic_message_t **buffer, uint32_t command_id, uint32_t buffer_size, uint32_t wait_duration_ms)
 Allocate a buffer for the Wi-Fi driver.

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,
uint32_t  buffer_size,
uint32_t  wait_duration_ms 
)

Allocate a buffer for the Wi-Fi driver.

Parameters
buffer
command_idis the ID of the command to check if encryption is required
buffer_sizeis the size of the buffer to allocate
wait_duration_msis the duration before returning SL_TIMEOUT
Returns
SL_SUCCESS if the values are retrieved correctly, SL_TIMEOUT if the buffer is not allocated in time, SL_ERROR otherwise

Definition at line 1805 of file sl_wfx.c.

Referenced by sl_wfx_send_command(), sl_wfx_send_configuration(), sl_wfx_send_join_command(), sl_wfx_send_scan_command(), sl_wfx_set_roam_parameters(), sl_wfx_shutdown(), sl_wfx_start_ap_command(), and sl_wfx_update_ap_command().

◆ sl_wfx_compare_keysets()

static sl_status_t sl_wfx_compare_keysets ( uint8_t  chip_keyset,
char *  firmware_keyset 
)
static

Compare the chip keyset and the firmware one to check compatibility.

Parameters
chip_keysetis the value retrieved from the Wi-Fi chip
firmware_keysetis the 8 first bytes of the firmware
Returns
SL_SUCCESS if the firmware is compatible with the WF200, SL_WIFI_INVALID_KEY otherwise

Definition at line 1706 of file sl_wfx.c.

Referenced by sl_wfx_download_run_firmware().

◆ sl_wfx_deinit()

sl_status_t sl_wfx_deinit ( void  )

Deinit the Wi-Fi chip.

Returns
Returns SL_SUCCESS if the deinitialization is successful, SL_ERROR otherwise

Definition at line 170 of file sl_wfx.c.

References sl_wfx_disable_irq(), and sl_wfx_shutdown().

◆ sl_wfx_disable_irq()

sl_status_t sl_wfx_disable_irq ( void  )

Disable the Wi-Fi chip irq.

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

Definition at line 1334 of file sl_wfx.c.

Referenced by sl_wfx_deinit(), and sl_wfx_init().

◆ sl_wfx_download_run_bootloader()

static sl_status_t sl_wfx_download_run_bootloader ( void  )
static

run the Wi-Fi chip bootloader

Returns
SL_SUCCESS if the bootloader runs correctly, SL_ERROR otherwise

Definition at line 1473 of file sl_wfx.c.

Referenced by sl_wfx_init().

◆ sl_wfx_download_run_firmware()

static sl_status_t sl_wfx_download_run_firmware ( void  )
static

Download the Wi-Fi chip firmware.

Returns
SL_SUCCESS if the firmware is downloaded correctly, SL_WIFI_INVALID_KEY if the firmware keyset does not match the chip one, SL_WIFI_FIRMWARE_DOWNLOAD_TIMEOUT or SL_TIMEOUT if the process times out, SL_ERROR otherwise

Definition at line 1512 of file sl_wfx.c.

References sl_wfx_compare_keysets(), and sl_wfx_poll_for_value().

Referenced by sl_wfx_init().

◆ sl_wfx_enable_irq()

sl_status_t sl_wfx_enable_irq ( void  )

Enable the Wi-Fi chip irq.

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

Definition at line 1307 of file sl_wfx.c.

Referenced by sl_wfx_init().

◆ 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_SUCCESS if the values are retrieved correctly, SL_ERROR otherwise

Definition at line 1765 of file sl_wfx.c.

◆ sl_wfx_get_opn()

sl_status_t sl_wfx_get_opn ( uint8_t **  opn)

Get the part opn.

Parameters
opn
Returns
SL_SUCCESS if the values are retrieved correctly, SL_ERROR otherwise

Definition at line 1783 of file sl_wfx.c.

References sl_wfx_context_t::opn.

◆ sl_wfx_init()

sl_status_t sl_wfx_init ( sl_wfx_context_t context)

Init the Wi-Fi chip.

Copyright 2018, Silicon Laboratories Inc.

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

Definition at line 78 of file sl_wfx.c.

References sl_wfx_context_t::mac_addr_0, sl_wfx_context_t::mac_addr_1, sl_wfx_disable_irq(), sl_wfx_download_run_bootloader(), sl_wfx_download_run_firmware(), sl_wfx_enable_irq(), sl_wfx_init_chip(), sl_wfx_send_configuration(), sl_wfx_set_access_mode_message(), SL_WFX_STARTUP_IND_ID, and sl_wfx_context_t::waited_event_id.

◆ sl_wfx_init_chip()

static sl_status_t sl_wfx_init_chip ( void  )
static

Init the Wi-Fi chip.

Returns
SL_SUCCESS if the initialization is successful, SL_ERROR otherwise

Definition at line 1411 of file sl_wfx.c.

Referenced by sl_wfx_init().

◆ sl_wfx_poll_for_value()

static sl_status_t sl_wfx_poll_for_value ( uint32_t  address,
uint32_t  polled_value,
uint32_t  max_retries 
)
static

Poll a value from the Wi-Fi chip.

Parameters
addressis the address of the value to be polled
polled_valuewaiting for the value to be equal to polled_value
max_retriesis the number of polling to be done before returning SL_TIMEOUT
Returns
SL_SUCCESS if the value is received correctly, SL_TIMEOUT if the value is not found in time, SL_ERROR if not able to poll the value from the Wi-Fi chip

Definition at line 1676 of file sl_wfx.c.

Referenced by sl_wfx_download_run_firmware().

◆ 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_SUCCESS if the frame has been received correctly, SL_WIFI_NO_PACKET_TO_RECEIVE if no frame are pending inside the Wi-Fi chip SL_ERROR otherwise

Definition at line 1252 of file sl_wfx.c.

◆ 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. wfm_fm_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_SUCCESS if the command is sent correctly, SL_ERROR otherwise

Definition at line 1179 of file sl_wfx.c.

References sl_wfx_generic_message_t::body, sl_wfx_generic_message_t::header, sl_wfx_header_t::info, sl_wfx_allocate_command_buffer(), sl_wfx_send_request(), and WFM_STATUS_SUCCESS.

Referenced by sl_wfx_add_blacklist_address(), sl_wfx_add_multicast_address(), sl_wfx_add_whitelist_address(), sl_wfx_control_gpio(), sl_wfx_disconnect_ap_client_command(), sl_wfx_get_max_tx_power(), sl_wfx_get_signal_strength(), sl_wfx_join_ibss_command(), sl_wfx_leave_ibss_command(), sl_wfx_prevent_rollback(), sl_wfx_remove_multicast_address(), sl_wfx_send_disconnect_command(), sl_wfx_send_stop_scan_command(), sl_wfx_set_arp_ip_address(), sl_wfx_set_broadcast_filter(), sl_wfx_set_mac_address(), sl_wfx_set_max_ap_client(), sl_wfx_set_max_ap_client_inactivity(), sl_wfx_set_max_tx_power(), sl_wfx_set_ns_ip_address(), sl_wfx_set_power_mode(), sl_wfx_set_scan_parameters(), sl_wfx_set_tx_rate_parameters(), sl_wfx_set_unicast_filter(), and sl_wfx_stop_ap_command().

◆ 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. wfm_fm_api.h)
requestis the pointer to the request to be sent
request_lengthis the size of the request to be sent
Returns
SL_SUCCESS if the command is sent correctly, SL_ERROR otherwise

Definition at line 1230 of file sl_wfx.c.

References sl_wfx_generic_message_t::header, sl_wfx_header_t::id, sl_wfx_header_t::length, sl_wfx_context_t::posted_event_id, and sl_wfx_context_t::waited_event_id.

Referenced by sl_wfx_send_command(), sl_wfx_send_configuration(), sl_wfx_send_ethernet_frame(), sl_wfx_send_join_command(), sl_wfx_send_scan_command(), sl_wfx_set_roam_parameters(), sl_wfx_shutdown(), sl_wfx_start_ap_command(), and sl_wfx_update_ap_command().

◆ sl_wfx_set_access_mode_message()

sl_status_t sl_wfx_set_access_mode_message ( void  )

Set access mode message.

Returns
SL_SUCCESS if the message mode is enabled correctly, SL_ERROR otherwise

Definition at line 1360 of file sl_wfx.c.

Referenced by sl_wfx_init().

◆ 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_SUCCESS if the setting is applied correctly, SL_ERROR otherwise

Definition at line 1736 of file sl_wfx.c.

References sl_wfx_send_configuration().

◆ 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_SUCCESS if the bit has been set correctly, SL_ERROR otherwise

Definition at line 1382 of file sl_wfx.c.

Referenced by sl_wfx_shutdown().