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.
[in] | common_cb | - pointer to common cb structure |
Returns
0 - Success Non-Zero Value - Failure
45
of file driver/rsi_common.c
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.
[in] | cmd | - type of the command to send |
[in] | pkt | - pointer of packet to send |
Returns
0 - Success Non-Zero Value - Failure
113
of file driver/rsi_common.c
rsi_driver_process_common_recv_cmd#
int32_t rsi_driver_process_common_recv_cmd (rsi_pkt_t * pkt)
Process commands related to common block.
[in] | pkt | - pointer to common block packet |
Returns
0 - Success Non-Zero Value - Failure
427
of file driver/rsi_common.c
rsi_handle_slp_wkp#
void rsi_handle_slp_wkp (uint8_t frame_type)
Handle sleep and wakeup.
[in] | frame_type | - Frame type |
Returns
void
903
of file driver/rsi_common.c
rsi_req_wakeup#
int8_t rsi_req_wakeup (void )
Set wakeup GPIO high and wait for wakeup confirmation pin to get set.
[in] |
Returns
0 - Success Non-Zero Value - Failure
966
of file driver/rsi_common.c
rsi_wait4wakeup#
int8_t rsi_wait4wakeup (void )
Set wakeup GPIO high and waits for wakeup confirmation pin to get set.
[in] |
Returns
0 - Success Non-Zero Value - Failure
1022
of file driver/rsi_common.c
rsi_allow_sleep#
void rsi_allow_sleep (void )
Set wakeup GPIO low .
[in] |
Returns
void
1079
of file driver/rsi_common.c
rsi_powersave_gpio_init#
void rsi_powersave_gpio_init (void )
Initialize GPIOs used in power save .
[in] |
Returns
void
1101
of file driver/rsi_common.c
rsi_common_packet_transfer_done#
void rsi_common_packet_transfer_done (rsi_pkt_t * pkt)
Handle packet transfer completion which has an asyncronous response.
[in] | pkt | - pointer to packet |
Returns
void
1124
of file driver/rsi_common.c
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.
[in] | rsi_common_cb | - pointer to the common control block |
Returns
0 - Success Non-Zero Value - Failure
1140
of file driver/rsi_common.c
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
[in] | selected_ps_mode | - Select power save mode |
[in] | selected_ps_type | - Select power save type |
Returns
0 - Success Non-Zero Value - Failure
1239
of file driver/rsi_common.c
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.
[in] | semaphore | - Semaphore handle pointer |
[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
1363
of file driver/rsi_common.c
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.
[in] | cmd_type | - Command type 1 - COMMON_CMD 2 - WLAN_CMD 3 - NWK_CMD |
[in] | cmd_state | - command state 1 - IN_USE 2 - ALLOW |
Returns
0 - Success Non-Zero Value - Failure
1392
of file driver/rsi_common.c
rsi_post_waiting_common_semaphore#
void rsi_post_waiting_common_semaphore (void )
releases all the common semaphores which are on semaphore wait
[in] |
Returns
void
1476
of file driver/rsi_common.c
rsi_post_waiting_bt_semaphore#
void rsi_post_waiting_bt_semaphore (void )
Releases the all bt ,prop_protocol ,ble semaphores.
[in] |
Returns
void
1511
of file driver/rsi_common.c
rsi_release_waiting_semaphore#
int32_t rsi_release_waiting_semaphore (void )
Releases all common ,wlan and nwk semaphores which are on waiting.
[in] |
Returns
0 - Success
1570
of file driver/rsi_common.c
rsi_check_pkt_queue_and_dequeue#
void rsi_check_pkt_queue_and_dequeue (void )
Check the packet queues and dequeues the packet.
[in] |
Returns
void
1609
of file driver/rsi_common.c
rsi_free_queue_pkt#
void rsi_free_queue_pkt (uint8_t pkt_dequeued, rsi_pkt_t * pkt)
free the queued packet.
[in] | pkt_dequeued | - pkt to be free |
[in] | pkt | - pointer of the packet to be free |
Returns
void
1683
of file driver/rsi_common.c
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.
[in] | error | - Error |
[in] | cmd_type | - command type |
Returns
void
1721
of file driver/rsi_common.c
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.
[in] | reponse | - Buffer |
Returns
void
1757
of file driver/rsi_common.c
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.
[in] | ping_pong | - ping or pong buffer write |
[in] | src_addr | - Number of bytes to read. (def: 2 since we have 16 bit regs) |
[in] | size_param | - pointer contain the buffer of content to be written |
Returns
0 - Success Non-Zero Value - Failure
53
of file driver/rsi_device_init.c
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.
[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
161
of file driver/rsi_device_init.c
rsi_bl_select_option#
int16_t rsi_bl_select_option (uint8_t cmd)
Send firmware load request to module or update default configurations.
[in] | cmd | - type of configuration to be saved BURN_NWP_FW - 0x42 LOAD_NWP_FW - 0x31 LOAD_DEFAULT_NWP_FW_ACTIVE_LOW - 0x71 |
Returns
0 - Success Non-Zero Value - Failure -28 - Firmware Load or Upgrade timeout error -14 - Valid Firmware not present -15 - Invalid Option
212
of file driver/rsi_device_init.c
rsi_set_fast_fw_up#
int32_t rsi_set_fast_fw_up (void )
Fast setting of fw_up.
[in] |
Returns
0 - Success Non-Zero Value - Failure
424
of file driver/rsi_device_init.c
rsi_bootloader_instructions#
int16_t rsi_bootloader_instructions (uint8_t type, uint16_t * data)
Send boot instructions to module.
[in] | type | - type of the insruction to perform 0xD1 - RSI_REG_READ 0xD2 - RSI_REG_WRITE 0xD5 - RSI_PING_WRITE 0xD4 - RSI_PONG_WRITE 0x42 - BURN_NWP_FW 0x31 - LOAD_NWP_FW 0x71 - LOAD_DEFAULT_NWP_FW_ACTIVE_LOW |
[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.
523
of file driver/rsi_device_init.c
rsi_interrupt_handler#
void rsi_interrupt_handler (void )
Handle the interrupt coming from the module.
[in] |
Returns
void
34
of file driver/rsi_driver.c
rsi_mask_ta_interrupt#
void rsi_mask_ta_interrupt (void )
Mask the TA interrupt.
[in] |
Returns
void
57
of file driver/rsi_driver.c
rsi_unmask_ta_interrupt#
void rsi_unmask_ta_interrupt (void )
Unmask the TA interrupt.
[in] |
Returns
void
74
of file driver/rsi_driver.c
rsi_rx_event_handler#
void rsi_rx_event_handler (void )
Read the packet from module and process RX packet.
[in] |
Returns
void
587
of file driver/rsi_driver_event_handlers.c
rsi_set_event#
void rsi_set_event (uint32_t event_num)
Set an event.
[in] | event_num | - Event number to be set |
Returns
void
137
of file driver/rsi_events.c
rsi_clear_event#
void rsi_clear_event (uint32_t event_num)
Clear an event.
[in] | event_num | - Event number to clear |
Returns
void
155
of file driver/rsi_events.c
rsi_mask_event#
void rsi_mask_event (uint32_t event_num)
Mask an event specified using the event number.
[in] | event_num | - Event number to mask |
Returns
void
172
of file driver/rsi_events.c
rsi_find_event#
uint32_t rsi_find_event (uint32_t event_map)
Find the event which is set from the event map.
[in] | event_map | - Event map |
Returns
0 - Success Non-Zero Value - Failure
236
of file driver/rsi_events.c
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.
[in] | event_id | - event number which needs to be registered |
[in] | event_handler_ptr | - event handler which needs to be registered for a given event |
Returns
0 - Success 1 - Error
256
of file driver/rsi_events.c
rsi_set_event_from_isr#
void rsi_set_event_from_isr (uint32_t event_num)
Set the event from isr context.
[in] | event_num | - Event number to mask |
Returns
void
274
of file driver/rsi_events.c
rsi_events_init#
void rsi_events_init (void )
Initialize the events.
[in] |
Returns
void
293
of file driver/rsi_events.c
ROM_WL_rsi_set_event#
void ROM_WL_rsi_set_event (global_cb_t * global_cb_p, uint32_t event_num)
Set an event.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_num | - event number to be set |
Returns
void
41
of file driver/rsi_events_rom.c
ROM_WL_rsi_clear_event#
void ROM_WL_rsi_clear_event (global_cb_t * global_cb_p, uint32_t event_num)
Clear an event.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_num | - event number to clear |
Returns
void
81
of file driver/rsi_events_rom.c
ROM_WL_rsi_mask_event#
void ROM_WL_rsi_mask_event (global_cb_t * global_cb_p, uint32_t event_num)
Mask an event.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_num | - event number to mask |
Returns
void
107
of file driver/rsi_events_rom.c
ROM_WL_rsi_unmask_event#
void ROM_WL_rsi_unmask_event (global_cb_t * global_cb_p, uint32_t event_num)
Unmask an event.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_num | - event number to unmask |
Returns
void
132
of file driver/rsi_events_rom.c
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.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_map | - event map |
Returns
Event number
162
of file driver/rsi_events_rom.c
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.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_id | - event number which needs to be registered |
[in] | event_handler_ptr | - event handler which needs to be registered for a given event |
Returns
0 - Success 1 - Error
185
of file driver/rsi_events_rom.c
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.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_num | - event number to be set |
Returns
void
212
of file driver/rsi_events_rom.c
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.
[in] | global_cb_p | - pointer to the common buffer |
[in] | event_num | - event number to unmask |
Returns
void
237
of file driver/rsi_events_rom.c
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.
[in] | pool_cb | - packet pool pointer which needs to be initialized |
[in] | buffer | - buffer pointer to create pool |
[in] | total_size | - size of pool to create |
[in] | pkt_size | - size of each packet in pool |
Returns
0 - Success Negative Value - Failure
38
of file driver/rsi_pkt_mgmt.c
rsi_pkt_alloc#
rsi_pkt_t * rsi_pkt_alloc (rsi_pkt_pool_t * pool_cb)
Allocate packet from a given packet pool.
[in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
Returns
0 - Success Positive Value - Failure
57
of file driver/rsi_pkt_mgmt.c
rsi_pkt_free#
int32_t rsi_pkt_free (rsi_pkt_pool_t * pool_cb, rsi_pkt_t * pkt)
Free the packet.
[in] | pool_cb | - packet pool to which packet needs to be freed |
[in] | pkt | - packet pointer which needs to be freed |
Returns
0 - Success Non-Zero Value - Failure
77
of file driver/rsi_pkt_mgmt.c
rsi_is_pkt_available#
uint32_t rsi_is_pkt_available (rsi_pkt_pool_t * pool_cb)
Return number of available packets in pool.
[in] | pool_cb | - pool pointer to check available packet count |
Returns
>=0 - Number of packets in pool
95
of file driver/rsi_pkt_mgmt.c
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.
[in] | global_cb_p | - pointer to the global control block |
[in] | pool_cb | - packet pool pointer which needs to be initialized |
[in] | buffer | - buffer pointer to create pool |
[in] | total_size | - size of pool to create |
[in] | pkt_size | - size of each packet in pool |
Returns
0 - Success Negative value - Failure
41
of file driver/rsi_pkt_mgmt_rom.c
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.
[in] | global_cb_p | - pointer to the global control block |
[in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
Returns
Allocated packet pointer if Success NULL - If allocation fails
116
of file driver/rsi_pkt_mgmt_rom.c
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.
[in] | global_cb_p | - pointer to the global control block |
[in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
[in] | pkt | - packet pointer which needs to be freed |
Returns
0 - Success Negative Value - Failure
167
of file driver/rsi_pkt_mgmt_rom.c
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.
[in] | global_cb_p | - pointer to the global control block |
[in] | pool_cb | - packet pool pointer from which packet needs to be allocated |
Returns
Allocated packet pointer if Success NULL - If allocation fails
210
of file driver/rsi_pkt_mgmt_rom.c
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.
[in] | global_cb_p | - pointer to the global control block |
[in] | pool_cb | - packet pool to which packet needs to be freed |
[in] | pkt | - packet pointer which needs to be freed |
Returns
0 - Success Negative Value - Failure
260
of file driver/rsi_pkt_mgmt_rom.c
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.
[in] | global_cb_p | - pointer to the global control block |
[in] | pool_cb | - pool pointer to check available pakcets count |
Returns
Number of packet in pool
301
of file driver/rsi_pkt_mgmt_rom.c