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.
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.
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.
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, sl_wfx_buffer_type_t type, uint32_t buffer_size)
Allocate a buffer for the Wi-Fi driver.
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.

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_id is the ID of the command to check if encryption is required
type of the buffer to allocate
buffer_size is the size of the buffer to allocate
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 2021 of file sl_wfx.c .

References sl_wfx_host_allocate_buffer() .

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_keyset is the value retrieved from the Wi-Fi chip
firmware_keyset is 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 1854 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 187 of file sl_wfx.c .

References sl_wfx_disable_irq() , and sl_wfx_shutdown() .

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

Definition at line 1529 of file sl_wfx.c .

References sl_wfx_context_t::state .

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 1424 of file sl_wfx.c .

Referenced by sl_wfx_deinit() .

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 1621 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 1660 of file sl_wfx.c .

References sl_wfx_compare_keysets() , sl_wfx_host_deinit() , sl_wfx_host_get_firmware_data() , sl_wfx_host_get_firmware_size() , sl_wfx_host_init() , and sl_wfx_poll_for_value() .

Referenced by sl_wfx_init() .

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

Definition at line 1501 of file sl_wfx.c .

References sl_wfx_context_t::state .

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 1397 of file sl_wfx.c .

References sl_wfx_host_enable_platform_interrupt() .

Referenced by sl_wfx_init() .

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_id is the ID of the command to check if encryption is required
type of the buffer to allocate
Returns
SL_SUCCESS if the values are retrieved correctly, SL_ERROR otherwise

Definition at line 2050 of file sl_wfx.c .

References sl_wfx_host_free_buffer() .

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
revision is the pointer to retrieve the revision version
type is the pointer to retrieve the type
Returns
SL_SUCCESS if the values are retrieved correctly, SL_ERROR otherwise

Definition at line 1913 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 1931 of file sl_wfx.c .

References sl_wfx_context_t::wfx_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
context maintain 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 81 of file sl_wfx.c .

References sl_wfx_context_t::firmware_build , sl_wfx_context_t::firmware_major , sl_wfx_context_t::firmware_minor , sl_wfx_context_t::mac_addr_0 , sl_wfx_context_t::mac_addr_1 , sl_wfx_mac_address_t::octet , sl_wfx_download_run_bootloader() , sl_wfx_download_run_firmware() , sl_wfx_enable_irq() , sl_wfx_host_get_pds_data() , sl_wfx_host_get_pds_size() , sl_wfx_host_set_wake_up_pin() , sl_wfx_host_setup_waited_event() , sl_wfx_host_wait_for_confirmation() , sl_wfx_init_chip() , sl_wfx_send_configuration() , sl_wfx_set_access_mode_message() , SL_WFX_STARTUP_IND_ID , sl_wfx_context_t::state , and sl_wfx_context_t::used_buffers .

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 1559 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
address is the address of the value to be polled
polled_value waiting for the value to be equal to polled_value
max_retries is 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 1824 of file sl_wfx.c .

References sl_wfx_host_wait() .

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_reg is 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 1325 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_id is the ID of the command to be sent (cf. wfm_fm_api.h)
data is the pointer to the data to be sent by the command
data_size is the size of the data to be sent
interface is the interface affected by the command
response is 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 1240 of file sl_wfx.c .

References sl_wfx_allocate_command_buffer() .

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_ap_client_signal_strength() , 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_id is the ID of the command to be sent (cf. wfm_fm_api.h)
request is the pointer to the request to be sent
request_length is the size of the request to be sent
Returns
SL_SUCCESS if the command is sent correctly, SL_ERROR otherwise

Definition at line 1293 of file sl_wfx.c .

References sl_wfx_generic_message_t::header , sl_wfx_header_t::id , sl_wfx_header_t::length , sl_wfx_host_setup_waited_event() , sl_wfx_host_transmit_frame() , and sl_wfx_context_t::used_buffers .

Referenced by sl_wfx_send_ethernet_frame() .

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 1450 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
config is 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 1884 of file sl_wfx.c .

References SL_WFX_ANTENNA_DIVERSITY , and 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
state is 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 1472 of file sl_wfx.c .