Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the SDHC HAL driver.
Data Structures | |
struct | sdhc_hal_basic_info_t |
Data structure to get the basic information of SDHC. More... | |
struct | sdhc_hal_sdclk_config_t |
SD clock configuration to configure the clock of SD protocol unit. More... | |
struct | sdhc_mmcboot_param_t |
Data structure to configure the MMC boot feature. More... | |
struct | sdhc_hal_config_t |
Data structure to initialize the SDHC. More... | |
struct | sdhc_hal_cmd_req_t |
Command request structure. More... | |
Macros | |
#define | SDHC_HAL_ADMA1_ADDR_ALIGN (4096) |
SDHC ADMA address alignment size and length alignment size. | |
Enumerations | |
enum | sdhc_hal_mmcboot_t |
MMC card BOOT type. | |
enum | sdhc_hal_led_t |
Led control status. | |
enum | sdhc_hal_dtw_t |
Data transfer width. | |
enum | sdhc_hal_endian_t |
SDHC endian mode. | |
enum | sdhc_hal_dma_mode_t |
SDHC DMA mode. | |
enum | sdhc_hal_curstat_type_t { kSdhcHalIsCmdInhibit, kSdhcHalIsDataInhibit, kSdhcHalIsDataLineActive, kSdhcHalIsSdClockStable, kSdhcHalIsIpgClockOff, kSdhcHalIsSysClockOff, kSdhcHalIsPeripheralClockOff, kSdhcHalIsSdClkOff, kSdhcHalIsWriteTransferActive, kSdhcHalIsReadTransferActive, kSdhcHalIsBuffWriteEnabled, kSdhcHalIsBuffReadEnabled, kSdhcHalIsCardInserted, kSdhcHalIsCmdLineLevelHigh, kSdhcHalGetDataLine0Level, kSdhcHalGetDataLine1Level, kSdhcHalGetDataLine2Level, kSdhcHalGetDataLine3Level, kSdhcHalGetDataLine4Level, kSdhcHalGetDataLine5Level, kSdhcHalGetDataLine6Level, kSdhcHalGetDataLine7Level, kSdhcHalGetCdTestLevel } |
Current SDHC status type. More... | |
enum | sdhc_hal_err_type_t { kAc12Err, kAdmaErr } |
SDHC error type. More... | |
SDHC HAL FUNCTION | |
void | SDHC_HAL_SendCmd (SDHC_Type *base, const sdhc_hal_cmd_req_t *cmdReq) |
Sends command to card. More... | |
static void | SDHC_HAL_SetData (SDHC_Type *base, uint32_t data) |
Fills the the data port. More... | |
static uint32_t | SDHC_HAL_GetData (SDHC_Type *base) |
Retrieves the data from the data port. More... | |
bool | SDHC_HAL_GetCurState (SDHC_Type *base, sdhc_hal_curstat_type_t stateType) |
Gets the current card's status. More... | |
static void | SDHC_HAL_SetDataTransferWidth (SDHC_Type *base, sdhc_hal_dtw_t dtw) |
Sets the data transfer width. More... | |
static void | SDHC_HAL_SetContinueRequest (SDHC_Type *base) |
Restarts a transaction which has stopped at the block gap. More... | |
void | SDHC_HAL_Config (SDHC_Type *base, const sdhc_hal_config_t *initConfig) |
Initialize the SDHC according to the configuration user input. More... | |
void | SDHC_HAL_ConfigSdClock (SDHC_Type *base, sdhc_hal_sdclk_config_t *clkConfItms) |
Sets SDHC SD protocol unit clock. More... | |
static uint32_t | SDHC_HAL_GetIntFlags (SDHC_Type *base) |
Gets the current interrupt status. More... | |
static void | SDHC_HAL_ClearIntFlags (SDHC_Type *base, uint32_t mask) |
Clears a specified interrupt status. More... | |
void | SDHC_HAL_GetAllErrStatus (SDHC_Type *base, sdhc_hal_err_type_t errType, uint32_t *errFlags) |
Gets the error status of SDHC. More... | |
static void | SDHC_HAL_SetForceEventFlags (SDHC_Type *base, uint32_t mask) |
Sets the force events according to the given mask. More... | |
static void | SDHC_HAL_SetAdmaAddress (SDHC_Type *base, uint32_t address) |
Sets the ADMA address. More... | |
uint32_t | SDHC_HAL_GetResponse (SDHC_Type *base, uint32_t index) |
Gets the command response. More... | |
void | SDHC_HAL_SetIntSignal (SDHC_Type *base, bool enable, uint32_t mask) |
Enables the specified interrupts. More... | |
void | SDHC_HAL_SetIntState (SDHC_Type *base, bool enable, uint32_t mask) |
Enables the specified interrupt state. More... | |
uint32_t | SDHC_HAL_Reset (SDHC_Type *base, uint32_t type, uint32_t timeout) |
Performs an SDHC reset. More... | |
uint32_t | SDHC_HAL_InitCard (SDHC_Type *base, uint32_t timeout) |
Sends 80 clocks to the card to initialize the card. More... | |
void | SDHC_HAL_Init (SDHC_Type *base) |
Initializes the SDHC HAL. More... | |
void | SDHC_HAL_GetBasicInfo (SDHC_Type *base, sdhc_hal_basic_info_t *basicInfo) |
Gets the capability of SDHC. More... | |
struct sdhc_hal_basic_info_t |
Data Fields | |
uint8_t | specVer |
Save the specification version. | |
uint8_t | vendorVer |
Save the vendor version. | |
uint16_t | maxBlkLen |
Save the maximum block length. | |
uint32_t | capability |
The capability flags. | |
struct sdhc_hal_sdclk_config_t |
struct sdhc_mmcboot_param_t |
Data Fields | |
uint32_t | ackTimeout |
Sets the timeout value for the boot ACK. More... | |
sdhc_hal_mmcboot_t | mode |
Configures the boot mode. More... | |
uint32_t | blockCount |
Configures the the block count for the boot. More... | |
uint32_t sdhc_mmcboot_param_t::ackTimeout |
sdhc_hal_mmcboot_t sdhc_mmcboot_param_t::mode |
uint32_t sdhc_mmcboot_param_t::blockCount |
struct sdhc_hal_config_t |
Data Fields | |
sdhc_hal_led_t | ledState |
Sets the LED state. More... | |
sdhc_hal_endian_t | endianMode |
Configures the endian mode. More... | |
sdhc_hal_dma_mode_t | dmaMode |
Sets the DMA mode. More... | |
uint8_t | writeWatermarkLevel |
Sets the watermark for writing. More... | |
uint8_t | readWatermarkLevel |
Sets the watermark for reading. More... | |
uint32_t | enFlags |
Enable or disable corresponding feature. | |
sdhc_mmcboot_param_t | bootParams |
Configuration read MMC card boot data feature. | |
sdhc_hal_led_t sdhc_hal_config_t::ledState |
sdhc_hal_endian_t sdhc_hal_config_t::endianMode |
sdhc_hal_dma_mode_t sdhc_hal_config_t::dmaMode |
uint8_t sdhc_hal_config_t::writeWatermarkLevel |
uint8_t sdhc_hal_config_t::readWatermarkLevel |
struct sdhc_hal_cmd_req_t |
Data Fields | |
uint32_t | dataBlkSize |
Command data Block size. | |
uint32_t | dataBlkCount |
Command data Block count. | |
uint32_t | arg |
Command argument. | |
uint32_t | index |
Command index. | |
uint32_t | flags |
Command Flags. | |
enum sdhc_hal_err_type_t |
void SDHC_HAL_SendCmd | ( | SDHC_Type * | base, |
const sdhc_hal_cmd_req_t * | cmdReq | ||
) |
base | SDHC base address |
cmdReq | command request structure |
|
inlinestatic |
base | SDHC base address |
data | the data about to be sent |
|
inlinestatic |
base | SDHC base address |
bool SDHC_HAL_GetCurState | ( | SDHC_Type * | base, |
sdhc_hal_curstat_type_t | stateType | ||
) |
base | SDHC base address |
stateType | The status type. |
|
inlinestatic |
base | SDHC base address |
dtw | data transfer width |
|
inlinestatic |
base | SDHC base address |
void SDHC_HAL_Config | ( | SDHC_Type * | base, |
const sdhc_hal_config_t * | initConfig | ||
) |
base | SDHC base address |
initConfig | The configuration structure |
void SDHC_HAL_ConfigSdClock | ( | SDHC_Type * | base, |
sdhc_hal_sdclk_config_t * | clkConfItms | ||
) |
base | SDHC base address |
clkConfItms | SDHC SD protocol unit clock configuration items. |
|
inlinestatic |
base | SDHC base address |
|
inlinestatic |
base | SDHC base address |
mask | to specify interrupts' flags to be cleared |
void SDHC_HAL_GetAllErrStatus | ( | SDHC_Type * | base, |
sdhc_hal_err_type_t | errType, | ||
uint32_t * | errFlags | ||
) |
base | SDHC base address |
errType | the error type |
errFlags | the result error flags |
|
inlinestatic |
base | SDHC base address |
mask | to specify the force events' flags to be set |
|
inlinestatic |
base | SDHC base address |
address | for ADMA transfer |
uint32_t SDHC_HAL_GetResponse | ( | SDHC_Type * | base, |
uint32_t | index | ||
) |
base | SDHC base address |
index | of response register, range from 0 to 3 |
void SDHC_HAL_SetIntSignal | ( | SDHC_Type * | base, |
bool | enable, | ||
uint32_t | mask | ||
) |
base | SDHC base address |
enable | enable or disable |
mask | to specify interrupts to be isEnabledd |
void SDHC_HAL_SetIntState | ( | SDHC_Type * | base, |
bool | enable, | ||
uint32_t | mask | ||
) |
base | SDHC base address |
enable | enable or disable |
mask | to specify interrupts' state to be enabled |
uint32_t SDHC_HAL_Reset | ( | SDHC_Type * | base, |
uint32_t | type, | ||
uint32_t | timeout | ||
) |
base | SDHC base address |
type | the type of reset |
timeout | timeout for reset |
uint32_t SDHC_HAL_InitCard | ( | SDHC_Type * | base, |
uint32_t | timeout | ||
) |
base | SDHC base address |
timeout | timeout for initialize card |
void SDHC_HAL_Init | ( | SDHC_Type * | base | ) |
base | SDHC base address |
void SDHC_HAL_GetBasicInfo | ( | SDHC_Type * | base, |
sdhc_hal_basic_info_t * | basicInfo | ||
) |
base | SDHC base address |
basicInfo | Pointer to user data structure. |