SPI#
Functions#
Reads response for every command and data from the module.
Process a command to the wlan module.
Perform a pre-frame decriptor read.
Perform frame decriptor and payload read.
Write a Frame descriptor.
Perform Frame Data Write.
Send the C1 & C2 commands bytes, should check response for C1 command, if busy, should retry.
The C3 & C4 command bytes to send.
Loop reading the SPI until a start token, 0x55, is received.
Set the INTERRUPT MASK REGISTER of the module.
Set the INTERRUPT TYPE of the module based on selected LOAD_IMAGE.
Clear the interrupt register.
Return the module SPI interrupt register status.
Return the length of the incoming packet.
Configure the module SPI interface to high speed mode.
Initialize the wlan module�s Slave SPI interface.
Initialize the with modules Slave SPI interface on ulp wakeup.
Perform a memory write to the module.
Perform a memory read from the module.
Read from a register in the module from the address specified.
Read from a register in the wlan module from the address specified.
Write to a register in the module with an address specified.
Function Documentation#
rsi_frame_read#
int16_t rsi_frame_read (uint8_t * pkt_buffer)
Reads response for every command and data from the module.
[in] | pkt_buffer | - pointer to buffer to which packet has to read |
Returns
0 - SUCCESS < 0 - FAILURE -1 - SPI busy / Timeout in case of SPI -2 - SPI Failure in case of SPI
Note
Enable DEBUG_PACKET_EXCHANGE macro for spi level packet exchange debug prints and MAX_PRINT_PAYLOAD_LEN for configuring no.bytes of payload to print, by default it will print 8 bytes of payload.
67
of file driver/device_interface/spi/rsi_spi_frame_rd_wr.c
rsi_frame_write#
int16_t rsi_frame_write (rsi_frame_desc_t * uFrameDscFrame, uint8_t * payloadparam, uint16_t size_param)
Process a command to the wlan module.
[in] | uFrameDscFrame | - Frame descriptor |
[in] | payloadparam | - Pointer to the command payload parameter structure |
[in] | size_param | - Size of the payload for the command |
Returns
0 - SUCCESS < 0 - FAILURE -1 - SPI busy / Timeout in case of SPI -2 - SPI Failure in case of SPI
Note
Enable DEBUG_PACKET_EXCHANGE macro for spi level packet exchange debug prints and MAX_PRINT_PAYLOAD_LEN for configuring no.bytes of payload to print, by default it will print 8 bytes of payload..
118
of file driver/device_interface/spi/rsi_spi_frame_rd_wr.c
rsi_pre_dsc_rd#
int16_t rsi_pre_dsc_rd (uint8_t * dbuf)
Perform a pre-frame decriptor read.
[in] | dbuf | - Pointer to the buffer into which pre-decriptor has to be read |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
164
of file driver/device_interface/spi/rsi_spi_frame_rd_wr.c
rsi_pkt_rd#
int16_t rsi_pkt_rd (uint8_t * buf, uint16_t dummy_len, uint16_t total_len)
Perform frame decriptor and payload read.
[in] | buf | - Pointer to the buffer into which decriptor and payload has to be read |
[in] | dummy_len | - Number of dummy bytes which can be discarded |
[in] | total_len | - Number of bytes to be read |
Returns
0 - SUCCESS -1 - SPI busy / Timeout \nrsi_spi_frame_data_wr -2 - SPI Failure
225
of file driver/device_interface/spi/rsi_spi_frame_rd_wr.c
rsi_spi_frame_dsc_wr#
int16_t rsi_spi_frame_dsc_wr (rsi_frame_desc_t * uFrameDscFrame)
Write a Frame descriptor.
[in] | uFrameDscFrame | - Frame descriptor |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
300
of file driver/device_interface/spi/rsi_spi_frame_rd_wr.c
rsi_spi_frame_data_wr#
int16_t rsi_spi_frame_data_wr (uint16_t bufLen, uint8_t * dBuf, uint16_t tbufLen, uint8_t * tBuf)
Perform Frame Data Write.
[in] | bufLen | - Length of the data buffer to write |
[in] | dBuf | - Pointer to the buffer of data to write |
[in] | tbufLen | - Length of the data fragment to write |
[in] | tBuf | - Pointer to the buffer of data fragment to write |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
356
of file driver/device_interface/spi/rsi_spi_frame_rd_wr.c
rsi_send_c1c2#
int16_t rsi_send_c1c2 (uint8_t c1, uint8_t c2)
Send the C1 & C2 commands bytes, should check response for C1 command, if busy, should retry.
[in] | c1 | - SPI c1 command |
[in] | c2 | - SPI c2 command |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
54
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_send_c3c4#
int16_t rsi_send_c3c4 (uint8_t c3, uint8_t c4)
The C3 & C4 command bytes to send.
[in] | c3 | - SPI c3 command bytes to be sent |
[in] | c4 | - SPI c4 command bytes to be sent |
A succesful rsi_send_c1c2 is required before this function.
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
102
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_spi_wait_start_token#
int16_t rsi_spi_wait_start_token (uint32_t timeout, uint8_t mode)
Loop reading the SPI until a start token, 0x55, is received.
[in] | timeout | - Timeout for start token. |
[in] | mode | - To indicate 8-bit/32-bit mode. |
Should issue read commands before using this function
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
130
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_set_intr_mask#
int16_t rsi_set_intr_mask (uint8_t interruptMask)
Set the INTERRUPT MASK REGISTER of the module.
[in] | interruptMask | - The value to set the mask register to |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
179
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_set_intr_type#
int16_t rsi_set_intr_type (uint32_t interruptMaskVal)
Set the INTERRUPT TYPE of the module based on selected LOAD_IMAGE.
[in] | interruptMaskVal | - The value to set the mask register |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
215
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_clear_interrupt#
int16_t rsi_clear_interrupt (uint8_t interruptClear)
Clear the interrupt register.
[in] | interruptClear | - The value to set the interrupt clear register to |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
248
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_device_interrupt_status#
int16_t rsi_device_interrupt_status (uint8_t * int_status)
Return the module SPI interrupt register status.
[in] | int_status | - Pointer to the buffer of data to be read, assumed to be at least a byte |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
280
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_spi_pkt_len#
int16_t rsi_spi_pkt_len (uint16_t * length)
Return the length of the incoming packet.
[in] | length | - Pointer to the buffer of data to write, assumed to be at least 2 bytes long |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
314
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_spi_high_speed_enable#
int16_t rsi_spi_high_speed_enable (void )
Configure the module SPI interface to high speed mode.
[in] |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
349
of file driver/device_interface/spi/rsi_spi_functs.c
rsi_spi_iface_init#
int16_t rsi_spi_iface_init (void )
Initialize the wlan module�s Slave SPI interface.
[in] |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
54
of file driver/device_interface/spi/rsi_spi_iface_init.c
rsi_ulp_wakeup_init#
void rsi_ulp_wakeup_init (void )
Initialize the with modules Slave SPI interface on ulp wakeup.
[in] |
Returns
void
98
of file driver/device_interface/spi/rsi_spi_iface_init.c
rsi_mem_wr#
int16_t rsi_mem_wr (uint32_t addr, uint16_t len, uint8_t * dBuf)
Perform a memory write to the module.
[in] | addr | - Address to write to |
[in] | len | - Number of bytes to write |
[in] | dBuf | - Pointer to the buffer of data to write |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
56
of file driver/device_interface/spi/rsi_spi_mem_rd_wr.c
rsi_mem_rd#
int16_t rsi_mem_rd (uint32_t addr, uint16_t len, uint8_t * dBuf)
Perform a memory read from the module.
[in] | addr | - Address to read from |
[in] | len | - Number of bytes to read |
[in] | dBuf | - Pointer to the buffer to receive the data into |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
126
of file driver/device_interface/spi/rsi_spi_mem_rd_wr.c
rsi_reg_rd#
int16_t rsi_reg_rd (uint8_t regAddr, uint8_t * dBuf)
Read from a register in the module from the address specified.
[in] | regAddr | - Address of spi register to read, addr is 6-bits, upper 2 bits must be cleared |
[in] | dBuf | - Pointer to the buffer of data to write, assumed to be at least 2 bytes long |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
53
of file driver/device_interface/spi/rsi_spi_reg_rd_wr.c
rsi_reg_rd2#
int16_t rsi_reg_rd2 (uint8_t regAddr, uint16_t * dBuf)
Read from a register in the wlan module from the address specified.
[in] | regAddr | - Address of spi register to read, addr is 6-bits, upper 2 bits must be cleared |
[in] | dBuf | - Pointer to the buffer of data to write, assumed to be at least 2 bytes long |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
96
of file driver/device_interface/spi/rsi_spi_reg_rd_wr.c
rsi_reg_wr#
int16_t rsi_reg_wr (uint8_t regAddr, uint8_t * dBuf)
Write to a register in the module with an address specified.
[in] | regAddr | - Address of spi register to be written |
[in] | dBuf | - Pointer to the buffer of data to write, assumed to be at least 2 bytes long |
Returns
0 - SUCCESS -1 - SPI busy / Timeout -2 - SPI Failure
142
of file driver/device_interface/spi/rsi_spi_reg_rd_wr.c