Driver#
Functions#
Initialize common control block structure.
Fill commands and places into wlan TX queue.
Process commands related to common block.
Handle sleep and wakeup.
Set wakeup GPIO high and wait for wakeup confirmation pin to get set.
Set wakeup GPIO high and waits for wakeup confirmation pin to get set.
Set wakeup GPIO low .
Initialize GPIOs used in power save .
Handle packet transfer completion which has an asyncronous response.
A handler which decides the power mode to program and change.
Send the power save command to module
Wireless library to acquire or wait for common semaphore.
This API is used by wireless library to check and update the command state to progress state.
releases all the common semaphores which are on semaphore wait
Releases the all bt ,prop_protocol ,ble semaphores.
Releases all common ,wlan and nwk semaphores which are on waiting.
Check the packet queues and dequeues the packet.
free the queued packet.
Clear the event and gives timeout error.
Check the commands which are waiting for the response and sets the flag.
Write the given data to the specified register address in the Module. This API writes the given data in ping or pong buffer.
This API checks for the readiness of the bootloader to receive the commands from the host.
Send firmware load request to module or update default configurations.
Fast setting of fw_up.
Send boot instructions to module.
Handle the interrupt coming from the module.
Mask the TA interrupt.
Unmask the TA interrupt.
Read the packet from module and process RX packet.
Set an event.
Clear an event.
Mask an event specified using the event number.
Find the event which is set from the event map.
Register the event handler for the given event.
Set the event from isr context.
Initialize the events.
Set an event.
Clear an event.
Mask an event.
Unmask an event.
Find the event which is set from the map.
Register the event.
Set an event from ISR.
Unmask an event from ISR.
Initialize/create packet pool from the provided buffer.
Allocate packet from a given packet pool.
Free the packet.
Return number of available packets in pool.
Initialize/create packet pool from the provided buffer.
Allocate packet from a given packet pool.
Free the packet.
Allocate packet from a given packet pool.
Free the packet.
Return number of avaiable packets in pool.
Function Documentation#
rsi_common_cb_init#
int8_t rsi_common_cb_init (rsi_common_cb_t * common_cb)
Initialize common control block structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_common_cb_t * | [in] | common_cb | - pointer to common cb structure |
Returns
0 - Success
Non-Zero Value - Failure
rsi_driver_common_send_cmd#
int32_t rsi_driver_common_send_cmd (rsi_common_cmd_request_t cmd, rsi_pkt_t * pkt)
Fill commands and places into wlan TX queue.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_common_cmd_request_t | [in] | cmd | - type of the command to send |
rsi_pkt_t * | [in] | pkt | - pointer of packet to send |
Returns
0 - Success
Non-Zero Value - Failure
rsi_driver_process_common_recv_cmd#
int32_t rsi_driver_process_common_recv_cmd (rsi_pkt_t * pkt)
Process commands related to common block.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_t * | [in] | pkt | - pointer to common block packet |
Returns
0 - Success
Non-Zero Value - Failure
rsi_handle_slp_wkp#
void rsi_handle_slp_wkp (uint8_t frame_type)
Handle sleep and wakeup.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | frame_type | - Frame type |
Returns
void
rsi_req_wakeup#
int8_t rsi_req_wakeup (void )
Set wakeup GPIO high and wait for wakeup confirmation pin to get set.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
0 - Success
Non-Zero Value - Failure
rsi_wait4wakeup#
int8_t rsi_wait4wakeup (void )
Set wakeup GPIO high and waits for wakeup confirmation pin to get set.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
0 - Success
Non-Zero Value - Failure
rsi_allow_sleep#
void rsi_allow_sleep (void )
Set wakeup GPIO low .
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_powersave_gpio_init#
void rsi_powersave_gpio_init (void )
Initialize GPIOs used in power save .
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_common_packet_transfer_done#
void rsi_common_packet_transfer_done (rsi_pkt_t * pkt)
Handle packet transfer completion which has an asyncronous response.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_t * | [in] | pkt | - pointer to packet |
Returns
void
rsi_sleep_mode_decision#
int32_t rsi_sleep_mode_decision (rsi_common_cb_t * rsi_common_cb)
A handler which decides the power mode to program and change.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_common_cb_t * | [in] | rsi_common_cb | - pointer to the common control block |
Returns
0 - Success
Non-Zero Value - Failure
rsi_send_ps_mode_to_module#
int32_t rsi_send_ps_mode_to_module (uint8_t selected_ps_mode, uint8_t selected_ps_type)
Send the power save command to module
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | selected_ps_mode | - Select power save mode |
uint8_t | [in] | selected_ps_type | - Select power save type |
Returns
0 - Success
Non-Zero Value - Failure
rsi_wait_on_common_semaphore#
rsi_error_t rsi_wait_on_common_semaphore (rsi_semaphore_handle_t * semaphore, uint32_t timeout_ms)
Wireless library to acquire or wait for common semaphore.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_semaphore_handle_t * | [in] | semaphore | - Semaphore handle pointer |
uint32_t | [in] | timeout_ms | - Maximum time to wait to acquire semaphore. If timeout_ms is 0 then wait till acquire semaphore. |
Returns
0 - Success
Non-Zero Value - Failure
rsi_check_and_update_cmd_state#
int32_t rsi_check_and_update_cmd_state (uint8_t cmd_type, uint8_t cmd_state)
This API is used by wireless library to check and update the command state to progress state.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | cmd_type | - Command type |
uint8_t | [in] | cmd_state | - command state |
Returns
0 - Success
Non-Zero Value - Failure
rsi_post_waiting_common_semaphore#
void rsi_post_waiting_common_semaphore (void )
releases all the common semaphores which are on semaphore wait
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_post_waiting_bt_semaphore#
void rsi_post_waiting_bt_semaphore (void )
Releases the all bt ,prop_protocol ,ble semaphores.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_release_waiting_semaphore#
int32_t rsi_release_waiting_semaphore (void )
Releases all common ,wlan and nwk semaphores which are on waiting.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
0 - Success
rsi_check_pkt_queue_and_dequeue#
void rsi_check_pkt_queue_and_dequeue (void )
Check the packet queues and dequeues the packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_free_queue_pkt#
void rsi_free_queue_pkt (uint8_t pkt_dequeued, rsi_pkt_t * pkt)
free the queued packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | pkt_dequeued | - pkt to be free |
rsi_pkt_t * | [in] | pkt | - pointer of the packet to be free |
Returns
void
rsi_error_timeout_and_clear_events#
void rsi_error_timeout_and_clear_events (int32_t error, uint32_t cmd_type)
Clear the event and gives timeout error.
Type | Direction | Argument Name | Description |
---|---|---|---|
int32_t | [in] | error | - Error |
uint32_t | [in] | cmd_type | - command type |
Returns
void
rsi_check_waiting_cmds#
void rsi_check_waiting_cmds (rsi_rsp_waiting_cmds_t * reponse)
Check the commands which are waiting for the response and sets the flag.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_rsp_waiting_cmds_t * | [in] | reponse | - Buffer |
Returns
void
rsi_secure_ping_pong_wr#
int16_t rsi_secure_ping_pong_wr (uint32_t ping_pong, uint8_t * src_addr, uint16_t size_param)
Write the given data to the specified register address in the Module. This API writes the given data in ping or pong buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | ping_pong | - ping or pong buffer write |
uint8_t * | [in] | src_addr | - Number of bytes to read. (def: 2 since we have 16 bit regs) |
uint16_t | [in] | size_param | - pointer contain the buffer of content to be written |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bl_waitfor_boardready#
int16_t rsi_bl_waitfor_boardready (void )
This API checks for the readiness of the bootloader to receive the commands from the host.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
0 - Success
Negative Value - Failure
-3 - Board ready not received
-4 - Bootup options last configuration not saved
-5 - Bootup options checksum failed
-6 - Bootloader version mismatch
rsi_bl_select_option#
int16_t rsi_bl_select_option (uint8_t cmd)
Send firmware load request to module or update default configurations.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | cmd | - type of configuration to be saved |
Returns
0 - Success
Non-Zero Value - Failure
-28 - Firmware Load or Upgrade timeout error
-14 - Valid Firmware not present
-15 - Invalid Option
rsi_set_fast_fw_up#
int32_t rsi_set_fast_fw_up (void )
Fast setting of fw_up.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bootloader_instructions#
int16_t rsi_bootloader_instructions (uint8_t type, uint16_t * data)
Send boot instructions to module.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | type | - type of the insruction to perform |
uint16_t * | [in] | data | - pointer to data which is to be read/write |
Returns
0 - Success
Non-Zero Value - Failure
-28 - Firmware Load or Upgrade timeout error
-2 - Invalid Parameter
-1 or -2 - SPI Failure
Note
This is a proprietry API and it is not recommended to be used by the user directly.
rsi_interrupt_handler#
void rsi_interrupt_handler (void )
Handle the interrupt coming from the module.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_mask_ta_interrupt#
void rsi_mask_ta_interrupt (void )
Mask the TA interrupt.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_unmask_ta_interrupt#
void rsi_unmask_ta_interrupt (void )
Unmask the TA interrupt.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_rx_event_handler#
void rsi_rx_event_handler (void )
Read the packet from module and process RX packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_set_event#
void rsi_set_event (uint32_t event_num)
Set an event.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | event_num | - Event number to be set |
Returns
void
rsi_clear_event#
void rsi_clear_event (uint32_t event_num)
Clear an event.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | event_num | - Event number to clear |
Returns
void
rsi_mask_event#
void rsi_mask_event (uint32_t event_num)
Mask an event specified using the event number.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | event_num | - Event number to mask |
Returns
void
rsi_find_event#
uint32_t rsi_find_event (uint32_t event_map)
Find the event which is set from the event map.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | event_map | - Event map |
Returns
0 - Success
Non-Zero Value - Failure
rsi_register_event#
uint16_t rsi_register_event (uint32_t event_id, void(*)(void) event_handler_ptr)
Register the event handler for the given event.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | event_id | - event number which needs to be registered |
void(*)(void) | [in] | event_handler_ptr | - event handler which needs to be registered for a given event |
Returns
0 - Success
1 - Error
rsi_set_event_from_isr#
void rsi_set_event_from_isr (uint32_t event_num)
Set the event from isr context.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | event_num | - Event number to mask |
Returns
void
rsi_events_init#
void rsi_events_init (void )
Initialize the events.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
ROM_WL_rsi_set_event#
void ROM_WL_rsi_set_event (global_cb_t * global_cb_p, uint32_t event_num)
Set an event.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_num | - event number to be set |
Returns
void
ROM_WL_rsi_clear_event#
void ROM_WL_rsi_clear_event (global_cb_t * global_cb_p, uint32_t event_num)
Clear an event.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_num | - event number to clear |
Returns
void
ROM_WL_rsi_mask_event#
void ROM_WL_rsi_mask_event (global_cb_t * global_cb_p, uint32_t event_num)
Mask an event.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_num | - event number to mask |
Returns
void
ROM_WL_rsi_unmask_event#
void ROM_WL_rsi_unmask_event (global_cb_t * global_cb_p, uint32_t event_num)
Unmask an event.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_num | - event number to unmask |
Returns
void
ROM_WL_rsi_find_event#
uint32_t ROM_WL_rsi_find_event (global_cb_t * global_cb_p, uint32_t event_map)
Find the event which is set from the map.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_map | - event map |
Returns
Event number
ROM_WL_rsi_register_event#
uint16_t ROM_WL_rsi_register_event (global_cb_t * global_cb_p, uint32_t event_id, void(*)(void) event_handler_ptr)
Register the event.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_id | - event number which needs to be registered |
void(*)(void) | [in] | event_handler_ptr | - event handler which needs to be registered for a given event |
Returns
0 - Success
1 - Error
ROM_WL_rsi_set_event_from_isr#
void ROM_WL_rsi_set_event_from_isr (global_cb_t * global_cb_p, uint32_t event_num)
Set an event from ISR.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_num | - event number to be set |
Returns
void
ROM_WL_rsi_unmask_event_from_isr#
void ROM_WL_rsi_unmask_event_from_isr (global_cb_t * global_cb_p, uint32_t event_num)
Unmask an event from ISR.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the common buffer |
uint32_t | [in] | event_num | - event number to unmask |
Returns
void
rsi_pkt_pool_init#
int32_t rsi_pkt_pool_init (rsi_pkt_pool_t * pool_cb, uint8_t * buffer, uint32_t total_size, uint32_t pkt_size)
Initialize/create packet pool from the provided buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool pointer which needs to be initialized |
uint8_t * | [in] | buffer | - buffer pointer to create pool |
uint32_t | [in] | total_size | - size of pool to create |
uint32_t | [in] | pkt_size | - size of each packet in pool |
Returns
0 - Success
Negative Value - Failure
rsi_pkt_alloc#
rsi_pkt_t * rsi_pkt_alloc (rsi_pkt_pool_t * pool_cb)
Allocate packet from a given packet pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
Returns
0 - Success
Positive Value - Failure
rsi_pkt_free#
int32_t rsi_pkt_free (rsi_pkt_pool_t * pool_cb, rsi_pkt_t * pkt)
Free the packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool to which packet needs to be freed |
rsi_pkt_t * | [in] | pkt | - packet pointer which needs to be freed |
Returns
0 - Success
Non-Zero Value - Failure
rsi_is_pkt_available#
uint32_t rsi_is_pkt_available (rsi_pkt_pool_t * pool_cb)
Return number of available packets in pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_pool_t * | [in] | pool_cb | - pool pointer to check available packet count |
Returns
>=0 - Number of packets in pool
ROM_WL_rsi_pkt_pool_init#
int32_t ROM_WL_rsi_pkt_pool_init (global_cb_t * global_cb_p, rsi_pkt_pool_t * pool_cb, uint8_t * buffer, uint32_t total_size, uint32_t pkt_size)
Initialize/create packet pool from the provided buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the global control block |
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool pointer which needs to be initialized |
uint8_t * | [in] | buffer | - buffer pointer to create pool |
uint32_t | [in] | total_size | - size of pool to create |
uint32_t | [in] | pkt_size | - size of each packet in pool |
Returns
0 - Success
Negative value - Failure
ROM_WL_rsi_pkt_alloc_non_blocking#
rsi_pkt_t * ROM_WL_rsi_pkt_alloc_non_blocking (global_cb_t * global_cb_p, rsi_pkt_pool_t * pool_cb)
Allocate packet from a given packet pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the global control block |
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
Returns
Allocated packet pointer if Success
NULL - If allocation fails
ROM_WL_rsi_pkt_free_non_blocking#
int32_t ROM_WL_rsi_pkt_free_non_blocking (global_cb_t * global_cb_p, rsi_pkt_pool_t * pool_cb, rsi_pkt_t * pkt)
Free the packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the global control block |
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
rsi_pkt_t * | [in] | pkt | - packet pointer which needs to be freed |
Returns
0 - Success
Negative Value - Failure
ROM_WL_rsi_pkt_alloc#
rsi_pkt_t * ROM_WL_rsi_pkt_alloc (global_cb_t * global_cb_p, rsi_pkt_pool_t * pool_cb)
Allocate packet from a given packet pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the global control block |
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
Returns
Allocated packet pointer if Success
NULL - If allocation fails
ROM_WL_rsi_pkt_free#
int32_t ROM_WL_rsi_pkt_free (global_cb_t * global_cb_p, rsi_pkt_pool_t * pool_cb, rsi_pkt_t * pkt)
Free the packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the global control block |
rsi_pkt_pool_t * | [in] | pool_cb | - packet pool to which packet needs to be freed |
rsi_pkt_t * | [in] | pkt | - packet pointer which needs to be freed |
Returns
0 - Success
Negative Value - Failure
ROM_WL_rsi_is_pkt_available#
uint32_t ROM_WL_rsi_is_pkt_available (global_cb_t * global_cb_p, rsi_pkt_pool_t * pool_cb)
Return number of avaiable packets in pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
global_cb_t * | [in] | global_cb_p | - pointer to the global control block |
rsi_pkt_pool_t * | [in] | pool_cb | - pool pointer to check available pakcets count |
Returns
Number of packet in pool