SDIO Secondary#

Modules#

sl_sdio_secondary_version_t

Enumerations#

enum
HOST_INTR_NOT_RECEIVED = 0
HOST_INTR_RECEIVED = 1
HOST_INTR_NOT_RECEIVED = 0
HOST_INTR_RECEIVED = 1
}

Typedefs#

typedef void(*
typedef void(*

Functions#

sl_status_t

Initializes the SDIO secondary.

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.

void

Receive data on the SDIO secondary in non-blocking mode from the host/primary device using DMA.

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.

void

Unregister the SDIO secondary user callback function.

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.

void

Unregister the SDIO secondary DMA user callback function.

Get the SDIO Secondary Driver version.

void

Initializes the SDIO Secondary at peripheral layer.

__STATIC_INLINE void

Enable the SDIO interrupts.

__STATIC_INLINE void

Disable the SDIO interrupts.

__INLINE void

Set the interrupts i.e., unmask according to the flags passed in the parameter.

__INLINE void

Clear the interrupts i.e., mask according to the flags passed in the parameter.

__INLINE uint32_t

Get the pending function interrupt.

__INLINE uint32_t

Get all the enabled interrupts in function1.

__INLINE uint32_t

Get all the enabled interrupts in function1 and pending interrupts.

__INLINE uint32_t

To get block count for the last received CMD53.

__INLINE uint32_t

To get the length of each for the last received CMD53.

__INLINE void

To set no of blocks to be transferred This API is used when transferring the data from secondary to primary in block mode.

Macros#

#define
NUMGPDMADESC 10
#define
HOST_INTR_RECEIVE_EVENT BIT(0)

Events for HIF irq handler.

#define
SDIO SDIO0
#define
SDIO_Handler HIF1_IRQHandler
#define
GPDMA_Handler IRQ031_Handler
#define
RX_SOURCE_ADDR 0x20200080

SDIO Write FIFO Data Register.

#define
TX_SOURCE_ADDR 0x20200040

SDIO Read FIFO Data Register.

#define
SDIO_MODE_SELECT 0x0705
#define
MASK_HOST_INTERRUPT 0xF0
#define
M4_MISC_CONFIG_BASE 0x46008000
#define
SDIO_BASE 0x20200000
#define
RX_NUM_CHUNKS (*(volatile uint32_t *)(SDIO_BASE + 0x242))
#define
M4_HOST_INTR_MASK_REG (*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x00))
#define
M4_HOST_INTR_STATUS_REG (*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x04))
#define
M4_HOST_INTR_CLEAR (*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x08))
#define
MISC_CFG_HOST_CTRL (*(volatile uint32_t *)(M4_MISC_CONFIG_BASE + 0x0C))
#define
SL_SDIO_WR_INT_EN BIT(0)
#define
SL_SDIO_RD_INT_EN BIT(1)
#define
SL_SDIO_CSA_INT_EN BIT(2)
#define
SL_SDIO_CMD52_INT_EN BIT(3)
#define
SL_SDIO_PWR_LEV_INT_EN BIT(4)
#define
SL_SDIO_CRC_ERR_INT_EN BIT(5)
#define
SL_SDIO_ABORT_INT_EN BIT(6)
#define
SL_SDIO_TOUT_INT_EN BIT(7)
#define
SL_SDIO_WR_INT_MSK BIT(0)
#define
SL_SDIO_RD_INT_MSK BIT(1)
#define
SL_SDIO_CSA_INT_MSK BIT(2)
#define
SL_SDIO_CMD52_INT_MSK BIT(3)
#define
SL_SDIO_PWR_LEV_INT_MSK BIT(4)
#define
SL_SDIO_CRC_ERR_INT_MSK BIT(5)
#define
SL_SDIO_ABORT_INT_MSK BIT(6)
#define
SL_SDIO_TOUT_INT_MSK BIT(7)
#define
SL_SDIO_WR_INT_UNMSK BIT(0)
#define
SL_SDIO_RD_INT_UNMSK BIT(1)
#define
SL_SDIO_CSA_INT_UNMSK BIT(2)
#define
SL_SDIO_CMD52_INT_UNMSK BIT(3)
#define
SL_SDIO_PWR_LEV_INT_UNMSK BIT(4)
#define
SL_SDIO_CRC_ERR_INT_UNMSK BIT(5)
#define
SL_SDIO_ABORT_INT_UNMSK BIT(6)
#define
SL_SDIO_TOUT_INT_UNMSK BIT(7)

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

Typedef Documentation#

sl_sdio_secondary_callback_t#

