GENERAL_DRIVER_APIDRIVER_API

Functions

sl_status_t sl_wfx_secure_link_set_mac_key (const uint8_t *sl_mac_key, sl_wfx_securelink_mac_key_dest_t destination)
SecureLink Set MAC Key.
sl_status_t sl_wfx_secure_link_exchange_keys (const uint8_t *sl_mac_key)
Exchange SecureLink public keys.
sl_status_t sl_wfx_secure_link_renegotiate_session_key (void)
Renegotiate session key request.
sl_status_t sl_wfx_secure_link_configure (const uint8_t *encryption_bitmap, uint8_t disable_session_key_protection)
Modify SecureLink configuration.
sl_status_t sl_wfx_send_configuration (const char *pds_data, uint32_t pds_data_length)
Function to send PDS chunks.
sl_status_t sl_wfx_control_gpio (uint8_t gpio_label, uint8_t gpio_mode, uint32_t *value)
Send a request to read or write a GPIO.
sl_status_t sl_wfx_pta_settings (uint8_t pta_mode, uint8_t request_signal_active_level, uint8_t priority_signal_active_level, uint8_t freq_signal_active_level, uint8_t grant_signal_active_level, uint8_t coex_type, uint8_t default_grant_state, uint8_t simultaneous_rx_access, uint8_t priority_sampling_time, uint8_t tx_rx_sampling_time, uint8_t freq_sampling_time, uint8_t grant_valid_time, uint8_t fem_control_time, uint8_t first_slot_time, uint16_t periodic_tx_rx_sampling_time, uint16_t coex_quota, uint16_t wlan_quota)
Send a request to set the PTA mode, the active levels on signals, the Coex type, to define the timings, quotas, combined mode and default grant state.
sl_status_t sl_wfx_pta_priority (uint32_t priority)
Send a request to define the level of priority used to arbitrate concurrent Coex and Wlan requests.
sl_status_t sl_wfx_pta_state (uint32_t pta_state)
Send a request to start or stop the PTA.
sl_status_t sl_wfx_prevent_rollback (uint32_t magic_word)
Prevent Rollback request.
sl_status_t sl_wfx_shutdown (void)
Shutdown the Wi-Fi chip.

Function Documentation

sl_wfx_control_gpio()

sl_status_t sl_wfx_control_gpio ( uint8_t gpio_label,
uint8_t gpio_mode,
uint32_t * value
)

Send a request to read or write a GPIO.

Parameters
gpio_label is the GPIO label to control (defined in the PDS)
gpio_mode defines how to read or set the GPIO
value returns the read value or the detailed error cause
Returns
SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise

Definition at line 1210 of file sl_wfx.c .

References sl_wfx_control_gpio_req_body_t::gpio_label , sl_wfx_control_gpio_req_body_t::gpio_mode , SL_WFX_CONTROL_GPIO_REQ_ID , sl_wfx_get_status_code() , sl_wfx_send_command() , SL_WFX_STA_INTERFACE , and sl_wfx_generic_confirmation_t::status .

sl_wfx_prevent_rollback()

sl_status_t sl_wfx_prevent_rollback ( uint32_t magic_word )

Prevent Rollback request.

Parameters
magic_word Used to prevent mistakenly sent request from burning the OTP
Returns
SL_SUCCESS if the setting is applied correctly, SL_ERROR otherwise

Definition at line 1359 of file sl_wfx.c .

References sl_wfx_prevent_rollback_req_body_t::magic_word , SL_WFX_PREVENT_ROLLBACK_REQ_ID , sl_wfx_send_command() , and SL_WFX_STA_INTERFACE .

sl_wfx_pta_priority()

sl_status_t sl_wfx_pta_priority ( uint32_t priority )

Send a request to define the level of priority used to arbitrate concurrent Coex and Wlan requests.

Parameters
priority defines the priority levels for concurrent Coex and WLAN request arbitration
  • SL_WFX_PTA_PRIORITY_COEX_MAXIMIZED
  • SL_WFX_PTA_PRIORITY_COEX_HIGH
  • SL_WFX_PTA_PRIORITY_BALANCED
  • SL_WFX_PTA_PRIORITY_WLAN_HIGH
  • SL_WFX_PTA_PRIORITY_WLAN_MAXIMIZED
Returns
SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise

Definition at line 1320 of file sl_wfx.c .

References sl_wfx_pta_priority_req_body_t::priority , SL_WFX_PTA_PRIORITY_REQ_ID , sl_wfx_send_command() , and SL_WFX_STA_INTERFACE .

