Common APIs#

This section describes the Common APIs

Functions#

int32_t

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

void
rsi_common_set_status(int32_t status)

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

int32_t
rsi_wireless_init(uint16_t opermode, uint16_t coex_mode)

Initialize WiSeConnect or Module features. This is a blocking API. RSI_SUCCESS return value indicates that the opermode and coex value were set successfully in the FW. In case of failure, appropriate error code is returned to the application. Apart from setting WLAN/Coex Operating mode, this API also configures other features based on selected Feature Bitmaps. In this API, configured feature bitmaps are internally processed and sent to firmware. These feature bitmaps are also called Opermode Command Parameters. 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 these feature bitmaps, refer SP18.

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_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

Reset WiSeConnect module, load the firmware and restart the driver.This API should be called before rsi_wireless_init API, if user wants to change the previous configuration given through rsi_wireless_init. 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 and clock frequency for user 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_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

Handle driver events. Called in application main loop for non-OS platforms. /n With OS, this API is blocking and with baremetal this API is non-blocking.

int32_t

De-Initialize driver components. Clear all the memory given for driver operations in rsi_driver_init() API. In OS case, User need to take care of OS variables initialized in rsi_driver_init(). This is a non-blocking API. This API must be called by the thread/task/Master thread that it is not dependent on. OS variables allocated/initialized in rsi_driver_init() 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)
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 using Command 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 using command 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 using Command from host. This is a non-blocking API.

int32_t
rsi_gpio_read(uint8_t gpio_num)

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

int32_t
rsi_gpio_write(uint8_t gpio_num, uint8_t write)

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

int32_t
rsi_device_init(uint8_t select_option)

Power cycle the module and set the firmware image type to be loaded for WiSeConnect features. Initialize the module SPI. 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_PS pin for some duration and releasing it. Need to control the RESET_PS pin to reset the module. 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 WiSeConnect device 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.For the first chunk, set RSI_FW_START_OF_FILE in flags.For the last chunk set RSI_FW_END_OF_FILE in flags. This is blocking API.

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

Get ram dump through master reads. This is blocking API.

Function Documentation#

rsi_common_get_status#

int32_t rsi_common_get_status (void )

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

Parameters
[in]

Returns

  • 0 - Success Non-Zero Value - Failure


Definition at line 60 of file common/rsi_common_apis.c

rsi_common_set_status#

void rsi_common_set_status (int32_t status)

Set the common 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 74 of file common/rsi_common_apis.c

rsi_wireless_init#

int32_t rsi_wireless_init (uint16_t opermode, uint16_t coex_mode)

Initialize WiSeConnect or Module features. This is a blocking API. RSI_SUCCESS return value indicates that the opermode and coex value were set successfully in the FW. In case of failure, appropriate error code is returned to the application. Apart from setting WLAN/Coex Operating mode, this API also configures other features based on selected Feature Bitmaps. In this API, configured feature bitmaps are internally processed and sent to firmware. These feature bitmaps are also called Opermode Command Parameters. 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 these feature bitmaps, refer SP18.

Parameters
[in]opermode

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

N/Acoex_mode
  • rsi_driver_init() followed by rsi_device_init() API needs to be called before this API.

Note

  • Opermode WiFi-Direct(1) mode is not supported.

Note

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

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

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

  • 4. To achieve power save functionality, trigger 'rsi_wlan_radio_init()' API after rsi_wireless_init() API and also issue both WLAN and BT power save commands.

Returns

  • Success - RSI_SUCCESS Failure - Non-Zero Value

                `If return value is less than 0` \n
    
             **RSI_ERROR_INVALID_PARAM** - Invalid parameters \n 
    

RSI_ERROR_COMMAND_GIVEN_IN_WRONG_STATE - Command given in wrong state RSI_ERROR_PKT_ALLOCATION_FAILURE - Buffer not available to serve the command Other expected error codes are :0x0021,0x0025,0xFF73,0x002C,0xFF6E,0xFF6F, 0xFF70,0xFFC5Note

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


Definition at line 449 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 uart_hw_flowcontrol_enable parameter is 0, uart flow control is disabled. 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 Negative 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 650 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 Negative Value - Failure


Definition at line 718 of file common/rsi_common_apis.c

rsi_wireless_deinit#

int32_t rsi_wireless_deinit (void )

Reset WiSeConnect module, load the firmware and restart the driver.This API should be called before rsi_wireless_init API, if user wants to change the previous configuration given through rsi_wireless_init. This is a blocking API.

Parameters
[in]

Returns

  • 0 - Success Negative Value - Failure -2: Invalid parameters -3: Command given in wrong state -4: Buffer not available to serve the command

Note


Definition at line 810 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

Note

  • 1. Currently ignore the gain_2g, gain_5g, antenna_path, antenna_type values.

  • 2. Currently wireless_antenna selection is not supported.

Returns

  • 0 - Success Non-Zero Value - Failure If return value is less than 0 -4: Buffer not available to serve the command If return value is greater than 0 0x0025, 0x002C

Note

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


Definition at line 925 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 and clock frequency for user to pass Feature enables dynamically. This is a blocking API.

Parameters
[in]feature_enables

