Common APIs#

This section describes the Common APIs

Variables#

uint8_t *

Initialize WiSeConnect driver. This is a non-blocking API. Designate memory to all driver components from the buffer provided by the application. ...........Initilize Scheduler, Events, and Queues needed.

Functions#

int32_t

Return the common control block status. This is a non-blocking API.

void
rsi_common_set_status(int32_t status)

Set the common control block status. This is a non-blocking API.

int32_t
rsi_driver_init(uint8_t *buffer, uint32_t length)
int32_t
rsi_wireless_init(uint16_t opermode, uint16_t coex_mode)

Configure the WLAN/Coex operating mode and also configures features based on bitmaps available in rsi_wlan_config.h. In case of failure, appropriate error code is returned to the application. Default configurations (for reference) are available in rsi_wlan_common_config.h. Based on the features required for a specific example, modify the rsi_wlan_config.h provided in the respective example folder. For more information about the bitmaps, refer Opermode-Parameters This is a blocking API.

int32_t
rsi_cmd_uart_flow_ctrl(uint8_t uartflow_en)

Enable or disable UART flow control. This is a blocking API.

int32_t
rsi_cmd_to_wr_comm_flash(uint32_t wr_addr, uint8_t *write_data, uint16_t wr_data_len)

To write content on TA flash from M4. This is a blocking API.

int32_t
rsi_cmd_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. This is a blocking API.

int32_t

Resets the module to a state that was before execution of rsi_wireless_init To choose the new configuration(operating mode) rsi_wireless_init() API needs to be called after this API. This is a blocking API.

int32_t
rsi_wireless_antenna(uint8_t type, uint8_t gain_2g, uint8_t gain_5g)

Select antenna type on the device. This is a blocking API.

int32_t
rsi_send_feature_frame_dyn(uint32_t feature_enables)

Select internal or external RF type, clock frequency and to pass Feature enables dynamically. This is a blocking API.

int32_t

Select internal or external RF type and clock frequency.
This is a blocking API.

int32_t
rsi_get_fw_version(uint8_t *response, uint16_t length)

Get firmware version present in the device. This is a blocking API.

int32_t
rsi_get_module_type(uint8_t *response)

Get module type. This is a blocking API.

int32_t
rsi_common_debug_log(int32_t assertion_type, int32_t assertion_level)

Debug prints on UART interfaces 1 and 2. Host can get 5 types of debug prints based on the assertion level and assertion type. This is a blocking API.

int32_t
rsi_switch_proto(uint8_t type, void(*callback)(uint16_t mode, uint8_t *bt_disabled_status))

To enable or disable BT. This is a blocking API.

void

Handles driver events. Called in application main loop for non-OS platforms.
With OS, this is a blocking API and without OS this API is a non-blocking API.

int32_t

De-Initialize driver components by clearing all the memory given for driver operations through rsi_driver_init() API. With OS case, you need to take care of OS variables initialized in rsi_driver_init(). This API must be called by the thread/task/master thread that it is not dependent on the OS variables allocated/initialized in rsi_driver_init() API.
This is a non-blocking API.

int32_t
rsi_destroy_driver_task_and_driver_deinit(rsi_task_handle_t *task_handle)

In OS case, delete driver task before calling rsi_driver_deinit() API.

int32_t
rsi_driver_version(uint8_t *request)

Get current driver version. This is a non-blocking API.

int32_t
rsi_set_rtc_timer(module_rtc_time_t *timer)

Set the host rtc timer. This is a blocking API.

int32_t
rsi_get_ram_log(uint32_t addr, uint32_t length)

Get ram log on UART/UART2. This is a blocking API.

int32_t

Provide the memory required by the application. This is a non-blocking API.

void
rsi_uregister_events_callbacks(void(*callback_handler_ptr)(uint32_t event_num))

De-register event handler for the given event. This is a non-blocking API.

void
rsi_register_wait_timeout_error_callbacks(void(*callback_handler_ptr)(int32_t status, uint32_t cmd_type))

Register SAPI wait timeout handler. This is a non-blocking API.

int32_t
rsi_get_rtc_timer(module_rtc_time_t *response)

