Core#
Functions#
Initialize the driver.
De-initialize the driver.
Register a function and optional argument for scan results callback.
Send commands to the TA; whose response needs to be handled asynchronously.
Wait for a command response.
Send a socket command.
Send a Bluetooth command.
Load a certificate into a specified index.
Set the host rtc timer.
Fetch current time from hardware Real Time Clock.
Send a raw command frame.
Register a callback function for a specific event.
Default event handler for all events.
Secure handshake.
Informs when assertion happens in the firmware.
Si91X specific set join feature bitmap configuration.
Si91X specific get join feature bitmap configuration.
Function Documentation#
sl_si91x_driver_init#
sl_status_t sl_si91x_driver_init (const sl_wifi_device_configuration_t * config, sl_wifi_event_handler_t event_handler)
Initialize the driver.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_wifi_device_configuration_t * | [in] | config | Pointer to device configuration. |
sl_wifi_event_handler_t | [in] | event_handler | Function pointer to receive asynchronous events. |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
64
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_deinit#
sl_status_t sl_si91x_driver_deinit (void )
De-initialize the driver.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
74
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_send_command#
sl_status_t sl_si91x_driver_send_command (uint32_t command, sl_si91x_queue_type_t queue_type, const void * data, uint32_t data_length, sl_si91x_wait_period_t wait_period, void * sdk_context, sl_wifi_buffer_t ** data_buffer)
Register a function and optional argument for scan results callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | command | Command type to be sent to TA firmware. |
sl_si91x_queue_type_t | [in] | queue_type | Queue type to be used to send the command on. |
const void * | [in] | data | Command packet to be sent to the TA firmware. |
uint32_t | [in] | data_length | Length of command packet. |
sl_si91x_wait_period_t | [in] | wait_period | Timeout for the command response. |
void * | [in] | sdk_context | Pointer to the context. |
sl_wifi_buffer_t ** | [in] | data_buffer | Pointer to a data buffer pointer for the response data to be returned in. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
98
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_send_async_command#
sl_status_t sl_si91x_driver_send_async_command (uint32_t command, sl_si91x_queue_type_t queue_type, void * data, uint32_t data_length)
Send commands to the TA; whose response needs to be handled asynchronously.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | command | Command type to be sent to TA firmware. |
sl_si91x_queue_type_t | [in] | queue_type | Queue type to be used to send the command on. |
void * | [in] | data | Command packet to be sent to the TA firmware. |
uint32_t | [in] | data_length | Length of the command packet. sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details. |
Note: This function doesn't acquire "command_in_flight" boolean
120
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_wait_for_response#
sl_status_t sl_si91x_driver_wait_for_response (rsi_wlan_cmd_request_t command, sl_si91x_wait_period_t wait_period)
Wait for a command response.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_wlan_cmd_request_t | [in] | command | Command type to wait . |
sl_si91x_wait_period_t | [in] | wait_period | Wait time in milliseconds to wait for command response. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
136
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_send_socket_data#
sl_status_t sl_si91x_driver_send_socket_data (sl_si91x_socket_send_request_t * request, const void * data, uint32_t wait_time)
Send a socket command.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_si91x_socket_send_request_t * | [in] | request | Pointer to socket command packet. |
const void * | [in] | data | Pointer to socket data. |
uint32_t | [in] | wait_time | Timeout for the command response. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
152
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_send_bt_command#
sl_status_t sl_si91x_driver_send_bt_command (rsi_wlan_cmd_request_t command, sl_si91x_queue_type_t queue_type, sl_wifi_buffer_t * data, uint8_t sync_command)
Send a Bluetooth command.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_wlan_cmd_request_t | [in] | command | Command type to be sent. |
sl_si91x_queue_type_t | [in] | queue_type | Queue type to send command on. |
sl_wifi_buffer_t * | [in] | data | Pointer to Bluetooth data. |
uint8_t | [in] | sync_command | Sync or Async command. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
172
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_wifi_set_certificate_index#
sl_status_t sl_si91x_wifi_set_certificate_index (uint8_t certificate_type, uint8_t certificate_index, const uint8_t * buffer, uint32_t certificate_length)
Load a certificate into a specified index.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | certificate_type | Type of certificate being loaded |
uint8_t | [in] | certificate_index | Index where the certificate is to be loaded. |
const uint8_t * | [in] | buffer | Pointer to the buffer containing the certificate to be loaded. |
uint32_t | [in] | certificate_length | Length of the certificate buffer. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
193
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_set_rtc_timer#
sl_status_t sl_si91x_set_rtc_timer (sl_si91x_module_rtc_time_t * timer)
Set the host rtc timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_si91x_module_rtc_time_t * | [in] | timer | Pointer to fill RTC time. second --> seconds [0-59] minute --> minutes [0-59] hour --> hours since midnight [0-23] day --> day of the month [1-31] month --> months since January [0-11] year --> year since 1990. Weekday--> Weekday from Sunday to Saturday [1-7]. |
This is a blocking API. Note
Hour is 24-hour format only (valid values are 0 to 23). Valid values for Month are 0 to 11 (January to December).
sl_si91x_driver_init() API needs to be called before this API
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
217
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_get_rtc_timer#
sl_status_t sl_si91x_get_rtc_timer (sl_si91x_module_rtc_time_t * response)
Fetch current time from hardware Real Time Clock.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_si91x_module_rtc_time_t * | [out] | response | Response of the requested command. |
This is a blocking API. Note
Response parameters:
Pointer to fill RTC time. second --> seconds [0-59] minute --> minutes [0-59] hour --> hours since midnight [0-23] day --> day of the month [1-31] month --> months since January [0-11] year --> year since 1990. Weekday--> Weekday from Sunday to Saturday [1-7].
Hour is 24-hour format only (valid values are 0 to 23). Valid values for Month are 0 to 11 (January to December).
sl_si91x_set_rtc_timer() API needs to be called before this API. sl_si91x_driver_init() API needs to be called before this API also.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
241
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_driver_raw_send_command#
sl_status_t sl_si91x_driver_raw_send_command (uint8_t command, const void * data, uint32_t data_length, uint32_t wait_time)
Send a raw command frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | command | Command type to be sent. |
const void * | [in] | data | Pointer to the command data to be sent. |
uint32_t | [in] | data_length | Length of the data length |
uint32_t | [in] | wait_time | Wait time for the command response. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
259
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_register_callback#
sl_status_t sl_si91x_register_callback (sl_net_event_t event, sl_net_event_handler_t function)
Register a callback function for a specific event.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_net_event_t | [in] | event | Event to register a callback for. |
sl_net_event_handler_t | [in] | function | Function pointer to callback. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
276
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_default_handler#
sl_status_t sl_si91x_default_handler (sl_net_event_t event, sl_wifi_buffer_t * buffer)
Default event handler for all events.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_net_event_t | [in] | event | Asynchronous event received. |
sl_wifi_buffer_t * | [in] | buffer | Buffer containing data related to asynchronous event. |
sl_si91x_driver_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
290
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_m4_ta_secure_handshake#
sl_status_t sl_si91x_m4_ta_secure_handshake (uint8_t sub_cmd_type, uint8_t input_len, uint8_t * input_data, uint8_t output_len, uint8_t * output_data)
Secure handshake.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | sub_cmd_type | - Sub command. |
uint8_t | [in] | input_len | - Input data. |
uint8_t * | [in] | input_data | - Length length. |
uint8_t | [in] | output_len | - Output length. |
uint8_t * | [in] | output_data | - Output data. |
This is a blocking API. Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
464
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_assert#
sl_status_t sl_si91x_assert (void )
Informs when assertion happens in the firmware.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
474
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_set_join_configuration#
sl_status_t sl_si91x_set_join_configuration (sl_wifi_interface_t interface, uint8_t join_feature_bitmap)
Si91X specific set join feature bitmap configuration.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_wifi_interface_t | [in] | interface | Selected interface. |
uint8_t | [in] | join_feature_bitmap | Join feature bitmap configuration. One of values from si91x_join_feature_bit_map_defines |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
By default SI91X_JOIN_FEAT_LISTEN_INTERVAL_VALID bitmap is enabled. User can call this API before calling sl_wifi_connect(), sl_wifi_start_ap(), sl_wifi_start_wps() to overwrite the join feature bitmap
626
of file components/si91x/inc/sl_si91x_driver.h
sl_si91x_get_join_configuration#
sl_status_t sl_si91x_get_join_configuration (sl_wifi_interface_t interface, uint8_t * join_feature_bitmap)
Si91X specific get join feature bitmap configuration.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_wifi_interface_t | [in] | interface | Selected interface. |
uint8_t * | [out] | join_feature_bitmap | join feature bitmap configuration. One of values from si91x_join_feature_bit_map_defines |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
By default SI91X_JOIN_FEAT_LISTEN_INTERVAL_VALID bitmap is enabled.
640
of file components/si91x/inc/sl_si91x_driver.h