![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the SDIO Host Controller Driver (SDIOC) module of MCUXpresso SDK devices.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/sdmmc_examples/
Data Structures | |
struct | sdioc_config_t |
SDIOC Configuration Structure definition. More... | |
struct | sdioc_command_t |
SDIOC command configuration structure definition. More... | |
struct | sdioc_data_t |
SDIOC data configuration structure definition. More... | |
struct | sdioc_dma_config_t |
SDIOC dma configuration structure definition. More... | |
struct | sdioc_handle_t |
SDIOC handle. More... | |
SDIOC Initialization and deinitialization | |
void | SDIOC_Init (SDIOC_Type *base, const sdioc_config_t *config) |
SDIOC module initialization function. More... | |
void | SDIOC_Deinit (SDIOC_Type *base) |
Deinitializes the SDIOC. More... | |
SDIOC bus functional interface | |
static void | SDIOC_SetBusVoltage (SDIOC_Type *base, sdioc_bus_voltage_t busVoltage) |
SDIOC set bus voltage. More... | |
static void | SDIOC_SetDataBusWidth (SDIOC_Type *base, sdioc_bus_width_t busWidth) |
SDIOC set data bus width. More... | |
static void | SDIOC_SetBusSpeed (SDIOC_Type *base, sdioc_bus_speed_t busSpeed) |
SDIOC set bus speed. More... | |
static void | SDIOC_EnableBusPower (SDIOC_Type *base, bool enable) |
SDIOC enable/disable bus power. More... | |
static void | SDIOC_EnableInternalClock (SDIOC_Type *base, bool enable) |
SDIOC enable/disable internal clock. More... | |
static void | SDIOC_EnableCardClock (SDIOC_Type *base, bool enable) |
SDIOC enable/disable card clock. More... | |
static void | SDIOC_ResetAll (SDIOC_Type *base) |
SDIOC software reset entire host controller except for the card detection circuit register. More... | |
static void | SDIOC_ResetCommandLine (SDIOC_Type *base) |
SDIOC software reset command line. More... | |
static void | SDIOC_ResetDataLine (SDIOC_Type *base) |
SDIOC software reset data line. More... | |
static void | SDIOC_SetDataTimeout (SDIOC_Type *base, sdioc_data_timeout_value_t timeout) |
SDIOC set data timeout value. More... | |
SDIOC block gap functional interface | |
static void | SDIOC_EnableStopAtBlockGap (SDIOC_Type *base, bool enable) |
SDIOC enable stop at block gap request. More... | |
static void | SDIOC_EnableContinueRequest (SDIOC_Type *base, bool enable) |
SDIOC enable continue request. More... | |
static void | SDIOC_EnableReadWaitControl (SDIOC_Type *base, bool enable) |
SDIOC enable/disable read wait control. More... | |
static void | SDIOC_EnableStopAtBlockGapInterrupt (SDIOC_Type *base, bool enable) |
SDIOC enable/disable stop at block gap interrupt. More... | |
static uint32_t | SDIOC_ReadCommandResponse (SDIOC_Type *base, sdioc_response_index_t responseIndex) |
SDIOC read command response. More... | |
static uint32_t | SDIOC_ReadData (SDIOC_Type *base) |
SDIOC read data port. More... | |
static void | SDIOC_WriteData (SDIOC_Type *base, uint32_t data) |
SDIOC write data port. More... | |
SDIOC dma functional interface | |
static void | SDIOC_SetDmaBufferBoundary (SDIOC_Type *base, sdioc_dma_buffer_boundary_t bufferBoundary) |
SDIOC set dma buffer boundary. More... | |
static void | SDIOC_SetDmaBufferAddress (SDIOC_Type *base, void *bufferAddress) |
SDIOC set dma buffer address. More... | |
SDIOC interrupt and status interface | |
static void | SDIOC_EnableInterruptStatus (SDIOC_Type *base, uint32_t interruptFlags, bool enable) |
SDIOC enable/disable interrupt status. More... | |
static void | SDIOC_EnableInterruptSignal (SDIOC_Type *base, uint32_t interruptFlags, bool enable) |
SDIOC enable/disable interrupt signal. More... | |
static uint32_t | SDIOC_GetInterruptStatus (SDIOC_Type *base) |
SDIOC get interrupt status. More... | |
static uint32_t | SDIOC_GetEnabledInterruptStatus (SDIOC_Type *base) |
Gets the enabled interrupt status. More... | |
static void | SDIOC_ClearInterruptStatus (SDIOC_Type *base, uint32_t interruptFlags) |
SDIOC clear interrupt status. More... | |
static uint32_t | SDIOC_GetPresentStatus (SDIOC_Type *base) |
SDIOC get host controller present status. More... | |
status_t | SDIOC_SetTransferConfig (SDIOC_Type *base, sdioc_command_t *command, sdioc_data_t *data, sdioc_dma_config_t *dmaConfig) |
Transfer parameters command/data/dma configurations. More... | |
SDIOC transactional interface | |
void | SDIOC_TransferCreateHandle (SDIOC_Type *base, sdioc_handle_t *handle, sdioc_callback_t *callback, void *userData) |
Creates the SDIOC handle. More... | |
status_t | SDIOC_TransferDMANonBlocking (sdioc_handle_t *handle, sdioc_command_t *command, sdioc_data_t *data, sdioc_dma_config_t *dmaConfig) |
Transfers the command/data using an interrupt and an asynchronous method. More... | |
void | SDIOC_TransferHandleIRQ (sdioc_handle_t *handle) |
IRQ handler for the SDIOC. More... | |
struct sdioc_config_t |
Data Fields | |
sdioc_bus_voltage_t | busVoltage |
bus voltage | |
sdioc_data_timeout_value_t | dataTimeout |
data timeout value | |
struct sdioc_command_t |
Data Fields | |
uint32_t | commandIndex |
Command index. | |
uint32_t | commandArgument |
command argument which specified as bit 39-8 of command-format | |
uint8_t | commandType |
Command type, _sdioc_command_type. | |
uint32_t | commandResponseType |
Command response type, _sdioc_command_response_type. | |
uint32_t | commandResponseErrorFlags |
Command response error flags. | |
uint32_t | commandResponse [4] |
Command response. | |
struct sdioc_data_t |
Data Fields | |
bool | dataEnableAutoCommand12 |
enable auto command 12 after data transfer complete | |
uint32_t | dataBlockCount |
Block count for current transfer. More... | |
uint32_t | dataBlockSize |
Transfer block size. More... | |
uint8_t * | dataTxAddr |
tx data buffer address | |
uint8_t * | dataRxAddr |
rx data buffer address | |
uint32_t sdioc_data_t::dataBlockCount |
uint32_t sdioc_data_t::dataBlockSize |
struct sdioc_dma_config_t |
Data Fields | |
sdioc_dma_buffer_boundary_t | dmaBufferBoundary |
dma buffer boundary | |
struct _sdioc_handle |
SDIOC handle typedef.
Defines the structure to save the SDIOC state information and callback function.
Data Fields | |
SDIOC_Type * | base |
host controller base address | |
sdioc_data_t * | data |
transfer data pointer | |
sdioc_command_t * | command |
transfer command pointer | |
sdioc_callback_t | callback |
Callback function. More... | |
void * | userData |
Parameter for transfer complete callback. More... | |
sdioc_callback_t sdioc_handle_t::callback |
void* sdioc_handle_t::userData |
#define FSL_SDIOC_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) |
anonymous enum |
enum sdioc_bus_voltage_t |
enum sdioc_bus_speed_t |
enum sdioc_bus_width_t |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
void SDIOC_Init | ( | SDIOC_Type * | base, |
const sdioc_config_t * | config | ||
) |
Configures the SDIOC according to the user configuration.
Example:
base | SDIOC peripheral base address. |
config | SDIOC configuration information. |
kStatus_Success | Operate successfully. |
void SDIOC_Deinit | ( | SDIOC_Type * | base | ) |
base | SDIOC peripheral base address. |
|
inlinestatic |
base | SDIOC peripheral base address. |
busVoltage | SDIO bus voltage. |
|
inlinestatic |
base | SDIOC peripheral base address. |
busWidth | SDIO bus width. |
|
inlinestatic |
base | SDIOC peripheral base address. |
busSpeed | SDIO bus speed. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is enable power, false is disable power. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is enable internal clock, false is disable internal clock. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is enable card clock, false is disable card clock. |
|
inlinestatic |
base | SDIOC peripheral base address. |
|
inlinestatic |
base | SDIOC peripheral base address. |
|
inlinestatic |
base | SDIOC peripheral base address. |
|
inlinestatic |
base | SDIOC peripheral base address. |
timeout | timeout value. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is enable stop executing read and write transaction at next block gap, false is disable. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is restart a transaction which was stopped using stop at block gap request, false not affect. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is enable read wait function, false is disable. |
|
inlinestatic |
base | SDIOC peripheral base address. |
enable | true is enable interrupt at block gap, false is disable. |
|
inlinestatic |
base | SDIOC peripheral base address. |
responseIndex | response index. |
response | read from sdioc. |
|
inlinestatic |
base | SDIOC peripheral base address. |
data | read from SDIOC fifo. |
|
inlinestatic |
base | SDIOC peripheral base address. |
data | data to be written to SDIOC fifo. |
|
inlinestatic |
The large contiguous memory space may not be available in the virtual memory system. To perform long DMA transfer, DMA System Address register shall be updated at every system memory boundary during DMA transfer. These bits specify the size of contiguous buffer in the system memory. The SDMA transfer shall wait at the every boundary specified by these fields and the Host Controller generates the DMA Interrupt to request the Host Driver to update the SDMA System Address register.
base | SDIOC peripheral base address. |
bufferBoundary | dma buffer boundary. |
|
inlinestatic |
base | SDIOC peripheral base address. |
bufferAddress | dma buffer address. |
|
inlinestatic |
base | SDIOC peripheral base address. |
interruptFlags | status flag to enable/disable, _sdioc_interrupt_flag. |
enable | true is enable the corresponding interrupt status, false is disable. |
|
inlinestatic |
base | SDIOC peripheral base address. |
interruptFlags | status flag to enable/disable, _sdioc_interrupt_flag. |
enable | true is enable the corresponding interrupt status, false is disable. |
|
inlinestatic |
base | SDIOC peripheral base address. |
interrupt | status flag. |
|
inlinestatic |
base | USDHC peripheral base address. |
Current | interrupt status flags mask _sdioc_interrupt_flag. |
|
inlinestatic |
base | SDIOC peripheral base address. |
interruptFlags | interrupt status flag to clear, _sdioc_interrupt_flag.. |
|
inlinestatic |
base | SDIOC peripheral base address. |
present | status flag. |
status_t SDIOC_SetTransferConfig | ( | SDIOC_Type * | base, |
sdioc_command_t * | command, | ||
sdioc_data_t * | data, | ||
sdioc_dma_config_t * | dmaConfig | ||
) |
base | SDIOC base address. |
command | Transfer command pointer, application should not pass NULL pointer to this parameter. |
data | Transfer data pointer, application can pass NULL when send command only. |
dmaConfig | Internal dma configurations, application can pass NULL when dma is not used. |
kStatus_InvalidArgument | Argument is invalid. |
kStatus_Success | Operate successfully. |
void SDIOC_TransferCreateHandle | ( | SDIOC_Type * | base, |
sdioc_handle_t * | handle, | ||
sdioc_callback_t * | callback, | ||
void * | userData | ||
) |
base | SDIOC peripheral base address. |
handle | SDIOC handle pointer. |
callback | Structure pointer to contain all callback functions. |
userData | Callback function parameter. |
status_t SDIOC_TransferDMANonBlocking | ( | sdioc_handle_t * | handle, |
sdioc_command_t * | command, | ||
sdioc_data_t * | data, | ||
sdioc_dma_config_t * | dmaConfig | ||
) |
This function sends a command and data and returns immediately. It doesn't wait for the transfer to complete or to encounter an error. The application must not call this API in multiple threads at the same time. Because of that this API doesn't support the re-entry mechanism.
This function transfer data through SDIOC internal DMA.
handle | SDIOC handle. |
command | Transfer command pointer should not be NULL. |
data | Transfer data pointer can be NULL if send command only. |
dmaConfig | Internal dma configurations, NULL pointer is not allowed. |
kStatus_InvalidArgument | Argument is invalid. |
kStatus_SDIOC_BusyTransferring | Busy transferring. |
kStatus_Success | Operate successfully. |
void SDIOC_TransferHandleIRQ | ( | sdioc_handle_t * | handle | ) |
This function deals with the IRQs on the given host controller.
handle | SDIOC handle. |