Fetch current time from hardware Real Time Clock. This is a blocking API.

int32_t
rsi_set_config(uint32_t code, uint8_t value)

Configure XO Ctune value from host.

int32_t

Trigger an assert. This is a blocking API.

int32_t
rsi_gpio_pininit(uint8_t gpio_type, uint8_t pin_num, uint8_t configuration)

Configure TA GPIOs from host. This is a non-blocking API.

int32_t
rsi_gpio_writepin(uint8_t gpio_type, uint8_t pin_num, uint8_t value)

Drive the module GPIOs high or low from host. This is a non-blocking API.

int32_t
rsi_gpio_readpin(uint8_t gpio_type, uint8_t pin_num, uint8_t *gpio_value)

Read status of TA GPIOs from host. This is a non-blocking API.

int32_t
rsi_gpio_read(uint8_t gpio_num)

Read status of NWP GPIOs from host. This is a non-blocking API.

int32_t
rsi_gpio_write(uint8_t gpio_num, uint8_t write)

Drive the NWP GPIOs from host. This is a non-blocking API.

int32_t

set/change the region on user based configuration

int32_t
rsi_device_init(uint8_t select_option)

Power cycle the module and set the firmware image type to be loaded. This is a blocking API.

int32_t

De-Initialize the module and reset the module.
Reset is driven to the module by asserting the reset pin for some duration and releasing it.
This is a non-blocking API.

uint8_t

Get the interrupt status.

int16_t
rsi_bl_upgrade_firmware(uint8_t *firmware_image, uint32_t fw_image_size, uint8_t flags)

Upgrade the firmware in the module from the host. The firmware file is given in chunks to this API.
Each chunk must be a multiple of 4096 bytes unless it is the last chunk.
This is blocking API.

int32_t
rsi_get_ram_dump(uint32_t addr, uint16_t length, uint8_t *buf)

Get RAM dump. This is blocking API.

Variable Documentation#

buffer_addr#

uint8_t* buffer_addr

Initialize WiSeConnect driver. This is a non-blocking API. Designate memory to all driver components from the buffer provided by the application. ...........Initilize Scheduler, Events, and Queues needed.

Returns

  • Success - Returns the memory used, which is less than or equal to buffer length provided.
    Failure - Non-Zero values

            **RSI_ERROR_TIMEOUT**         -    If UART initialization fails in SPI / UART mode   \n
    
            **RSI_ERROR_INVALID_PARAM**   -    If maximum sockets is greater than 10
    

Definition at line 101 of file common/rsi_common_apis.c

Function Documentation#

rsi_common_get_status#

int32_t rsi_common_get_status (void )

Return the common control block status. This is a non-blocking API.

Parameters
[in]

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note


Definition at line 66 of file common/rsi_common_apis.c

rsi_common_set_status#

void rsi_common_set_status (int32_t status)

Set the common control block status. This is a non-blocking API.

Parameters
[in]status

- Status of common control block

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 80 of file common/rsi_common_apis.c

rsi_driver_init#

int32_t rsi_driver_init (uint8_t * buffer, uint32_t length)
Parameters
N/Abuffer
N/Alength

Definition at line 102 of file common/rsi_common_apis.c

References RSI_SUCCESS , rsi_driver_memory_estimate , buffer_addr , SL_PRINTF , rsi_driver_cb_s::event_list , rsi_pkt_pool_init , rsi_driver_cb_s::rx_pool , rsi_driver_cb_s::common_cb , rsi_common_cb_init , rsi_common_cb_s::common_tx_pool , rsi_driver_cb_s::wlan_cb , rsi_common_cb_s::ipmu_calib_data_cb , rsi_wlan_cb_init , rsi_wlan_cb_s::wlan_tx_pool , rsi_scheduler_init , rsi_driver_cb_s::scheduler_cb , rsi_events_init , rsi_queues_init , rsi_driver_cb_s::wlan_tx_q , rsi_driver_cb_s::common_tx_q , rsi_driver_cb_s::m4_tx_q , rsi_driver_cb_s::m4_rx_q , rsi_driver_cb_s::zigb_cb , rsi_driver_cb_s::zigb_tx_q , rsi_driver_cb_s::bt_common_cb , rsi_bt_cb_init , rsi_bt_cb_s::bt_tx_pool , rsi_driver_cb_s::bt_single_tx_q , rsi_driver_cb_s::bt_classic_cb , rsi_driver_cb_s::ble_cb , rsi_driver_cb_s::prop_protocol_cb , rsi_driver_cb_s::prop_protocol_tx_q , rsi_driver_cb_s::bt_ble_stack_cb , rsi_driver_cb_s::bt_ble_stack_tx_q , rsi_driver_cb_s::bt_global_cb , rsi_bt_global_cb_init , rsi_timer_expiry_interrupt_handler , rsi_powersave_gpio_init , rsi_uart_init , and rsi_driver_cb_non_rom::device_state

