38extern SD_HandleTypeDef
hsd;
56 sd_state = HAL_SD_Init(&
hsd);
61 if (HAL_SD_ConfigWideBusOperation(&
hsd, SDIO_BUS_WIDE_4B) != HAL_OK)
104__weak uint8_t
BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
106 uint8_t sd_state =
MSD_OK;
108 if (HAL_SD_ReadBlocks(&
hsd, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout) != HAL_OK)
110 sd_state = MSD_ERROR;
127__weak uint8_t
BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
129 uint8_t sd_state =
MSD_OK;
131 if (HAL_SD_WriteBlocks(&
hsd, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout) != HAL_OK)
133 sd_state = MSD_ERROR;
151 uint8_t sd_state =
MSD_OK;
154 if (HAL_SD_ReadBlocks_DMA(&
hsd, (uint8_t *)pData, ReadAddr, NumOfBlocks) != HAL_OK)
156 sd_state = MSD_ERROR;
174 uint8_t sd_state =
MSD_OK;
177 if (HAL_SD_WriteBlocks_DMA(&
hsd, (uint8_t *)pData, WriteAddr, NumOfBlocks) != HAL_OK)
179 sd_state = MSD_ERROR;
196 uint8_t sd_state =
MSD_OK;
198 if (HAL_SD_Erase(&
hsd, StartAddr, EndAddr) != HAL_OK)
200 sd_state = MSD_ERROR;
216 return ((HAL_SD_GetCardState(&
hsd) == HAL_SD_CARD_TRANSFER ) ?
SD_TRANSFER_OK : SD_TRANSFER_BUSY);
227 HAL_SD_GetCardInfo(&
hsd, CardInfo);
303 __IO uint8_t status = SD_PRESENT;
305 if (BSP_PlatformIsDetected() == 0x0)
307 status = SD_NOT_PRESENT;
void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
Rx Transfer completed callback.
__weak void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
Get SD information about specific SD card.
__weak void BSP_SD_WriteCpltCallback(void)
BSP Tx Transfer completed callback.
void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)
SD Abort callbacks.
__weak uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Writes block(s) to a specified address in an SD card, in polling mode.
void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
Tx Transfer completed callback.
__weak uint8_t BSP_SD_IsDetected(void)
Detects if SD card is correctly plugged in the memory slot or not.
__weak void BSP_SD_AbortCallback(void)
BSP SD Abort callback.
__weak uint8_t BSP_SD_ITConfig(void)
Configures Interrupt mode for SD detection pin.
__weak uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks)
Reads block(s) from a specified address in an SD card, in DMA mode.
__weak uint8_t BSP_SD_GetCardState(void)
Gets the current SD card data status.
__weak uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
__weak void BSP_SD_ReadCpltCallback(void)
BSP Rx Transfer completed callback.
__weak void BSP_SD_DetectIT(void)
SD detect IT treatment.
__weak uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks)
Writes block(s) to a specified address in an SD card, in DMA mode.
__weak uint8_t BSP_SD_Init(void)
Initializes the SD card device.
__weak uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout)
Reads block(s) from a specified address in an SD card, in polling mode.
This file contains the common defines and functions prototypes for the bsp_driver_sd....
#define MSD_OK
SD status structure definition
#define SD_TRANSFER_OK
SD transfer state definition