sl_wfx_pta_settings()

sl_status_t sl_wfx_pta_settings ( uint8_t pta_mode,
uint8_t request_signal_active_level,
uint8_t priority_signal_active_level,
uint8_t freq_signal_active_level,
uint8_t grant_signal_active_level,
uint8_t coex_type,
uint8_t default_grant_state,
uint8_t simultaneous_rx_access,
uint8_t priority_sampling_time,
uint8_t tx_rx_sampling_time,
uint8_t freq_sampling_time,
uint8_t grant_valid_time,
uint8_t fem_control_time,
uint8_t first_slot_time,
uint16_t periodic_tx_rx_sampling_time,
uint16_t coex_quota,
uint16_t wlan_quota
)

Send a request to set the PTA mode, the active levels on signals, the Coex type, to define the timings, quotas, combined mode and default grant state.

Parameters
pta_mode defines the mode to use
  • SL_WFX_PTA_1W_WLAN_MASTER
  • SL_WFX_PTA_1W_COEX_MASTER
  • SL_WFX_PTA_2W
  • SL_WFX_PTA_3W
  • SL_WFX_PTA_4W
request_signal_active_level is the active level on REQUEST signal (PTA_RF_ACT pin)
priority_signal_active_level is the active level on PRIORITY signal (PTA_STATUS pin)
freq_signal_active_level is the active level on FREQ signal (PTA_FREQ pin)
grant_signal_active_level is the active level on GRANT signal (PTA_TX_CONF pin)
  • SL_WFX_SIGNAL_LOW
  • SL_WFX_SIGNAL_HIGH
coex_type
  • SL_WFX_COEX_TYPE_GENERIC
  • SL_WFX_COEX_TYPE_BLE
default_grant_state is the state of the GRANT signal before arbitration at grant_valid_time
  • SL_WFX_NO_GRANT
  • SL_WFX_GRANT
simultaneous_rx_access is a boolean to allow both Coex and Wlan to receive concurrently, also named combined mode
priority_sampling_time is the time (in microseconds) from the Coex request to the sampling of the priority on PRIORITY signal (1 to 31)
tx_rx_sampling_time is the time (in microseconds) from the Coex request to the sampling of the directionality on PRIORITY signal (priority_sampling_time to 63)
freq_sampling_time is the time (in microseconds) from the Coex request to the sampling of freq-match information on FREQ signal (1 to 127)
grant_valid_time is the time (in microseconds) from Coex request to the GRANT signal assertion (MAX(tx_rx_sampling_time, freq_sampling_time) to 255)
fem_control_time is the time (in microseconds) from Coex request to the control of FEM (grant_valid_time to 255)
first_slot_time is the time (in microseconds) from the Coex request to the beginning of reception or transmission (grant_valid_time to 255)
periodic_tx_rx_sampling_time is the period (in microseconds) from first_slot_time of following samplings of the directionality on PRIORITY signal (1 to 1023)
coex_quota is the duration (in microseconds) for which RF is granted to Coex before it is moved to Wlan
wlan_quota is the duration (in microseconds) for which RF is granted to Wlan before it is moved to Coex
Returns
SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise

Definition at line 1264 of file sl_wfx.c .

References sl_wfx_pta_settings_req_body_t::coex_quota , sl_wfx_pta_settings_req_body_t::coex_type , sl_wfx_pta_settings_req_body_t::default_grant_state , sl_wfx_pta_settings_req_body_t::fem_control_time , sl_wfx_pta_settings_req_body_t::first_slot_time , sl_wfx_pta_settings_req_body_t::freq_sampling_time , sl_wfx_pta_settings_req_body_t::freq_signal_active_level , sl_wfx_pta_settings_req_body_t::grant_signal_active_level , sl_wfx_pta_settings_req_body_t::grant_valid_time , sl_wfx_pta_settings_req_body_t::periodic_tx_rx_sampling_time , sl_wfx_pta_settings_req_body_t::priority_sampling_time , sl_wfx_pta_settings_req_body_t::priority_signal_active_level , sl_wfx_pta_settings_req_body_t::pta_mode , sl_wfx_pta_settings_req_body_t::request_signal_active_level , sl_wfx_pta_settings_req_body_t::simultaneous_rx_access , SL_WFX_PTA_SETTINGS_REQ_ID , sl_wfx_send_command() , SL_WFX_STA_INTERFACE , sl_wfx_pta_settings_req_body_t::tx_rx_sampling_time , and sl_wfx_pta_settings_req_body_t::wlan_quota .