rsi_wireless_init#

int32_t rsi_wireless_init (uint16_t opermode, uint16_t coex_mode)

Configure the WLAN/Coex operating mode and also configures features based on bitmaps available in rsi_wlan_config.h. In case of failure, appropriate error code is returned to the application. Default configurations (for reference) are available in rsi_wlan_common_config.h. Based on the features required for a specific example, modify the rsi_wlan_config.h provided in the respective example folder. For more information about the bitmaps, refer Opermode-Parameters This is a blocking API.

Parameters
[in]opermode

- WLAN Operating mode
0 - Client mode
2 - Enterprise security client mode
6 - Access point mode
8 - Transmit test mode
9 - Concurrent mode

[in]coex_mode

- Coexistence mode 0 - WLAN only mode
1 - WLAN
5 - WLAN + Bluetooth
9 - WLAN + Dual Mode (Bluetooth and BLE)
13- WLAN + BLE

Note

  • Precondition - rsi_device_init() API needs to be called before this API

  • WLAN operating mode 1 - WiFi-Direct mode is not supported.

  • Coex modes are supported only in 384K memory configuration.

  • Coex mode 4(Bluetooth classic), 8 (Dual mode), and 12(BLE mode) are not supported.

  • To achieve the same functionality, use coex mode 5, 9, and 13 respectively instead of coex mode 4, 8, and 12.

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0x0021,0x0025,0xFF73,0x002C,0xFF6E,0xFF6F, 0xFF70,0xFFC5)

Note

  • Refer to Error Codes for the description of above error codes.


Definition at line 440 of file common/rsi_common_apis.c

rsi_cmd_uart_flow_ctrl#

int32_t rsi_cmd_uart_flow_ctrl (uint8_t uartflow_en)

Enable or disable UART flow control. This is a blocking API.

Parameters
[in]uartflow_en

- Enable or Disable UART hardware flow control
1/2 - Enable and Pin set to be used to for RTS/CTS purpose.
0 - Disable
If the parameter is given as 1 or 2, then UART hardware flow control is enabled and Pin set to be used
If parameter is given as 1: Pin set used for RTS/CTS functionality is:
UART_CTS: GPIO - 11
UART_RTS: GPIO - 7
If parameter is given as 2: Pin set used for RTS/CTS functionality is:
UART_CTS: GPIO - 15
UART_RTS: GPIO - 12

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note

  • Hardware flow control feature is not supported in Auto-Join/Auto-Create mode.
    In such a case, the feature has to be enabled separately.


Definition at line 640 of file common/rsi_common_apis.c

rsi_cmd_to_wr_comm_flash#

int32_t rsi_cmd_to_wr_comm_flash (uint32_t wr_addr, uint8_t * write_data, uint16_t wr_data_len)

To write content on TA flash from M4. This is a blocking API.

Parameters
[in]wr_addr

- address at which data will be written on TA flash memory

[in]write_data

- Input data

[in]wr_data_len

- total length

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 706 of file common/rsi_common_apis.c

rsi_cmd_m4_ta_secure_handshake#

int32_t rsi_cmd_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. This is a blocking API.

Parameters
[in]sub_cmd_type

- Sub command

[in]input_len

- Input data

[in]input_data

- Length length

[in]output_len

- Output length

[in]output_data

- Output data

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 833 of file common/rsi_common_apis.c