- Feature enables

Note

  • 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 If return value is less than 0 -2 : Invalid parameters -3 : Command given in wrong state -4 : Buffer not available to serve the command If return value is greater than 0 0x0021, 0xFF74

Note

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


Definition at line 1022 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 If return value is less than 0 -2 : Invalid parameters -3 : Command given in wrong state -4 : Buffer not available to serve the command If return value is greater than 0 0x0021, 0xFF74

Note

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


Definition at line 1113 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 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 1209 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). value 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 -2 - Parameters invalid

Note

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

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

    2. Enable few Feature bit map for getting debug logs on UART: // To set custom feature select bit map #define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENTION_VALID // To set Extended custom feature select bit map #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_UART_SEL_FOR_DEBUG_PRINTS


Definition at line 1307 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 Negative Value - Failure 0xFF - BT_ACTIVITY_PENDING

Note

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


Definition at line 1391 of file common/rsi_common_apis.c

rsi_wireless_driver_task#

void rsi_wireless_driver_task (void )

Handle driver events. Called in application main loop for non-OS platforms. /n With OS, this API is blocking and with baremetal this API is non-blocking.

Parameters
[in]

Returns

  • Void


Definition at line 1484 of file common/rsi_common_apis.c

rsi_driver_deinit#

int32_t rsi_driver_deinit (void )

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

Parameters
[in]
  • Need to call after the driver initialization

Returns

  • 0 - Success Non-Zero Value - Failure


Definition at line 1508 of file common/rsi_common_apis.c

References RSI_SUCCESS , SL_PRINTF , rsi_driver_cb_non_rom::device_state , rsi_driver_memory_estimate , 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_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

  • Need to call after the driver initialization

Returns

  • 0 - Success Non-Zero Value - Failure


Definition at line 1741 of file common/rsi_common_apis.c

rsi_driver_version#

int32_t rsi_driver_version (uint8_t * request)
Parameters
N/Arequest

Definition at line 1764 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

  • 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 1792 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 If return value is less than 0 -2: Invalid parameters -3: Command given in wrong state If return value is greater than 0 0x0021,0x003E

Note

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


Definition at line 1884 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 1955 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 1972 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 1988 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.

Note

  • 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 0x0021, 0x0025

Note

  • 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 2019 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 2095 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 2165 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 using Command 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[4] - 1 - Input mode 0 - Output mode BIT[0 - 1] : Drive strength 0 - 2mA 1 - 4mA 2 - 8mA 3 - 12mA BIT[6 - 7] : 0 - Hi-Z 1 - Pull-up 2 - Pull-down

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • It is not recommended to configure ULP_GPIO6 as it is used for WOWLAN feature.


Definition at line 2247 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 using command 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 - Drive high 0 - Drive Low

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • It is not recommended to configure ULP_GPIO6 as it is used for WOWLAN feature.


Definition at line 2322 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 using Command 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_GPIO6 as it is used for WOWLAN feature.


Definition at line 2394 of file common/rsi_common_apis.c

rsi_gpio_read#

int32_t rsi_gpio_read (uint8_t gpio_num)

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

Parameters
[in]gpio_num

- GPIO Number : Valid values 0 - 15

Returns

  • 0 - status of TA GPIO is LOW 1 - status of TA GPIO is HIGH < 0 Non-Zero Value - Failure


Definition at line 2462 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 TA GPIOs high or low using command from host. This is a non-blocking API.

Parameters
[in]gpio_num

- GPIO Number : Valid values 0 - 15

[in]write

- Value to be driven on GPIO 0x10 - Drive high 0 - Drive Low

Returns

  • 0 - Success Non-Zero Value - Failure


Definition at line 2497 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 for WiSeConnect features. Initialize the module SPI. 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.

  • rsi_driver_init() must be called before this API

Returns

  • Success - RSI_SUCCESS Failure - Non-Zero Value


Definition at line 55 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_PS pin for some duration and releasing it. Need to control the RESET_PS pin to reset the module. This is a non-blocking API.

Parameters
[in]

Returns

  • 0 - Success Non-Zero Value - Failure


Definition at line 264 of file common/rsi_device_init_apis.c

rsi_get_intr_status#

uint8_t rsi_get_intr_status ( <br>)

get the interrupt status.

Parameters
[in]<br>

Returns

  • 1 - when there is an interrupt 0 - when there is no interrupt


Definition at line 330 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 WiSeConnect device 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.For the first chunk, set RSI_FW_START_OF_FILE in flags.For the last chunk set RSI_FW_END_OF_FILE in flags. 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 2 - RSI_FW_END_OF_FILE Set flags to 1 - if it is the first chunk 2 - if it is last chunk 0 - for all other chunks

Note

  • 1. In rsi_bootloader_instructions() API, By default, RSI_HAL_MAX_WR_BUFF_LEN Macro (Max supported write buffer size) is 4096 bytes. Users 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 at rsi_user.h Example: uint8_t dummy[RSI_HAL_MAX_WR_BUFF_LEN];

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

  • 3. 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 295 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 through master reads. 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


Definition at line 579 of file driver/rsi_device_init.c

References SL_PRINTF , and rsi_mem_rd