Driver#
Functions#
Initialize common control block structure.
Fill commands and packets into WLAN TX queue.
Process commands received to common block.
Handle sleep and wakeup frames.
Set wakeup GPIO high.
Waits for wakeup confirmation pin to be set.
Set wakeup GPIO low.
Initialize GPIOs used in power save .
Handle packet transfer completion which has an asyncronous response.
Decides the power mode to program.
Send the power save mode and type to module
Wait for common semaphore.
Check and update the command state.
Release all the common semaphores which are on semaphore wait.
Release all the BT, BLE protocol semaphores.
Releases all common ,WLAN and network semaphores which are semaphore wait.
Check the packet in queue and dequeue the packet.
Free the queued packet.
Clears the event and gives timeout error.
Check the commands which are waiting for the response.
Write the given data in the ping or pong buffer to the specified register address in the module.
Set fast firmware upgrade.
Send boot instructions to the module.
Handle the interrupt coming from the module.
Mask the TA interrupt.
Unmask the TA interrupt.
Read and process the RX packet from the module.
Set an event.
Clear an event.
Mask the specified event.
Find the event which is set.
Register 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.
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.
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.
Number of available 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 packets 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 received to common block.
[in] | pkt | - pointer to common block packet |
Returns
0 - Success
Non-Zero Value - Failure
441
of file driver/rsi_common.c
rsi_handle_slp_wkp#
void rsi_handle_slp_wkp (uint8_t frame_type)
Handle sleep and wakeup frames.
[in] | frame_type | - Frame type |
Returns
Void
923
of file driver/rsi_common.c
rsi_req_wakeup#
int8_t rsi_req_wakeup (void )
Set wakeup GPIO high.
[in] |
Returns
0 - Success
Non-Zero Value - Failure
986
of file driver/rsi_common.c
rsi_wait4wakeup#
int8_t rsi_wait4wakeup (void )
Waits for wakeup confirmation pin to be set.
[in] |
Returns
0 - Success
Non-Zero Value - Failure
1042
of file driver/rsi_common.c
rsi_allow_sleep#
void rsi_allow_sleep (void )
Set wakeup GPIO low.
[in] |
Returns
Void
1099
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
1121
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
1144
of file driver/rsi_common.c
rsi_sleep_mode_decision#
int32_t rsi_sleep_mode_decision (rsi_common_cb_t * rsi_common_cb)
Decides the power mode to program.
[in] | rsi_common_cb | - pointer to the common control block |
Returns
0 - Success
Non-Zero Value - Failure
1160
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 mode and type 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
1259
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)
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
1383
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)
Check and update the command 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
1412
of file driver/rsi_common.c
rsi_post_waiting_common_semaphore#
void rsi_post_waiting_common_semaphore (void )
Release all the common semaphores which are on semaphore wait.
[in] |
Returns
Void
1496
of file driver/rsi_common.c
rsi_post_waiting_bt_semaphore#
void rsi_post_waiting_bt_semaphore (void )
Release all the BT, BLE protocol semaphores.
[in] |
Returns
Void
1531
of file driver/rsi_common.c
rsi_release_waiting_semaphore#
int32_t rsi_release_waiting_semaphore (void )
Releases all common ,WLAN and network semaphores which are semaphore wait.
[in] |
Returns
0 - Success
Non-Zero Value - Failure
1590
of file driver/rsi_common.c
rsi_check_pkt_queue_and_dequeue#
void rsi_check_pkt_queue_and_dequeue (void )
Check the packet in queue and dequeue the packet.
[in] |
Returns
Void
1629
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
1703
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)
Clears the event and gives timeout error.
[in] | error | - Error |
[in] | cmd_type | - command type |
Returns
Void
1741
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.
[in] | reponse | - pointer to the command waiting for response |
Returns
0 - Success
Non-Zero Value - Failure
1777
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 in the ping or pong buffer to the specified register address in the module.
[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
54
of file driver/rsi_device_init.c
rsi_set_fast_fw_up#
int32_t rsi_set_fast_fw_up (void )
Set fast firmware upgrade.
[in] |
Returns
0 - Success
Non-Zero Value - Failure
364
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 the 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 (Possible Error Codes - 0xffffffff, 0xfffffffe, 0xffffffe4)
Note
Refer to Error Codes for the description of above error codes.
This is a proprietry API and is not recommended to be used
461
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 and process the RX packet from the module.
[in] |
Returns
Void
611
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 the specified event.
[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.
[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 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
Non-Zero Value - Failure
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.
[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
Non-Zero Value - Failure
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
Non-Zero 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
Non-Zero 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)
Number of available packets in pool.
[in] | pool_cb | - pool pointer to check available packet count |
Returns
Number of packets in pool (>=0)
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 - Success
NULL - Failure
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
Non-Zero 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 - Success
NULL - Failure
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
Non-Zero 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)
Number of available 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 packets in pool
301
of file driver/rsi_pkt_mgmt_rom.c