rsi_wireless_deinit#

int32_t rsi_wireless_deinit (void )

Resets the module to a state that was before execution of rsi_wireless_init To choose the new configuration(operating mode) rsi_wireless_init() API needs to be called after this API. This is a blocking API.

Parameters
[in]

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffe, 0xfffffffd, 0xfffffffc)

Note


Definition at line 924 of file common/rsi_common_apis.c

rsi_wireless_antenna#

int32_t rsi_wireless_antenna (uint8_t type, uint8_t gain_2g, uint8_t gain_5g)

Select antenna type on the device. This is a blocking API.

Parameters
[in]type

- 0 : RF_OUT_2/Internal Antenna is selected
1 : RF_OUT_1/uFL connector is selected.

[in]gain_2g

- Currently not supported

[in]gain_5g

- Currently not supported

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffc, 0x0025, 0x002C)

Note


Definition at line 1043 of file common/rsi_common_apis.c

rsi_send_feature_frame_dyn#

int32_t rsi_send_feature_frame_dyn (uint32_t feature_enables)

Select internal or external RF type, clock frequency and to pass Feature enables dynamically. This is a blocking API.

Parameters
[in]feature_enables

- Feature enables
BIT[0] - Enable Preamble duty cycling.
BIT[4] - Enable LP chain for stand-by associate mode.
BIT[5] - Enable hardware beacon drop during power save.
Remaining bits are reserved.

Returns

  • 0 - Success

  • Negative Value - Failure (Possible Error Codes -0xfffffffe, 0xfffffffd, 0xfffffffc, 0x0021, 0xFF74)

Note


Definition at line 1135 of file common/rsi_common_apis.c

rsi_send_feature_frame#

int32_t rsi_send_feature_frame (void )

Select internal or external RF type and clock frequency.
This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffe, 0xfffffffd, 0xfffffffc, 0x0021, 0xFF74)
    If return value is less than 0

Note


Definition at line 1223 of file common/rsi_common_apis.c

rsi_get_fw_version#

int32_t rsi_get_fw_version (uint8_t * response, uint16_t length)

Get firmware version present in the device. This is a blocking API.

Parameters
[in]response

- Length of the response buffer in bytes to hold result.

[out]length

- Response of the requested command.

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffd, 0xfffffffc, 0xfffffffa, 0x0021, 0x0025, 0x002c)

Note

  • Refer to Error Codes for the description of above error codes.


Definition at line 1318 of file common/rsi_common_apis.c

rsi_get_module_type#

int32_t rsi_get_module_type (uint8_t * response)

Get module type. This is a blocking API.

Parameters
[out]response

- Response of the requested command.
0 - B8
1 - Q7 (QMS)
2 - Q7 + EXT FLASH
3 - DB_T
4 - SB
5 - M7DB (CC0)
6 - M4SB (B00)
7 - B6F
8 - B8SDB
9 - W2
10 - WMS

Returns

  • 0 - Success
    Non-Zero Value - Failure
    If return value is less than 0
    -3: Command given in wrong state
    -4: Buffer not available to serve the command
    -6: Insufficient input buffer given
    If return value is greater than 0
    0x0021, 0x0025, 0x002c

Note

  • Refer to Error Codes section for above error codes Error Codes .


Definition at line 1427 of file common/rsi_common_apis.c

rsi_common_debug_log#

int32_t rsi_common_debug_log (int32_t assertion_type, int32_t assertion_level)

Debug prints on UART interfaces 1 and 2. Host can get 5 types of debug prints based on the assertion level and assertion type. This is a blocking API.

Parameters
[in]assertion_type

- Assertion_type (Possible values 0 - 15)
0000 - LMAC core
0001 - SME
0010 - UMAC
0100 - NETX
1000 - Enables assertion indication and provides ram dump in critical assertion.

[in]assertion_level

- Assertion_level (Possible values 0 - 15)
1 is least value/only specific prints
15 is the highest level/Enable all prints.
0000 - Assertion required
0010 - Recoverable
0100 - Information

Returns

  • 0 - Success

  • Non-Zero value - Failure (Possible Error Codes - 0xfffffffe)

