|
STM32L4xx_HAL_Driver
1.14.0
|
Functions | |
| static uint32_t | SD_InitCard (SD_HandleTypeDef *hsd) |
| Initializes the sd card. More... | |
| static uint32_t | SD_PowerON (SD_HandleTypeDef *hsd) |
| Enquires cards about their operating voltage and configures clock controls and stores SD information that will be needed in future in the SD handle. More... | |
| static uint32_t | SD_SendSDStatus (SD_HandleTypeDef *hsd, uint32_t *pSDstatus) |
| Send Status info command. More... | |
| static uint32_t | SD_SendStatus (SD_HandleTypeDef *hsd, uint32_t *pCardStatus) |
| Returns the current card's status. More... | |
| static uint32_t | SD_WideBus_Enable (SD_HandleTypeDef *hsd) |
| Enables the SDMMC wide bus mode. More... | |
| static uint32_t | SD_WideBus_Disable (SD_HandleTypeDef *hsd) |
| Disables the SDMMC wide bus mode. More... | |
| static uint32_t | SD_FindSCR (SD_HandleTypeDef *hsd, uint32_t *pSCR) |
| Finds the SD card SCR register value. More... | |
| static void | SD_PowerOFF (SD_HandleTypeDef *hsd) |
| Turns the SDMMC output signals off. More... | |
| static void | SD_Write_IT (SD_HandleTypeDef *hsd) |
| Wrap up writing in non-blocking mode. More... | |
| static void | SD_Read_IT (SD_HandleTypeDef *hsd) |
| Wrap up reading in non-blocking mode. More... | |
| static void | SD_DMATransmitCplt (DMA_HandleTypeDef *hdma) |
| DMA SD transmit process complete callback. More... | |
| static void | SD_DMAReceiveCplt (DMA_HandleTypeDef *hdma) |
| DMA SD receive process complete callback. More... | |
| static void | SD_DMAError (DMA_HandleTypeDef *hdma) |
| DMA SD communication error callback. More... | |
| static void | SD_DMATxAbort (DMA_HandleTypeDef *hdma) |
| DMA SD Tx Abort callback. More... | |
| static void | SD_DMARxAbort (DMA_HandleTypeDef *hdma) |
| DMA SD Rx Abort callback. More... | |
| uint32_t | SD_HighSpeed (SD_HandleTypeDef *hsd) |
| Switches the SD card to High Speed mode. This API must be used after "Transfer State". More... | |
| static uint32_t | SD_UltraHighSpeed (SD_HandleTypeDef *hsd) |
| Switches the SD card to Ultra High Speed mode. This API must be used after "Transfer State". More... | |
| static uint32_t | SD_DDR_Mode (SD_HandleTypeDef *hsd) |
| Switches the SD card to Double Data Rate (DDR) mode. This API must be used after "Transfer State". More... | |
| while (((sta_reg &(SDMMC_FLAG_CCRCFAIL|SDMMC_FLAG_CMDREND|SDMMC_FLAG_CTIMEOUT))==0U)||((sta_reg &SDMMC_FLAG_CMDACT) !=0U)) | |
| if (__SDMMC_GET_FLAG(SDMMCx, SDMMC_FLAG_CTIMEOUT)) | |
| else | if (__SDMMC_GET_FLAG(SDMMCx, SDMMC_FLAG_CCRCFAIL)) |
| if (SDMMC_GetCommandResponse(SDMMCx) !=SD_CMD) | |
| if ((response_r1 &SDMMC_OCR_ERRORBITS)==SDMMC_ALLZERO) | |
| else | if ((response_r1 &SDMMC_OCR_ADDR_OUT_OF_RANGE)==SDMMC_OCR_ADDR_OUT_OF_RANGE) |
| else | if ((response_r1 &SDMMC_OCR_ADDR_MISALIGNED)==SDMMC_OCR_ADDR_MISALIGNED) |
| else | if ((response_r1 &SDMMC_OCR_BLOCK_LEN_ERR)==SDMMC_OCR_BLOCK_LEN_ERR) |
| else | if ((response_r1 &SDMMC_OCR_ERASE_SEQ_ERR)==SDMMC_OCR_ERASE_SEQ_ERR) |
| else | if ((response_r1 &SDMMC_OCR_BAD_ERASE_PARAM)==SDMMC_OCR_BAD_ERASE_PARAM) |
| else | if ((response_r1 &SDMMC_OCR_WRITE_PROT_VIOLATION)==SDMMC_OCR_WRITE_PROT_VIOLATION) |
| else | if ((response_r1 &SDMMC_OCR_LOCK_UNLOCK_FAILED)==SDMMC_OCR_LOCK_UNLOCK_FAILED) |
| else | if ((response_r1 &SDMMC_OCR_COM_CRC_FAILED)==SDMMC_OCR_COM_CRC_FAILED) |
| else | if ((response_r1 &SDMMC_OCR_ILLEGAL_CMD)==SDMMC_OCR_ILLEGAL_CMD) |
| else | if ((response_r1 &SDMMC_OCR_CARD_ECC_FAILED)==SDMMC_OCR_CARD_ECC_FAILED) |
| else | if ((response_r1 &SDMMC_OCR_CC_ERROR)==SDMMC_OCR_CC_ERROR) |
| else | if ((response_r1 &SDMMC_OCR_STREAM_READ_UNDERRUN)==SDMMC_OCR_STREAM_READ_UNDERRUN) |
| else | if ((response_r1 &SDMMC_OCR_STREAM_WRITE_OVERRUN)==SDMMC_OCR_STREAM_WRITE_OVERRUN) |
| else | if ((response_r1 &SDMMC_OCR_CID_CSD_OVERWRITE)==SDMMC_OCR_CID_CSD_OVERWRITE) |
| else | if ((response_r1 &SDMMC_OCR_WP_ERASE_SKIP)==SDMMC_OCR_WP_ERASE_SKIP) |
| else | if ((response_r1 &SDMMC_OCR_CARD_ECC_DISABLED)==SDMMC_OCR_CARD_ECC_DISABLED) |
| else | if ((response_r1 &SDMMC_OCR_ERASE_RESET)==SDMMC_OCR_ERASE_RESET) |
| else | if ((response_r1 &SDMMC_OCR_AKE_SEQ_ERROR)==SDMMC_OCR_AKE_SEQ_ERROR) |
Variables | |
| else | |
| response_r1 = SDMMC_GetResponse(SDMMCx, SDMMC_RESP1) | |
| if | ( | __SDMMC_GET_FLAG(SDMMCx, SDMMC_FLAG_CTIMEOUT) | ) |
Definition at line 1292 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | __SDMMC_GET_FLAG(SDMMCx, SDMMC_FLAG_CCRCFAIL) | ) |
Definition at line 1298 of file stm32l4xx_ll_sdmmc.c.
| if | ( | SDMMC_GetCommandResponse(SDMMCx) ! | = SD_CMD | ) |
Definition at line 1313 of file stm32l4xx_ll_sdmmc.c.
| if | ( | (response_r1 &SDMMC_OCR_ERRORBITS) | = = SDMMC_ALLZERO | ) |
Definition at line 1321 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_ADDR_OUT_OF_RANGE) | = = SDMMC_OCR_ADDR_OUT_OF_RANGE | ) |
Definition at line 1325 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_ADDR_MISALIGNED) | = = SDMMC_OCR_ADDR_MISALIGNED | ) |
Definition at line 1329 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_BLOCK_LEN_ERR) | = = SDMMC_OCR_BLOCK_LEN_ERR | ) |
Definition at line 1333 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_ERASE_SEQ_ERR) | = = SDMMC_OCR_ERASE_SEQ_ERR | ) |
Definition at line 1337 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_BAD_ERASE_PARAM) | = = SDMMC_OCR_BAD_ERASE_PARAM | ) |
Definition at line 1341 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_WRITE_PROT_VIOLATION) | = = SDMMC_OCR_WRITE_PROT_VIOLATION | ) |
Definition at line 1345 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_LOCK_UNLOCK_FAILED) | = = SDMMC_OCR_LOCK_UNLOCK_FAILED | ) |
Definition at line 1349 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_COM_CRC_FAILED) | = = SDMMC_OCR_COM_CRC_FAILED | ) |
Definition at line 1353 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_ILLEGAL_CMD) | = = SDMMC_OCR_ILLEGAL_CMD | ) |
Definition at line 1357 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_CARD_ECC_FAILED) | = = SDMMC_OCR_CARD_ECC_FAILED | ) |
Definition at line 1361 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_CC_ERROR) | = = SDMMC_OCR_CC_ERROR | ) |
Definition at line 1365 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_STREAM_READ_UNDERRUN) | = = SDMMC_OCR_STREAM_READ_UNDERRUN | ) |
Definition at line 1369 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_STREAM_WRITE_OVERRUN) | = = SDMMC_OCR_STREAM_WRITE_OVERRUN | ) |
Definition at line 1373 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_CID_CSD_OVERWRITE) | = = SDMMC_OCR_CID_CSD_OVERWRITE | ) |
Definition at line 1377 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_WP_ERASE_SKIP) | = = SDMMC_OCR_WP_ERASE_SKIP | ) |
Definition at line 1381 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_CARD_ECC_DISABLED) | = = SDMMC_OCR_CARD_ECC_DISABLED | ) |
Definition at line 1385 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_ERASE_RESET) | = = SDMMC_OCR_ERASE_RESET | ) |
Definition at line 1389 of file stm32l4xx_ll_sdmmc.c.
| else if | ( | (response_r1 &SDMMC_OCR_AKE_SEQ_ERROR) | = = SDMMC_OCR_AKE_SEQ_ERROR | ) |
Definition at line 1393 of file stm32l4xx_ll_sdmmc.c.
|
static |
Switches the SD card to Double Data Rate (DDR) mode. This API must be used after "Transfer State".
| hsd | SD handle |
| SD | Card error state |
Definition at line 4290 of file stm32l4xx_hal_sd.c.
|
static |
DMA SD communication error callback.
| hdma | DMA handle |
| None |
Definition at line 3218 of file stm32l4xx_hal_sd.c.
|
static |
DMA SD receive process complete callback.
| hdma | DMA handle |
| None |
Definition at line 3176 of file stm32l4xx_hal_sd.c.
|
static |
DMA SD Rx Abort callback.
| hdma | DMA handle |
| None |
Definition at line 3297 of file stm32l4xx_hal_sd.c.
|
static |
DMA SD transmit process complete callback.
| hdma | DMA handle |
| None |
Definition at line 3163 of file stm32l4xx_hal_sd.c.
|
static |
DMA SD Tx Abort callback.
| hdma | DMA handle |
| None |
Definition at line 3258 of file stm32l4xx_hal_sd.c.
|
static |
Finds the SD card SCR register value.
| hsd | Pointer to SD handle |
| pSCR | pointer to the buffer that will contain the SCR value |
| error | state |
Definition at line 3852 of file stm32l4xx_hal_sd.c.
| uint32_t SD_HighSpeed | ( | SD_HandleTypeDef * | hsd | ) |
Switches the SD card to High Speed mode. This API must be used after "Transfer State".
| hsd | SD handle |
| SD | Card error state |
Definition at line 4044 of file stm32l4xx_hal_sd.c.
|
static |
Initializes the sd card.
| hsd | Pointer to SD handle |
| SD | Card error state |
Definition at line 3337 of file stm32l4xx_hal_sd.c.
|
static |
Turns the SDMMC output signals off.
| hsd | Pointer to SD handle |
| None |
Definition at line 3602 of file stm32l4xx_hal_sd.c.
|
static |
Enquires cards about their operating voltage and configures clock controls and stores SD information that will be needed in future in the SD handle.
| hsd | Pointer to SD handle |
| error | state |
Definition at line 3431 of file stm32l4xx_hal_sd.c.
|
static |
Wrap up reading in non-blocking mode.
| hsd | pointer to a SD_HandleTypeDef structure that contains the configuration information. |
| None |
Definition at line 3963 of file stm32l4xx_hal_sd.c.
|
static |
Send Status info command.
| hsd | pointer to SD handle |
| pSDstatus | Pointer to the buffer that will contain the SD card status SD Status register) |
| error | state |
Definition at line 3615 of file stm32l4xx_hal_sd.c.
|
static |
Returns the current card's status.
| hsd | Pointer to SD handle |
| pCardStatus | pointer to the buffer that will contain the SD card status (Card Status register) |
| error | state |
Definition at line 3729 of file stm32l4xx_hal_sd.c.
|
static |
Switches the SD card to Ultra High Speed mode. This API must be used after "Transfer State".
| hsd | SD handle |
| SD | Card error state |
Definition at line 4159 of file stm32l4xx_hal_sd.c.
|
static |
Disables the SDMMC wide bus mode.
| hsd | Pointer to SD handle |
| error | state |
Definition at line 3803 of file stm32l4xx_hal_sd.c.
|
static |
Enables the SDMMC wide bus mode.
| hsd | pointer to SD handle |
| error | state |
Definition at line 3756 of file stm32l4xx_hal_sd.c.
|
static |
Wrap up writing in non-blocking mode.
| hsd | pointer to a SD_HandleTypeDef structure that contains the configuration information. |
| None |
Definition at line 4002 of file stm32l4xx_hal_sd.c.
| while | ( | ((sta_reg &(SDMMC_FLAG_CCRCFAIL|SDMMC_FLAG_CMDREND|SDMMC_FLAG_CTIMEOUT))==0U)||((sta_reg &SDMMC_FLAG_CMDACT) !=0U) | ) |
| else |
Definition at line 1305 of file stm32l4xx_ll_sdmmc.c.
| response_r1 = SDMMC_GetResponse(SDMMCx, SDMMC_RESP1) |
Definition at line 1319 of file stm32l4xx_ll_sdmmc.c.