typedef void(* sl_sdio_secondary_callback_t) (uint8_t events) )(uint8_t events)

sl_sdio_secondary_gpdma_callback_t#

typedef void(* sl_sdio_secondary_gpdma_callback_t) (uint8_t dma_ch) )(uint8_t dma_ch)

Function Documentation#

sl_si91x_sdio_secondary_init#

sl_status_t sl_si91x_sdio_secondary_init (void )

Initializes the SDIO secondary.

Parameters
TypeDirectionArgument NameDescription
void[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


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.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]num_of_blocks

Number of blocks to be sent

uint8_t *[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 transffered.

Returns

  • none


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.

Parameters
TypeDirectionArgument NameDescription
uint8_t *[in]data_buf

Reference of the Destination buffer in which data will receive

Returns

  • none


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.

Parameters
TypeDirectionArgument NameDescription
sl_sdio_secondary_callback_t[in]callback_event

Pointer to the function which needs to be called at the time of interrupt

uint32_t[in]flag

Interrupt flag to be registered

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


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.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flag

Interrupt flag to be unregistered

Returns

  • none


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.

Parameters
TypeDirectionArgument NameDescription
sl_sdio_secondary_gpdma_callback_t[in]callback_event

Pointer to the function which needs to be called at the time of interrupt

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


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.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • none


sl_si91x_sdio_secondary_get_version#

sl_sdio_secondary_version_t sl_si91x_sdio_secondary_get_version (void )

Get the SDIO Secondary Driver version.

Parameters
TypeDirectionArgument NameDescription
void[in]

This function is used to know the SDIO Secondary Driver version.

Returns


sl_si91x_sdio_secondary_peripheral_init#

void sl_si91x_sdio_secondary_peripheral_init (void )

Initializes the SDIO Secondary at peripheral layer.

Parameters
TypeDirectionArgument NameDescription
void[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


sl_si91x_sdio_secondary_enable_interrupts#

__STATIC_INLINE void sl_si91x_sdio_secondary_enable_interrupts (uint32_t flags)

Enable the SDIO interrupts.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

Interrupt Flag which need to be enabled Different interrupts flag which can be enabled are, SL_SDIO_WR_INT_EN SL_SDIO_RD_INT_EN SL_SDIO_CSA_INT_EN SL_SDIO_CMD52_INT_EN SL_SDIO_PWR_LEV_INT_EN SL_SDIO_CRC_ERR_INT_EN SL_SDIO_ABORT_INT_EN SL_SDIO_TOUT_INT_EN

Returns

  • none


sl_si91x_sdio_secondary_disable_interrupts#

__STATIC_INLINE void sl_si91x_sdio_secondary_disable_interrupts (uint32_t flags)

Disable the SDIO interrupts.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

Interrupt Flag which need to be disabled Different interrupts flags which can be disabled are, SL_SDIO_WR_INT_EN SL_SDIO_RD_INT_EN SL_SDIO_CSA_INT_EN SL_SDIO_CMD52_INT_EN SL_SDIO_PWR_LEV_INT_EN SL_SDIO_CRC_ERR_INT_EN SL_SDIO_ABORT_INT_EN SL_SDIO_TOUT_INT_EN

Returns

  • none


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.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

Interrupt flags which needs to be set. Different interrupts flags which need to be set, SL_SDIO_WR_INT_UNMSK SL_SDIO_RD_INT_UNMSK SL_SDIO_CSA_INT_UNMSK SL_SDIO_CMD52_INT_UNMSK SL_SDIO_PWR_LEV_INT_UNMSK SL_SDIO_CRC_ERR_INT_UNMSK SL_SDIO_ABORT_INT_UNMSK SL_SDIO_TOUT_INT_UNMSK

Returns

  • none


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.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

Interrupt flags which needs to be masked. SL_SDIO_WR_INT_MSK SL_SDIO_RD_INT_MSK SL_SDIO_CSA_INT_MSK SL_SDIO_CMD52_INT_MSK SL_SDIO_PWR_LEV_INT_MSK SL_SDIO_CRC_ERR_INT_MSK SL_SDIO_ABORT_INT_MSK SL_SDIO_TOUT_INT_MSK

Returns

  • none


sl_si91x_sdio_secondary_get_pending_interrupts#

__INLINE uint32_t sl_si91x_sdio_secondary_get_pending_interrupts (void )

Get the pending function interrupt.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • Return the pending interrupt status


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.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • No of interrupts enabled


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.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • No of interrupts enabled


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.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • No of block counts


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.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • Length of each block


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.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]no_of_blocks

no of blocks to be transfered

Returns

  • none