Note

  • Refer to Error Codes for the description of above error codes.

  • To minimize the debug prints host is supposed to give the same API with assertion type and assertion level as 0.

  • Baud rate for UART 2 on host application side should be 460800.

  • Enable few feature bit maps for getting debug logs on UART:
    (#define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENTION_VALID) and
    (#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_UART_SEL_FOR_DEBUG_PRINTS)


Definition at line 1541 of file common/rsi_common_apis.c

rsi_switch_proto#

int32_t rsi_switch_proto (uint8_t type, void(*)(uint16_t mode, uint8_t *bt_disabled_status) callback, mode, bt_disabled_status)

To enable or disable BT. This is a blocking API.

Parameters
[in]type

- Type

[in]callback

- Indicate BT enable or disable based on mode value

[out]mode

- Indicate BT enable or disable

[out]bt_disabled_status

- BT disabled status either success or failure to host

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xFF)

Note

  • Refer to Error Codes for the description of above error codes.


Definition at line 1624 of file common/rsi_common_apis.c

rsi_wireless_driver_task#

void rsi_wireless_driver_task (void )

Handles driver events. Called in application main loop for non-OS platforms.
With OS, this is a blocking API and without OS this API is a non-blocking API.

Parameters
[in]

Returns

  • None


Definition at line 1717 of file common/rsi_common_apis.c

rsi_driver_deinit#

int32_t rsi_driver_deinit (void )

De-Initialize driver components by clearing all the memory given for driver operations through rsi_driver_init() API. With OS case, you need to take care of OS variables initialized in rsi_driver_init(). This API must be called by the thread/task/master thread that it is not dependent on the OS variables allocated/initialized in rsi_driver_init() API.
This is a non-blocking API.

Parameters
[in]

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note


Definition at line 1742 of file common/rsi_common_apis.c

References RSI_SUCCESS , SL_PRINTF , rsi_driver_cb_non_rom::device_state , rsi_driver_memory_estimate , buffer_addr , rsi_check_pkt_queue_and_dequeue , rsi_vport_enter_critical , rsi_release_waiting_semaphore , rsi_semaphore_destroy , rsi_driver_cb_s::scheduler_cb , rsi_scheduler_cb_s::scheduler_sem , rsi_driver_cb_s::common_cb , rsi_common_cb_s::wakeup_gpio_sem , rsi_common_cb_s::common_card_ready_sem , rsi_common_cb_s::common_sem , rsi_mutex_destroy , rsi_common_cb_s::common_mutex , rsi_driver_cb_non_rom::tx_mutex , rsi_driver_cb_non_rom::debug_prints_mutex , rsi_driver_cb_s::zigb_tx_q , rsi_queue_cb_s::queue_mutex , rsi_driver_cb_s::prop_protocol_tx_q , rsi_driver_cb_s::bt_single_tx_q , rsi_driver_cb_s::bt_common_tx_q , rsi_driver_cb_s::wlan_tx_q , rsi_driver_cb_s::common_tx_q , rsi_driver_cb_non_rom::send_data_sem , rsi_driver_cb_s::rx_pool , rsi_pkt_pool_s::pkt_sem , rsi_common_cb_s::common_tx_pool , rsi_driver_cb_non_rom::common_cmd_send_sem , rsi_driver_cb_non_rom::common_cmd_sem , rsi_driver_cb_non_rom::nwk_cmd_send_sem , rsi_driver_cb_non_rom::nwk_sem , rsi_driver_cb_non_rom::wlan_cmd_send_sem , rsi_driver_cb_non_rom::wlan_cmd_sem , rsi_driver_cb_s::wlan_cb , rsi_wlan_cb_s::wlan_sem , rsi_wlan_cb_s::wlan_tx_pool , rsi_wlan_cb_s::wlan_mutex , rsi_driver_cb_s::bt_common_cb , rsi_bt_cb_s::bt_cmd_sem , rsi_bt_cb_s::bt_sem , rsi_bt_cb_s::bt_tx_pool , rsi_driver_cb_s::bt_ble_stack_cb , rsi_driver_cb_s::bt_classic_cb , rsi_driver_cb_s::ble_cb , rsi_driver_cb_s::prop_protocol_cb , rsi_driver_cb_s::zigb_cb , rsi_vport_exit_critical , rsi_common_cb_s::state , and rsi_wlan_cb_s::state

rsi_destroy_driver_task_and_driver_deinit#

int32_t rsi_destroy_driver_task_and_driver_deinit (rsi_task_handle_t * task_handle)

In OS case, delete driver task before calling rsi_driver_deinit() API.

Parameters
[in]task_handle

- Task handle/instance to be deleted

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note


Definition at line 1988 of file common/rsi_common_apis.c

rsi_driver_version#

int32_t rsi_driver_version (uint8_t * request)

Get current driver version. This is a non-blocking API.

Parameters
[in]request

- Pointer to fill driver version

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 2012 of file common/rsi_common_apis.c

References SL_PRINTF , memcpy , and RSI_SUCCESS

rsi_set_rtc_timer#

int32_t rsi_set_rtc_timer (module_rtc_time_t * timer)

Set the host rtc timer. This is a blocking API.

Parameters
[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]

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note

  • Precondition - rsi_wireless_init() API needs to be called before this API

  • Hour is 24-hour format only (valid values are 0 to 23). Valid values for Month are 0 to 11 (January to December).


Definition at line 2040 of file common/rsi_common_apis.c

rsi_get_ram_log#

int32_t rsi_get_ram_log (uint32_t addr, uint32_t length)

Get ram log on UART/UART2. This is a blocking API.

Parameters
[in]addr

- Address in RS9116 module

[in]length

- Chunk length to read from RS9116 module

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffe, 0xfffffffd, 0x0021, 0x003E)

