SDIO Secondary#
Introduction#
Secure Digital Input/Output(SDIO). It is an extension of the SD (Secure Digital) card standard that adds support for input and output functions.
SDIO demonstrates the SDIO Secondary transmitting and receiving the data to and from the external SDIO Master.
The data is received continually depending on the clock. And the throughput will also be calculated by taking the difference between clock time and total bits received.
Configuration#
Most SDIO configurations take place at the Master side, where it enables read, write, and read-write operations.
For more information on configuring available parameters refer to the respective peripheral example readme document.
Usage#
The initialization and configuration of the SDIO Secondary will be completed, transitioning it to a waiting state. It will remain in this state until an interrupt is triggered from the Master. Subsequently, the send and receive APIs will configure all DMA descriptors and initiate the DMA to transmit and receive data. Continuous data reception will commence after two seconds.
Modules#
Enumerations#
Typedefs#
Functions#
Initializes the SDIO secondary.
Trigger sequence to send data from the SDIO secondary in non-blocking mode to the host/primary device.
Receive data on the SDIO secondary in non-blocking mode from the host/primary device using DMA.
Register the SDIO secondary user callback function.
Unregister the SDIO secondary user callback function.
Register the SDIO secondary DMA user callback function.
Unregister the SDIO secondary DMA user callback function.
Get the SDIO Secondary Driver version.
Initializes the SDIO Secondary at peripheral layer.
Enable the SDIO interrupts.
Disable the SDIO interrupts.
Set the interrupts i.e., unmask according to the flags passed in the parameter.
Clear the interrupts i.e., mask according to the flags passed in the parameter.
Get the pending function interrupt.
Get all the enabled interrupts in function1.
Get all the enabled interrupts in function1 and pending interrupts.
To get block count for the last received CMD53.
To get the length of each for the last received CMD53.
To set no of blocks to be transferred This API is used when transferring the data from secondary to primary in block mode.
Macros#
Events for HIF irq handler.
SDIO Write FIFO Data Register.
SDIO Read FIFO Data Register.
Enumeration Documentation#
sl_sdio_slave_rx_intr_status_t#
sl_sdio_slave_rx_intr_status_t
Enumerator | |
---|---|
HOST_INTR_NOT_RECEIVED | |
HOST_INTR_RECEIVED | |
HOST_INTR_NOT_RECEIVED | |
HOST_INTR_RECEIVED |
44
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
Typedef Documentation#
sl_sdio_secondary_callback_t#
typedef void(* sl_sdio_secondary_callback_t) (uint8_t events) )(uint8_t events)
56
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_sdio_secondary_gpdma_callback_t#
typedef void(* sl_sdio_secondary_gpdma_callback_t) (uint8_t dma_ch) )(uint8_t dma_ch)
57
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
Function Documentation#
sl_si91x_sdio_secondary_init#
sl_status_t sl_si91x_sdio_secondary_init (void )
Initializes the SDIO secondary.
[in] |
By default, the SDIO pin access with TA, this API gives the pin access to M4, selects the SDIO mode and enable the SDIO primary interrupts.
Returns
none
72
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_send#
void sl_si91x_sdio_secondary_send (uint8_t num_of_blocks, uint8_t * data_buf)
Trigger sequence to send data from the SDIO secondary in non-blocking mode to the host/primary device.
[in] | num_of_blocks | Number of blocks to be sent |
[in] | data_buf | Reference of the Source buffer |
This API accepts the num of blocks i.e., one block will have block length (1 to 1024) bytes and a pointer to the data buffer to be transferred.
Returns
none
86
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_receive#
void sl_si91x_sdio_secondary_receive (uint8_t * data_buf)
Receive data on the SDIO secondary in non-blocking mode from the host/primary device using DMA.
[in] | data_buf | Reference of the Destination buffer in which data will receive |
Returns
none
95
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_register_event_callback#
sl_status_t sl_si91x_sdio_secondary_register_event_callback (sl_sdio_secondary_callback_t callback_event, uint32_t flag)
Register the SDIO secondary user callback function.
[in] | callback_event | Pointer to the function which needs to be called at the time of interrupt |
[in] | flag | Interrupt flag to be registered |
Pre-condition:
Returns
status 0 if successful, else error code as follow
SL_STATUS_OK (0x0000) - Success
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_BUSY (0x0004) - Driver is busy
108
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_unregister_event_callback#
void sl_si91x_sdio_secondary_unregister_event_callback (uint32_t flag)
Unregister the SDIO secondary user callback function.
[in] | flag | Interrupt flag to be unregistered |
Returns
none
115
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_gpdma_register_event_callback#
sl_status_t sl_si91x_sdio_secondary_gpdma_register_event_callback (sl_sdio_secondary_gpdma_callback_t callback_event)
Register the SDIO secondary DMA user callback function.
[in] | callback_event | Pointer to the function which needs to be called at the time of interrupt |
Pre-conditions:
Returns
status 0 if successful, else error code as follow
SL_STATUS_OK (0x0000) - Success
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_BUSY (0x0004) - Driver is busy
127
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_gpdma_unregister_event_callback#
void sl_si91x_sdio_secondary_gpdma_unregister_event_callback (void )
Unregister the SDIO secondary DMA user callback function.
[in] |
Returns
none
134
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_get_version#
sl_sdio_secondary_version_t sl_si91x_sdio_secondary_get_version (void )
Get the SDIO Secondary Driver version.
[in] |
This function is used to know the SDIO Secondary Driver version.
Returns
sl_sdio_secondary_version_t type version
145
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
sl_si91x_sdio_secondary_peripheral_init#
void sl_si91x_sdio_secondary_peripheral_init (void )
Initializes the SDIO Secondary at peripheral layer.
[in] |
This API initializes the SDIO secondary, by default SDIO pin access with TA this API gives the pin access to M4, selects the SDIO mode and enable the sdio primary interrupts
Returns
none
99
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_enable_interrupts#
__STATIC_INLINE void sl_si91x_sdio_secondary_enable_interrupts (uint32_t flags)
Enable the SDIO interrupts.
[in] | flags | Interrupt Flag which need to be enabled Different interrupts flag which can be enabled are, SL_SDIO_WR_INT_EN |
Returns
none
117
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_disable_interrupts#
__STATIC_INLINE void sl_si91x_sdio_secondary_disable_interrupts (uint32_t flags)
Disable the SDIO interrupts.
[in] | flags | Interrupt Flag which need to be disabled Different interrupts flags which can be disabled are, SL_SDIO_WR_INT_EN |
Returns
none
139
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_set_interrupts#
__INLINE void sl_si91x_sdio_secondary_set_interrupts (uint32_t flags)
Set the interrupts i.e., unmask according to the flags passed in the parameter.
[in] | flags | Interrupt flags which needs to be set. Different interrupts flags which need to be set, SL_SDIO_WR_INT_UNMSK |
Returns
none
162
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_clear_interrupts#
__INLINE void sl_si91x_sdio_secondary_clear_interrupts (uint32_t flags)
Clear the interrupts i.e., mask according to the flags passed in the parameter.
[in] | flags | Interrupt flags which needs to be masked. SL_SDIO_WR_INT_MSK |
Returns
none
183
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_get_pending_interrupts#
__INLINE uint32_t sl_si91x_sdio_secondary_get_pending_interrupts (void )
Get the pending function interrupt.
[in] |
Returns
Return the pending interrupt status
196
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_get_enabled_interrupts#
__INLINE uint32_t sl_si91x_sdio_secondary_get_enabled_interrupts (void )
Get all the enabled interrupts in function1.
[in] |
Returns
No of interrupts enabled
208
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_get_enabled_pending_interrupts#
__INLINE uint32_t sl_si91x_sdio_secondary_get_enabled_pending_interrupts (void )
Get all the enabled interrupts in function1 and pending interrupts.
[in] |
Returns
No of interrupts enabled
220
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_get_block_cnt#
__INLINE uint32_t sl_si91x_sdio_secondary_get_block_cnt (void )
To get block count for the last received CMD53.
[in] |
Returns
No of block counts
232
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_get_block_len#
__INLINE uint32_t sl_si91x_sdio_secondary_get_block_len (void )
To get the length of each for the last received CMD53.
[in] |
Returns
Length of each block
245
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
sl_si91x_sdio_secondary_set_tx_blocks#
__INLINE void sl_si91x_sdio_secondary_set_tx_blocks (uint8_t no_of_blocks)
To set no of blocks to be transferred This API is used when transferring the data from secondary to primary in block mode.
[in] | no_of_blocks | no of blocks to be transfered |
Returns
none
260
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
Macro Definition Documentation#
NUMGPDMADESC#
#define NUMGPDMADESCValue:
10
36
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
HOST_INTR_RECEIVE_EVENT#
#define HOST_INTR_RECEIVE_EVENTValue:
BIT(0)
Events for HIF irq handler.
39
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_sdio_secondary.h
SDIO#
#define SDIOValue:
SDIO0
36
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SDIO_Handler#
#define SDIO_HandlerValue:
HIF1_IRQHandler
38
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
GPDMA_Handler#
#define GPDMA_HandlerValue:
IRQ031_Handler
39
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
RX_SOURCE_ADDR#
#define RX_SOURCE_ADDRValue:
0x20200080
SDIO Write FIFO Data Register.
42
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
TX_SOURCE_ADDR#
#define TX_SOURCE_ADDRValue:
0x20200040
SDIO Read FIFO Data Register.
45
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SDIO_MODE_SELECT#
#define SDIO_MODE_SELECTValue:
0x0705
47
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
MASK_HOST_INTERRUPT#
#define MASK_HOST_INTERRUPTValue:
0xF0
48
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
M4_MISC_CONFIG_BASE#
#define M4_MISC_CONFIG_BASEValue:
0x46008000
50
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SDIO_BASE#
#define SDIO_BASEValue:
0x20200000
51
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
RX_NUM_CHUNKS#
#define RX_NUM_CHUNKSValue:
(*(volatile uint32_t *)(SDIO_BASE + 0x242))
53
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
M4_HOST_INTR_MASK_REG#
#define M4_HOST_INTR_MASK_REGValue:
(*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x00))
54
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
M4_HOST_INTR_STATUS_REG#
#define M4_HOST_INTR_STATUS_REGValue:
(*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x04))
55
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
M4_HOST_INTR_CLEAR#
#define M4_HOST_INTR_CLEARValue:
(*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x08))
56
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
MISC_CFG_HOST_CTRL#
#define MISC_CFG_HOST_CTRLValue:
(*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x0C))
57
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_WR_INT_EN#
#define SL_SDIO_WR_INT_ENValue:
BIT(0)
60
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_RD_INT_EN#
#define SL_SDIO_RD_INT_ENValue:
BIT(1)
61
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CSA_INT_EN#
#define SL_SDIO_CSA_INT_ENValue:
BIT(2)
62
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CMD52_INT_EN#
#define SL_SDIO_CMD52_INT_ENValue:
BIT(3)
63
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_PWR_LEV_INT_EN#
#define SL_SDIO_PWR_LEV_INT_ENValue:
BIT(4)
64
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CRC_ERR_INT_EN#
#define SL_SDIO_CRC_ERR_INT_ENValue:
BIT(5)
65
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_ABORT_INT_EN#
#define SL_SDIO_ABORT_INT_ENValue:
BIT(6)
66
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_TOUT_INT_EN#
#define SL_SDIO_TOUT_INT_ENValue:
BIT(7)
67
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_WR_INT_MSK#
#define SL_SDIO_WR_INT_MSKValue:
BIT(0)
70
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_RD_INT_MSK#
#define SL_SDIO_RD_INT_MSKValue:
BIT(1)
71
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CSA_INT_MSK#
#define SL_SDIO_CSA_INT_MSKValue:
BIT(2)
72
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CMD52_INT_MSK#
#define SL_SDIO_CMD52_INT_MSKValue:
BIT(3)
73
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_PWR_LEV_INT_MSK#
#define SL_SDIO_PWR_LEV_INT_MSKValue:
BIT(4)
74
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CRC_ERR_INT_MSK#
#define SL_SDIO_CRC_ERR_INT_MSKValue:
BIT(5)
75
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_ABORT_INT_MSK#
#define SL_SDIO_ABORT_INT_MSKValue:
BIT(6)
76
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_TOUT_INT_MSK#
#define SL_SDIO_TOUT_INT_MSKValue:
BIT(7)
77
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_WR_INT_UNMSK#
#define SL_SDIO_WR_INT_UNMSKValue:
BIT(0)
80
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_RD_INT_UNMSK#
#define SL_SDIO_RD_INT_UNMSKValue:
BIT(1)
81
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CSA_INT_UNMSK#
#define SL_SDIO_CSA_INT_UNMSKValue:
BIT(2)
82
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CMD52_INT_UNMSK#
#define SL_SDIO_CMD52_INT_UNMSKValue:
BIT(3)
83
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_PWR_LEV_INT_UNMSK#
#define SL_SDIO_PWR_LEV_INT_UNMSKValue:
BIT(4)
84
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_CRC_ERR_INT_UNMSK#
#define SL_SDIO_CRC_ERR_INT_UNMSKValue:
BIT(5)
85
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_ABORT_INT_UNMSK#
#define SL_SDIO_ABORT_INT_UNMSKValue:
BIT(6)
86
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h
SL_SDIO_TOUT_INT_UNMSK#
#define SL_SDIO_TOUT_INT_UNMSKValue:
BIT(7)
87
of file components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc/sl_si91x_peripheral_sdio_secondary.h