![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the SD/MMC/SDIO card interface (sdif) module of MCUXpresso SDK devices.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/sdif
Data Structures | |
struct | sdif_dma_descriptor_t |
define the internal DMA descriptor More... | |
struct | sdif_dma_config_t |
Defines the internal DMA configure structure. More... | |
struct | sdif_data_t |
Card data descriptor. More... | |
struct | sdif_command_t |
Card command descriptor. More... | |
struct | sdif_transfer_t |
Transfer state. More... | |
struct | sdif_config_t |
Data structure to initialize the sdif. More... | |
struct | sdif_capability_t |
SDIF capability information. More... | |
struct | sdif_transfer_callback_t |
sdif callback functions. More... | |
struct | sdif_handle_t |
sdif handle More... | |
struct | sdif_host_t |
sdif host descriptor More... | |
Macros | |
#define | SDIF_CLOCK_RANGE_NEED_DELAY (50000000U) |
SDIOCLKCTRL setting Below clock delay setting should depend on specific platform, so it can be redefined when timing mismatch issue occur. More... | |
#define | SDIF_HIGHSPEED_SAMPLE_DELAY (12U) |
High speed mode clk_sample fixed delay. More... | |
#define | SDIF_HIGHSPEED_DRV_DELAY (31U) |
High speed mode clk_drv fixed delay. More... | |
#define | SDIF_HIGHSPEED_SAMPLE_PHASE_SHIFT (0U) |
High speed mode clk_sample phase shift. | |
#define | SDIF_HIGHSPEED_DRV_PHASE_SHIFT (1U) /* 90 degrees clk_drv phase delay */ |
High speed mode clk_drv phase shift. | |
#define | SDIF_DEFAULT_MODE_SAMPLE_DELAY (12U) |
default mode sample fixed delay More... | |
#define | SDIF_DEFAULT_MODE_DRV_DELAY (31U) |
31 * 250ps = 7.75ns | |
#define | SDIF_INTERNAL_DMA_ADDR_ALIGN (4U) |
SDIF internal DMA descriptor address and the data buffer address align. | |
#define | SDIF_DMA_DESCRIPTOR_DISABLE_COMPLETE_INT_FLAG (1UL << 1U) |
SDIF DMA descriptor flag. | |
Typedefs | |
typedef status_t(* | sdif_transfer_function_t )(SDIF_Type *base, sdif_transfer_t *content) |
sdif transfer function. More... | |
Enumerations | |
enum | { kStatus_SDIF_DescriptorBufferLenError = MAKE_STATUS(kStatusGroup_SDIF, 0U), kStatus_SDIF_InvalidArgument = MAKE_STATUS(kStatusGroup_SDIF, 1U), kStatus_SDIF_SyncCmdTimeout = MAKE_STATUS(kStatusGroup_SDIF, 2U), kStatus_SDIF_SendCmdFail = MAKE_STATUS(kStatusGroup_SDIF, 3U), kStatus_SDIF_SendCmdErrorBufferFull, kStatus_SDIF_DMATransferFailWithFBE, kStatus_SDIF_DMATransferDescriptorUnavailable, kStatus_SDIF_DataTransferFail = MAKE_STATUS(kStatusGroup_SDIF, 6U), kStatus_SDIF_ResponseError = MAKE_STATUS(kStatusGroup_SDIF, 7U), kStatus_SDIF_DMAAddrNotAlign = MAKE_STATUS(kStatusGroup_SDIF, 8U), kStatus_SDIF_BusyTransferring = MAKE_STATUS(kStatusGroup_SDIF, 9U), kStatus_SDIF_DataTransferSuccess = MAKE_STATUS(kStatusGroup_SDIF, 10U), kStatus_SDIF_SendCmdSuccess = MAKE_STATUS(kStatusGroup_SDIF, 11U) } |
_sdif_status SDIF status More... | |
enum | { kSDIF_SupportHighSpeedFlag = 0x1U, kSDIF_SupportDmaFlag = 0x2U, kSDIF_SupportSuspendResumeFlag = 0x4U, kSDIF_SupportV330Flag = 0x8U, kSDIF_Support4BitFlag = 0x10U, kSDIF_Support8BitFlag = 0x20U } |
_sdif_capability_flag Host controller capabilities flag mask More... | |
enum | { kSDIF_ResetController = SDIF_CTRL_CONTROLLER_RESET_MASK, kSDIF_ResetFIFO = SDIF_CTRL_FIFO_RESET_MASK, kSDIF_ResetDMAInterface = SDIF_CTRL_DMA_RESET_MASK, kSDIF_ResetAll } |
_sdif_reset_type define the reset type More... | |
enum | sdif_bus_width_t { kSDIF_Bus1BitWidth = 0U, kSDIF_Bus4BitWidth = 1U, kSDIF_Bus8BitWidth = 2U } |
define the card bus width type More... | |
enum | { kSDIF_CmdResponseExpect = SDIF_CMD_RESPONSE_EXPECT_MASK, kSDIF_CmdResponseLengthLong = SDIF_CMD_RESPONSE_LENGTH_MASK, kSDIF_CmdCheckResponseCRC = SDIF_CMD_CHECK_RESPONSE_CRC_MASK, kSDIF_DataExpect = SDIF_CMD_DATA_EXPECTED_MASK, kSDIF_DataWriteToCard = SDIF_CMD_READ_WRITE_MASK, kSDIF_DataStreamTransfer = SDIF_CMD_TRANSFER_MODE_MASK, kSDIF_DataTransferAutoStop = SDIF_CMD_SEND_AUTO_STOP_MASK, kSDIF_WaitPreTransferComplete, kSDIF_TransferStopAbort = SDIF_CMD_STOP_ABORT_CMD_MASK, kSDIF_SendInitialization, kSDIF_CmdUpdateClockRegisterOnly, kSDIF_CmdtoReadCEATADevice = SDIF_CMD_READ_CEATA_DEVICE_MASK, kSDIF_CmdExpectCCS = SDIF_CMD_CCS_EXPECTED_MASK, kSDIF_BootModeEnable = SDIF_CMD_ENABLE_BOOT_MASK, kSDIF_BootModeExpectAck = SDIF_CMD_EXPECT_BOOT_ACK_MASK, kSDIF_BootModeDisable = SDIF_CMD_DISABLE_BOOT_MASK, kSDIF_BootModeAlternate = SDIF_CMD_BOOT_MODE_MASK, kSDIF_CmdVoltageSwitch = SDIF_CMD_VOLT_SWITCH_MASK, kSDIF_CmdDataUseHoldReg = SDIF_CMD_USE_HOLD_REG_MASK } |
_sdif_command_flags define the command flags More... | |
enum | { kCARD_CommandTypeNormal = 0U, kCARD_CommandTypeSuspend = 1U, kCARD_CommandTypeResume = 2U, kCARD_CommandTypeAbort = 3U } |
_sdif_command_type The command type More... | |
enum | { kCARD_ResponseTypeNone = 0U, kCARD_ResponseTypeR1 = 1U, kCARD_ResponseTypeR1b = 2U, kCARD_ResponseTypeR2 = 3U, kCARD_ResponseTypeR3 = 4U, kCARD_ResponseTypeR4 = 5U, kCARD_ResponseTypeR5 = 6U, kCARD_ResponseTypeR5b = 7U, kCARD_ResponseTypeR6 = 8U, kCARD_ResponseTypeR7 = 9U } |
_sdif_response_type The command response type. More... | |
enum | { kSDIF_CardDetect = SDIF_INTMASK_CDET_MASK, kSDIF_ResponseError = SDIF_INTMASK_RE_MASK, kSDIF_CommandDone = SDIF_INTMASK_CDONE_MASK, kSDIF_DataTransferOver = SDIF_INTMASK_DTO_MASK, kSDIF_WriteFIFORequest = SDIF_INTMASK_TXDR_MASK, kSDIF_ReadFIFORequest = SDIF_INTMASK_RXDR_MASK, kSDIF_ResponseCRCError = SDIF_INTMASK_RCRC_MASK, kSDIF_DataCRCError = SDIF_INTMASK_DCRC_MASK, kSDIF_ResponseTimeout = SDIF_INTMASK_RTO_MASK, kSDIF_DataReadTimeout = SDIF_INTMASK_DRTO_MASK, kSDIF_DataStarvationByHostTimeout = SDIF_INTMASK_HTO_MASK, kSDIF_FIFOError = SDIF_INTMASK_FRUN_MASK, kSDIF_HardwareLockError = SDIF_INTMASK_HLE_MASK, kSDIF_DataStartBitError = SDIF_INTMASK_SBE_MASK, kSDIF_AutoCmdDone = SDIF_INTMASK_ACD_MASK, kSDIF_DataEndBitError = SDIF_INTMASK_EBE_MASK, kSDIF_SDIOInterrupt = SDIF_INTMASK_SDIO_INT_MASK_MASK, kSDIF_CommandTransferStatus, kSDIF_DataTransferStatus , kSDIF_AllInterruptStatus = 0x1FFFFU } |
_sdif_interrupt_mask define the interrupt mask flags More... | |
enum | { kSDIF_DMATransFinishOneDescriptor = SDIF_IDSTS_TI_MASK, kSDIF_DMARecvFinishOneDescriptor = SDIF_IDSTS_RI_MASK, kSDIF_DMAFatalBusError = SDIF_IDSTS_FBE_MASK, kSDIF_DMADescriptorUnavailable = SDIF_IDSTS_DU_MASK, kSDIF_DMACardErrorSummary = SDIF_IDSTS_CES_MASK, kSDIF_NormalInterruptSummary = SDIF_IDSTS_NIS_MASK, kSDIF_AbnormalInterruptSummary = SDIF_IDSTS_AIS_MASK } |
_sdif_dma_status define the internal DMA status flags More... | |
enum | { kSDIF_DisableCompleteInterrupt = 0x2U, kSDIF_DMADescriptorDataBufferEnd = 0x4U, kSDIF_DMADescriptorDataBufferStart = 0x8U, kSDIF_DMASecondAddrChained = 0x10U, kSDIF_DMADescriptorEnd = 0x20U, kSDIF_DMADescriptorOwnByDMA = (int)0x80000000 } |
_sdif_dma_descriptor_flag define the internal DMA descriptor flag More... | |
enum | sdif_dma_mode_t |
define the internal DMA mode | |
Functions | |
void | SDIF_Init (SDIF_Type *base, sdif_config_t *config) |
SDIF module initialization function. More... | |
void | SDIF_Deinit (SDIF_Type *base) |
SDIF module deinit function. More... | |
bool | SDIF_SendCardActive (SDIF_Type *base, uint32_t timeout) |
SDIF send initialize 80 clocks for SD card after initial. More... | |
static void | SDIF_EnableCardClock (SDIF_Type *base, bool enable) |
SDIF module enable/disable card0 clock. More... | |
static void | SDIF_EnableCard1Clock (SDIF_Type *base, bool enable) |
SDIF module enable/disable card1 clock. More... | |
static void | SDIF_EnableLowPowerMode (SDIF_Type *base, bool enable) |
SDIF module enable/disable module disable the card clock to enter low power mode when card is idle,for SDIF cards, if interrupts must be detected, clock should not be stopped. More... | |
static void | SDIF_EnableCard1LowPowerMode (SDIF_Type *base, bool enable) |
SDIF module enable/disable module disable the card clock to enter low power mode when card is idle,for SDIF cards, if interrupts must be detected, clock should not be stopped. More... | |
static void | SDIF_EnableCardPower (SDIF_Type *base, bool enable) |
enable/disable the card0 power. More... | |
static void | SDIF_EnableCard1Power (SDIF_Type *base, bool enable) |
enable/disable the card1 power. More... | |
void | SDIF_SetCardBusWidth (SDIF_Type *base, sdif_bus_width_t type) |
set card0 data bus width More... | |
void | SDIF_SetCard1BusWidth (SDIF_Type *base, sdif_bus_width_t type) |
set card1 data bus width More... | |
static uint32_t | SDIF_DetectCardInsert (SDIF_Type *base, bool data3) |
SDIF module detect card0 insert status function. More... | |
static uint32_t | SDIF_DetectCard1Insert (SDIF_Type *base, bool data3) |
SDIF module detect card1 insert status function. More... | |
uint32_t | SDIF_SetCardClock (SDIF_Type *base, uint32_t srcClock_Hz, uint32_t target_HZ) |
Sets the card bus clock frequency. More... | |
bool | SDIF_Reset (SDIF_Type *base, uint32_t mask, uint32_t timeout) |
reset the different block of the interface. More... | |
static uint32_t | SDIF_GetCardWriteProtect (SDIF_Type *base) |
get the card write protect status More... | |
static void | SDIF_AssertHardwareReset (SDIF_Type *base) |
toggle state on hardware reset PIN This is used which card has a reset PIN typically. More... | |
status_t | SDIF_SendCommand (SDIF_Type *base, sdif_command_t *cmd, uint32_t timeout) |
send command to the card More... | |
static void | SDIF_EnableGlobalInterrupt (SDIF_Type *base, bool enable) |
SDIF enable/disable global interrupt. More... | |
static void | SDIF_EnableInterrupt (SDIF_Type *base, uint32_t mask) |
SDIF enable interrupt. More... | |
static void | SDIF_DisableInterrupt (SDIF_Type *base, uint32_t mask) |
SDIF disable interrupt. More... | |
static uint32_t | SDIF_GetInterruptStatus (SDIF_Type *base) |
SDIF get interrupt status. More... | |
static uint32_t | SDIF_GetEnabledInterruptStatus (SDIF_Type *base) |
SDIF get enabled interrupt status. More... | |
static void | SDIF_ClearInterruptStatus (SDIF_Type *base, uint32_t mask) |
SDIF clear interrupt status. More... | |
void | SDIF_TransferCreateHandle (SDIF_Type *base, sdif_handle_t *handle, sdif_transfer_callback_t *callback, void *userData) |
Creates the SDIF handle. More... | |
static void | SDIF_EnableDmaInterrupt (SDIF_Type *base, uint32_t mask) |
SDIF enable DMA interrupt. More... | |
static void | SDIF_DisableDmaInterrupt (SDIF_Type *base, uint32_t mask) |
SDIF disable DMA interrupt. More... | |
static uint32_t | SDIF_GetInternalDMAStatus (SDIF_Type *base) |
SDIF get internal DMA status. More... | |
static uint32_t | SDIF_GetEnabledDMAInterruptStatus (SDIF_Type *base) |
SDIF get enabled internal DMA interrupt status. More... | |
static void | SDIF_ClearInternalDMAStatus (SDIF_Type *base, uint32_t mask) |
SDIF clear internal DMA status. More... | |
status_t | SDIF_InternalDMAConfig (SDIF_Type *base, sdif_dma_config_t *config, const uint32_t *data, uint32_t dataSize) |
SDIF internal DMA config function. More... | |
static void | SDIF_EnableInternalDMA (SDIF_Type *base, bool enable) |
SDIF internal DMA enable. More... | |
static void | SDIF_SendReadWait (SDIF_Type *base) |
SDIF send read wait to SDIF card function. More... | |
bool | SDIF_AbortReadData (SDIF_Type *base, uint32_t timeout) |
SDIF abort the read data when SDIF card is in suspend state Once assert this bit,data state machine will be reset which is waiting for the next blocking data,used in SDIO card suspend sequence,should call after suspend cmd send. More... | |
static void | SDIF_EnableCEATAInterrupt (SDIF_Type *base, bool enable) |
SDIF enable/disable CE-ATA card interrupt this bit should set together with the card register. More... | |
status_t | SDIF_TransferNonBlocking (SDIF_Type *base, sdif_handle_t *handle, sdif_dma_config_t *dmaConfig, sdif_transfer_t *transfer) |
SDIF transfer function data/cmd in a non-blocking way this API should be use in interrupt mode, when use this API user must call SDIF_TransferCreateHandle first, all status check through interrupt. More... | |
status_t | SDIF_TransferBlocking (SDIF_Type *base, sdif_dma_config_t *dmaConfig, sdif_transfer_t *transfer) |
SDIF transfer function data/cmd in a blocking way. More... | |
status_t | SDIF_ReleaseDMADescriptor (SDIF_Type *base, sdif_dma_config_t *dmaConfig) |
SDIF release the DMA descriptor to DMA engine this function should be called when DMA descriptor unavailable status occurs. More... | |
void | SDIF_GetCapability (SDIF_Type *base, sdif_capability_t *capability) |
SDIF return the controller capability. More... | |
static uint32_t | SDIF_GetControllerStatus (SDIF_Type *base) |
SDIF return the controller status. More... | |
static void | SDIF_SendCCSD (SDIF_Type *base, bool withAutoStop) |
SDIF send command complete signal disable to CE-ATA card. More... | |
void | SDIF_ConfigClockDelay (uint32_t target_HZ, uint32_t divider) |
SDIF config the clock delay This function is used to config the cclk_in delay to sample and driver the data ,should meet the min setup time and hold time, and user need to config this parameter according to your board setting. More... | |
Driver version | |
#define | FSL_SDIF_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 15U)) |
Driver version 2.0.15. More... | |
struct sdif_dma_descriptor_t |
Data Fields | |
uint32_t | dmaDesAttribute |
internal DMA attribute control and status | |
uint32_t | dmaDataBufferSize |
internal DMA transfer buffer size control | |
const uint32_t * | dmaDataBufferAddr0 |
internal DMA buffer 0 addr ,the buffer size must be 32bit aligned | |
const uint32_t * | dmaDataBufferAddr1 |
internal DMA buffer 1 addr ,the buffer size must be 32bit aligned | |
struct sdif_dma_config_t |
Data Fields | |
bool | enableFixBurstLen |
fix burst len enable/disable flag,When set, the AHB will use only SINGLE, INCR4, INCR8 or INCR16 during start of normal burst transfers. More... | |
sdif_dma_mode_t | mode |
define the DMA mode | |
uint8_t | dmaDesSkipLen |
define the descriptor skip length ,the length between two descriptor this field is special for dual DMA mode | |
uint32_t * | dmaDesBufferStartAddr |
internal DMA descriptor start address | |
uint32_t | dmaDesBufferLen |
internal DMA buffer descriptor buffer len ,user need to pay attention to the dma descriptor buffer length if it is bigger enough for your transfer | |
bool sdif_dma_config_t::enableFixBurstLen |
When reset, the AHB will use SINGLE and INCR burst transfer operations
struct sdif_data_t |
Data Fields | |
bool | streamTransfer |
indicate this is a stream data transfer command | |
bool | enableAutoCommand12 |
indicate if auto stop will send when data transfer over | |
bool | enableIgnoreError |
indicate if enable ignore error when transfer data | |
size_t | blockSize |
Block size, take care when configure this parameter. | |
uint32_t | blockCount |
Block count. | |
uint32_t * | rxData |
data buffer to receive | |
const uint32_t * | txData |
data buffer to transfer | |
struct sdif_command_t |
Define card command-related attribute.
Data Fields | |
uint32_t | index |
Command index. | |
uint32_t | argument |
Command argument. | |
uint32_t | response [4U] |
Response for this command. | |
uint32_t | type |
define the command type | |
uint32_t | responseType |
Command response type. | |
uint32_t | flags |
Cmd flags. | |
uint32_t | responseErrorFlags |
response error flags, need to check the flags when receive the cmd response | |
struct sdif_transfer_t |
Data Fields | |
sdif_data_t * | data |
Data to transfer. | |
sdif_command_t * | command |
Command to send. | |
struct sdif_config_t |
Data Fields | |
uint8_t | responseTimeout |
command response timeout value | |
uint32_t | cardDetDebounce_Clock |
define the debounce clock count which will used in card detect logic,typical value is 5-25ms | |
uint32_t | endianMode |
define endian mode ,this field is not used in this module actually, keep for compatible with middleware | |
uint32_t | dataTimeout |
data timeout value | |
struct sdif_capability_t |
Defines a structure to get the capability information of SDIF.
Data Fields | |
uint32_t | sdVersion |
support SD card/sdio version | |
uint32_t | mmcVersion |
support emmc card version | |
uint32_t | maxBlockLength |
Maximum block length united as byte. | |
uint32_t | maxBlockCount |
Maximum byte count can be transfered. | |
uint32_t | flags |
Capability flags to indicate the support information. | |
struct sdif_transfer_callback_t |
Data Fields | |
void(* | cardInserted )(SDIF_Type *base, void *userData) |
card insert call back | |
void(* | cardRemoved )(SDIF_Type *base, void *userData) |
card remove call back | |
void(* | SDIOInterrupt )(SDIF_Type *base, void *userData) |
SDIO card interrupt occurs. | |
void(* | DMADesUnavailable )(SDIF_Type *base, void *userData) |
DMA descriptor unavailable. | |
void(* | CommandReload )(SDIF_Type *base, void *userData) |
command buffer full,need re-load | |
void(* | TransferComplete )(SDIF_Type *base, void *handle, status_t status, void *userData) |
Transfer complete callback. | |
struct sdif_handle_t |
Defines the structure to save the sdif state information and callback function. The detail interrupt status when send command or transfer data can be obtained from interruptFlags field by using mask defined in sdif_interrupt_flag_t;
Data Fields | |
sdif_data_t *volatile | data |
Data to transfer. | |
sdif_command_t *volatile | command |
Command to send. | |
volatile uint32_t | transferredWords |
Words transferred by polling way. | |
sdif_transfer_callback_t | callback |
Callback function. | |
void * | userData |
Parameter for transfer complete callback. | |
struct sdif_host_t |
Data Fields | |
SDIF_Type * | base |
sdif peripheral base address | |
uint32_t | sourceClock_Hz |
sdif source clock frequency united in Hz | |
sdif_config_t | config |
sdif configuration | |
sdif_transfer_function_t | transfer |
sdif transfer function | |
sdif_capability_t | capability |
sdif capability information | |
#define FSL_SDIF_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 15U)) |
#define SDIF_CLOCK_RANGE_NEED_DELAY (50000000U) |
Such as: response error/CRC error and so on
clock range value which need to add delay to avoid timing issue
#define SDIF_HIGHSPEED_SAMPLE_DELAY (12U) |
12 * 250ps = 3ns
#define SDIF_HIGHSPEED_DRV_DELAY (31U) |
31 * 250ps = 7.75ns
#define SDIF_DEFAULT_MODE_SAMPLE_DELAY (12U) |
12 * 250ps = 3ns
typedef status_t(* sdif_transfer_function_t)(SDIF_Type *base, sdif_transfer_t *content) |
anonymous enum |
anonymous enum |
anonymous enum |
enum sdif_bus_width_t |
anonymous enum |
anonymous enum |
anonymous enum |
Define the command response type from card to host controller.
anonymous enum |
anonymous enum |
anonymous enum |
void SDIF_Init | ( | SDIF_Type * | base, |
sdif_config_t * | config | ||
) |
Configures the SDIF according to the user configuration.
base | SDIF peripheral base address. |
config | SDIF configuration information. |
void SDIF_Deinit | ( | SDIF_Type * | base | ) |
user should call this function follow with IP reset
base | SDIF peripheral base address. |
bool SDIF_SendCardActive | ( | SDIF_Type * | base, |
uint32_t | timeout | ||
) |
base | SDIF peripheral base address. |
timeout | timeout value |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | enable/disable flag |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | enable/disable flag |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | enable/disable flag |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | enable/disable flag |
|
inlinestatic |
once turn power on, software should wait for regulator/switch ramp-up time before trying to initialize card.
base | SDIF peripheral base address. |
enable | enable/disable flag. |
|
inlinestatic |
once turn power on, software should wait for regulator/switch ramp-up time before trying to initialize card.
base | SDIF peripheral base address. |
enable | enable/disable flag. |
void SDIF_SetCardBusWidth | ( | SDIF_Type * | base, |
sdif_bus_width_t | type | ||
) |
base | SDIF peripheral base address. |
type | data bus width type |
void SDIF_SetCard1BusWidth | ( | SDIF_Type * | base, |
sdif_bus_width_t | type | ||
) |
base | SDIF peripheral base address. |
type | data bus width type |
|
inlinestatic |
base | SDIF peripheral base address. |
data3 | indicate use data3 as card insert detect pin |
1 | card is inserted 0 card is removed |
|
inlinestatic |
base | SDIF peripheral base address. |
data3 | indicate use data3 as card insert detect pin |
1 | card is inserted 0 card is removed |
uint32_t SDIF_SetCardClock | ( | SDIF_Type * | base, |
uint32_t | srcClock_Hz, | ||
uint32_t | target_HZ | ||
) |
base | SDIF peripheral base address. |
srcClock_Hz | SDIF source clock frequency united in Hz. |
target_HZ | card bus clock frequency united in Hz. |
bool SDIF_Reset | ( | SDIF_Type * | base, |
uint32_t | mask, | ||
uint32_t | timeout | ||
) |
base | SDIF peripheral base address. |
mask | indicate which block to reset. |
timeout | timeout value,set to wait the bit self clear |
|
inlinestatic |
base | SDIF peripheral base address. |
|
inlinestatic |
base | SDIF peripheral base address. |
status_t SDIF_SendCommand | ( | SDIF_Type * | base, |
sdif_command_t * | cmd, | ||
uint32_t | timeout | ||
) |
This api include polling the status of the bit START_COMMAND, if 0 used as timeout value, then this function will return directly without polling the START_CMD status.
base | SDIF peripheral base address. |
cmd | configuration collection |
timeout | the timeout value of polling START_CMD auto clear status. |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | enable/disable flag |
|
inlinestatic |
base | SDIF peripheral base address. |
mask | mask |
|
inlinestatic |
base | SDIF peripheral base address. |
mask | mask |
|
inlinestatic |
base | SDIF peripheral base address. |
|
inlinestatic |
base | SDIF peripheral base address. |
|
inlinestatic |
base | SDIF peripheral base address. |
mask | mask to clear |
void SDIF_TransferCreateHandle | ( | SDIF_Type * | base, |
sdif_handle_t * | handle, | ||
sdif_transfer_callback_t * | callback, | ||
void * | userData | ||
) |
register call back function for interrupt and enable the interrupt
base | SDIF peripheral base address. |
handle | SDIF handle pointer. |
callback | Structure pointer to contain all callback functions. |
userData | Callback function parameter. |
|
inlinestatic |
base | SDIF peripheral base address. |
mask | mask to set |
|
inlinestatic |
base | SDIF peripheral base address. |
mask | mask to clear |
|
inlinestatic |
base | SDIF peripheral base address. |
|
inlinestatic |
base | SDIF peripheral base address. |
|
inlinestatic |
base | SDIF peripheral base address. |
mask | mask to clear |
status_t SDIF_InternalDMAConfig | ( | SDIF_Type * | base, |
sdif_dma_config_t * | config, | ||
const uint32_t * | data, | ||
uint32_t | dataSize | ||
) |
base | SDIF peripheral base address. |
config | DMA configuration collection |
data | buffer pointer |
dataSize | buffer size |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | internal DMA enable or disable flag. |
|
inlinestatic |
base | SDIF peripheral base address. |
bool SDIF_AbortReadData | ( | SDIF_Type * | base, |
uint32_t | timeout | ||
) |
base | SDIF peripheral base address. |
timeout | timeout value to wait this bit self clear which indicate the data machine reset to idle |
|
inlinestatic |
base | SDIF peripheral base address. |
enable | enable/disable flag |
status_t SDIF_TransferNonBlocking | ( | SDIF_Type * | base, |
sdif_handle_t * | handle, | ||
sdif_dma_config_t * | dmaConfig, | ||
sdif_transfer_t * | transfer | ||
) |
base | SDIF peripheral base address. |
handle | handle |
dmaConfig | config structure This parameter can be config as:
|
transfer | transfer configuration collection |
status_t SDIF_TransferBlocking | ( | SDIF_Type * | base, |
sdif_dma_config_t * | dmaConfig, | ||
sdif_transfer_t * | transfer | ||
) |
base | SDIF peripheral base address. |
dmaConfig | config structure
|
transfer | transfer configuration collection |
status_t SDIF_ReleaseDMADescriptor | ( | SDIF_Type * | base, |
sdif_dma_config_t * | dmaConfig | ||
) |
base | SDIF peripheral base address. |
dmaConfig | DMA config pointer |
void SDIF_GetCapability | ( | SDIF_Type * | base, |
sdif_capability_t * | capability | ||
) |
base | SDIF peripheral base address. |
capability | capability pointer |
|
inlinestatic |
base | SDIF peripheral base address. |
|
inlinestatic |
base | SDIF peripheral base address. |
withAutoStop | auto stop flag |
void SDIF_ConfigClockDelay | ( | uint32_t | target_HZ, |
uint32_t | divider | ||
) |
target_HZ | freq work mode |
divider | not used in this function anymore, use DELAY value instead of phase directly. |