Note


Definition at line 2128 of file common/rsi_common_apis.c

rsi_driver_memory_estimate#

int32_t rsi_driver_memory_estimate (void )

Provide the memory required by the application. This is a non-blocking API.

Parameters
[in]

Returns

  • Driver pool size


Definition at line 2199 of file common/rsi_common_apis.c

rsi_uregister_events_callbacks#

void rsi_uregister_events_callbacks (void(*)(uint32_t event_num) callback_handler_ptr)

De-register event handler for the given event. This is a non-blocking API.

Parameters
[out]callback_handler_ptr

- Event number

Returns

  • 0 - Success

  • Non-Zero Value- Failure


Definition at line 2216 of file common/rsi_common_apis.c

rsi_register_wait_timeout_error_callbacks#

void rsi_register_wait_timeout_error_callbacks (void(*)(int32_t status, uint32_t cmd_type) callback_handler_ptr, cmd_type)

Register SAPI wait timeout handler. This is a non-blocking API.

Parameters
[out]callback_handler_ptr

- Status

[out]cmd_type

- Command

Returns

  • 0 - Success

  • Non-Zero - Failure


Definition at line 2232 of file common/rsi_common_apis.c

rsi_get_rtc_timer#

int32_t rsi_get_rtc_timer (module_rtc_time_t * response)

Fetch current time from hardware Real Time Clock. This is a blocking API.

Parameters
[out]response

- Response of the requested command.
Response parameters:
second --> Current real time clock seconds.
minute --> Current real time clock minute.
hour --> Current real time clock hour.
day --> Current real time clock day.
month --> Current real time clock month.
year --> Current real time clock year.
weekday--> Current real time clock Weekday.

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0x0021, 0x0025)

Note

  • Precondition - rsi_set_rtc_timer() API needs to be called before this API.
    rsi_wlan_scan() API or rsi_wlan_radio_init() API needs to be called before this API.

  • Hour is 24-hour format only (valid values are 0 to 23). Valid values for Month are 0 to 11 (January to December).

  • Refer to Error Codes for the description of above error codes.


Definition at line 2265 of file common/rsi_common_apis.c

rsi_set_config#

int32_t rsi_set_config (uint32_t code, uint8_t value)

Configure XO Ctune value from host.

Parameters
[in]code

- XO_CTUNE_FROM_HOST

[in]value

- Value to be configured

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 2341 of file common/rsi_common_apis.c

rsi_assert#

int32_t rsi_assert (void )