sl_wfx_pta_state()

sl_status_t sl_wfx_pta_state ( uint32_t pta_state )

Send a request to start or stop the PTA.

Parameters
pta_state defines the requested state of the PTA
  • SL_WFX_PTA_OFF
  • SL_WFX_PTA_ON
Returns
SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise

Definition at line 1341 of file sl_wfx.c .

References sl_wfx_pta_state_req_body_t::pta_state , SL_WFX_PTA_STATE_REQ_ID , sl_wfx_send_command() , and SL_WFX_STA_INTERFACE .

sl_wfx_secure_link_configure()

sl_status_t sl_wfx_secure_link_configure ( const uint8_t * encryption_bitmap,
uint8_t disable_session_key_protection
)

Modify SecureLink configuration.

Parameters
encryption_bitmap Encryption bitmap that must be written to wf200
disable_session_key_protection Force the firmware to authorize the use of the same session key during a complete power cycle, even very long.
Note
Disabling the session key protection downgrades the link security and is NOT RECOMMENDED.
The magic word SL_WFX_SESSION_KEY_PROTECTION_DISABLE_MAGIC is used to disable this protection.
Returns
Returns SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise
Note
The bitmap used as a parameter will be copied to the context bitmap if the setting completed successfully.

Definition at line 228 of file sl_wfx_secure_link.c .

References sl_wfx_securelink_configure_req_body_t::encr_bmp .

sl_wfx_secure_link_exchange_keys()

sl_status_t sl_wfx_secure_link_exchange_keys ( const uint8_t * sl_mac_key )

Exchange SecureLink public keys.

Parameters
sl_mac_key MAC key to be used
Returns
Returns SL_SUCCESS if the request has been sent correctly, SL_WIFI_SECURE_LINK_EXCHANGE_FAILED otherwise

Definition at line 141 of file sl_wfx_secure_link.c .

References sl_wfx_allocate_command_buffer() , and SL_WFX_SECURELINK_EXCHANGE_PUB_KEYS_REQ_ID .

sl_wfx_secure_link_renegotiate_session_key()

sl_status_t sl_wfx_secure_link_renegotiate_session_key ( void )

Renegotiate session key request.

Returns
SL_SUCCESS if the setting is applied correctly, SL_ERROR otherwise

Definition at line 180 of file sl_wfx_secure_link.c .

sl_wfx_secure_link_set_mac_key()

sl_status_t sl_wfx_secure_link_set_mac_key ( const uint8_t * sl_mac_key,
sl_wfx_securelink_mac_key_dest_t destination
)

SecureLink Set MAC Key.

Parameters
sl_mac_key MAC key to write on wf200
destination Memory section where it should be written
  • SL_MAC_KEY_DEST_OTP
  • SL_MAC_KEY_DEST_RAM
Returns
Returns SL_SUCCESS if the request has been sent correctly, SL_ERROR otherwise

Definition at line 113 of file sl_wfx_secure_link.c .

References sl_wfx_set_sl_mac_key_req_body_t::key_value , sl_wfx_set_sl_mac_key_req_body_t::otp_or_ram , and SECURE_LINK_MAC_KEY_DEST_RAM .

sl_wfx_send_configuration()

sl_status_t sl_wfx_send_configuration ( const char * pds_data,
uint32_t pds_data_length
)

Function to send PDS chunks.

Parameters
pds_data Data to be sent in the compressed PDS format
pds_data_length Size of the data to be sent
Returns
SL_SUCCESS if the configuration has been sent correctly, SL_ERROR otherwise
Note
The PDS (Platform Data Set) file contains the WF200 settings

Definition at line 1163 of file sl_wfx.c .

References sl_wfx_allocate_command_buffer() , and SL_WFX_CONFIGURATION_REQ_ID .

Referenced by sl_wfx_set_antenna_config() .

sl_wfx_shutdown()

sl_status_t sl_wfx_shutdown ( void )

Shutdown the Wi-Fi chip.

Returns
SL_SUCCESS if the Wi-Fi chip has been shutdown correctly, SL_ERROR otherwise
Note
Send the shutdown command, clear the WUP bit and the GPIO WUP to enable the Wi-Fi chips to go to sleep

Definition at line 1377 of file sl_wfx.c .

References sl_wfx_allocate_command_buffer() , and SL_WFX_SHUT_DOWN_REQ_ID .

Referenced by sl_wfx_deinit() .