Trigger an assert. This is a blocking API.

Parameters
[in]

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 2411 of file common/rsi_common_apis.c

rsi_gpio_pininit#

int32_t rsi_gpio_pininit (uint8_t gpio_type, uint8_t pin_num, uint8_t configuration)

Configure TA GPIOs from host. This is a non-blocking API.

Parameters
[in]gpio_type

- GPIO types :
0 - TA_GPIO
1 - ULP_GPIO
2 - UULP_GPIO

[in]pin_num

- GPIO Number :
Valid values 0 - 63, if gpio_type is TA_GPIO.
Valid values 0 - 15, if gpio_type is ULP_GPIO.
Valid values 0 and 2, if gpio_type is UULP_GPIO.

[in]configuration

- BIT[0 - 1] : Drive strength
0 - 2mA
1 - 4mA
2 - 8mA
3 - 12mA
BIT[2] : Reserved
BIT[3] : Reserved
BIT[4] : I/O mode
1 - Input mode
0 - Output mode
BIT[5] : Reserved
BIT[6 - 7] : Type
0 - Hi-Z
1 - Pull-up
2 - Pull-down

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note

  • It is not recommended to configure ULP_GPIO_6 as it is used for WoW feature

  • You need to define the CONFIGURE_GPIO_FROM_HOST to enable this API


Definition at line 2498 of file common/rsi_common_apis.c

rsi_gpio_writepin#

int32_t rsi_gpio_writepin (uint8_t gpio_type, uint8_t pin_num, uint8_t value)

Drive the module GPIOs high or low from host. This is a non-blocking API.

Parameters
[in]gpio_type

- GPIO types :
0 - TA_GPIO
1 - ULP_GPIO
2 - UULP_GPIO

[in]pin_num

- GPIO Number :
Valid values 0 - 63, if gpio_type is TA_GPIO.
Valid values 0 - 15, if gpio_type is ULP_GPIO.
Valid values 0 and 2, if gpio_type is UULP_GPIO.

[in]value

- Value to be driven on GPIO
1 - High
0 - Low

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note

  • It is not recommended to configure ULP_GPIO_6 as it is used for WoW feature

  • You need to define the CONFIGURE_GPIO_FROM_HOST to enable this API


Definition at line 2574 of file common/rsi_common_apis.c

rsi_gpio_readpin#

int32_t rsi_gpio_readpin (uint8_t gpio_type, uint8_t pin_num, uint8_t * gpio_value)

Read status of TA GPIOs from host. This is a non-blocking API.

Parameters
[in]gpio_type

- GPIO types :
0 - TA_GPIO
1 - ULP_GPIO
2 - UULP_GPIO

[in]pin_num

- GPIO Number :
Valid values 0 - 63, if gpio_type is TA_GPIO.
Valid values 0 - 15, if gpio_type is ULP_GPIO.
Valid values 0 and 2, if gpio_type is UULP_GPIO.

[in]gpio_value

- Address of variable to store the value

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note

  • It is not recommended to configure ULP_GPIO_6 as it is used for WoW feature.

  • You need to define the CONFIGURE_GPIO_FROM_HOST to enable this API.


Definition at line 2647 of file common/rsi_common_apis.c

rsi_gpio_read#

int32_t rsi_gpio_read (uint8_t gpio_num)

Read status of NWP GPIOs from host. This is a non-blocking API.

Parameters
[in]gpio_num

- GPIO Number :
Valid values 0 - 15 for ULP
Valid values 0 - 63 for SOC
Valid values 0 - 3 for UULP

Returns

  • 0 - Status of NWP GPIO is LOW

  • 1 - status of NWP GPIO is HIGH

  • Non-Zero Value (< 0) - Failure


Definition at line 2718 of file common/rsi_common_apis.c

References rsi_mem_rd , and rsi_mem_wr

rsi_gpio_write#

int32_t rsi_gpio_write (uint8_t gpio_num, uint8_t write)

Drive the NWP GPIOs from host. This is a non-blocking API.

Parameters
[in]gpio_num

- GPIO Number :
Valid values 0 - 15 for ULP
Valid values 0 - 63 for SOC
Valid values 0 - 3 for UULP

[in]write

- Value to be driven on GPIO
1 - High
0 - Low

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note

  • You need to define the CONFIGURE_GPIO_FROM_HOST to enable this API


Definition at line 2757 of file common/rsi_common_apis.c

rsi_set_region#

int32_t rsi_set_region (void )

set/change the region on user based configuration

Parameters
[in]

Returns

  • 0 - Success
    Non-Zero Value - Failure


Definition at line 2777 of file common/rsi_common_apis.c

rsi_device_init#

int32_t rsi_device_init (uint8_t select_option)

Power cycle the module and set the firmware image type to be loaded. This is a blocking API.

Parameters
[in]select_option

- LOAD_NWP_FW : To load Firmware image
LOAD_DEFAULT_NWP_FW_ACTIVE_LOW : To load active low Firmware image.
Active low firmware will generate active low interrupts to indicate that packets are pending on the
module, instead of the default active high.

Returns

  • Non-Zero Value - Failure

Note

  • Precondition - rsi_driver_init() must be called before this API.

  • Add the ENABLE_POC_IN_TOGGLE macro in the preprocessor to enable toggling of the POC_IN pin if it is controlled by the host to power cycle the module. For STM32 and EFM32 hosts, pins have been configured to drive the POC_IN pin. For EFR32, a pin has to be configured by the user to drive the POC_IN pin.

Returns

  • Success - RSI_SUCCESS

  • Failure - Non-Zero Value


Definition at line 58 of file common/rsi_device_init_apis.c

rsi_device_deinit#

int32_t rsi_device_deinit (void )

De-Initialize the module and reset the module.
Reset is driven to the module by asserting the reset pin for some duration and releasing it.
This is a non-blocking API.

Parameters
[in]

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 260 of file common/rsi_device_init_apis.c

rsi_get_intr_status#

uint8_t rsi_get_intr_status ( NA)

Get the interrupt status.

Parameters
[in]NA

Returns

  • 1 - when there is an interrupt

  • 0 - when there is no interrupt


Definition at line 353 of file common/rsi_device_init_apis.c

rsi_bl_upgrade_firmware#

int16_t rsi_bl_upgrade_firmware (uint8_t * firmware_image, uint32_t fw_image_size, uint8_t flags)

Upgrade the firmware in the module from the host. The firmware file is given in chunks to this API.
Each chunk must be a multiple of 4096 bytes unless it is the last chunk.
This is blocking API.

Parameters
[in]firmware_image

- This is a pointer to firmware image buffer

[in]fw_image_size

- This is the size of firmware image

[in]flags

- 1 - RSI_FW_START_OF_FILE, set for the first chunk
2 - RSI_FW_END_OF_FILE, set for the last chunk
0 - for all other chunks

Note

  • In rsi_bootloader_instructions() API, by default the RSI_HAL_MAX_WR_BUFF_LEN macro (Max supported write buffer size) is 4096 bytes. You can reduce this buffer size (minimum value of 1600 bytes is expected) as per HAL memory availability at the cost of the increase in execution time of this API.
    This macro can be configured in rsi_user.h file.
    Example: uint8_t dummy[RSI_HAL_MAX_WR_BUFF_LEN];

  • For safe firmware upgrade via the bootloader,
    it will take approx. 65 sec duration for upgrading the firmware of 1.5 MB file.

  • For fast firmware upgrade via the bootloader,
    it will take approx. 35 sec duration for upgrading the firmware of 1.5 MB file.

Returns

  • 0 - Success

  • Non-Zero Value - Failure


Definition at line 270 of file driver/rsi_device_init.c

rsi_get_ram_dump#

int32_t rsi_get_ram_dump (uint32_t addr, uint16_t length, uint8_t * buf)

Get RAM dump. This is blocking API.

Parameters
[in]addr

- Address of memory location in RS9116

[in]length

- Length of the content to read

[out]buf

- Buffer to keep the read content

Returns

  • 0 - Success

  • Non-Zero Value - Failure

Note


Definition at line 586 of file driver/rsi_device_init.c

References SL_PRINTF , and rsi_mem_rd