29#include "stm32f4xx_hal.h"
36#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
42#define MSD_OK ((uint8_t)0x00)
43#define MSD_ERROR ((uint8_t)0x01)
48#define SD_TRANSFER_OK ((uint8_t)0x00)
49#define SD_TRANSFER_BUSY ((uint8_t)0x01)
51#define SD_PRESENT ((uint8_t)0x01)
52#define SD_NOT_PRESENT ((uint8_t)0x00)
53#define SD_DATATIMEOUT ((uint32_t)100000000)
66void BSP_SD_DetectCallback(
void);
67uint8_t
BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
68uint8_t
BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
71uint8_t
BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
72void BSP_SD_IRQHandler(
void);
73void BSP_SD_DMA_Tx_IRQHandler(
void);
74void BSP_SD_DMA_Rx_IRQHandler(
void);
void BSP_SD_AbortCallback(void)
BSP SD Abort callback.
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.
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.
uint8_t BSP_SD_Init(void)
Initializes the SD card device.
uint8_t BSP_SD_ITConfig(void)
Configures Interrupt mode for SD detection pin.
void BSP_SD_ReadCpltCallback(void)
BSP Rx Transfer completed callback.
void BSP_SD_DetectIT(void)
SD detect IT treatment.
uint8_t BSP_SD_GetCardState(void)
Gets the current SD card data status.
uint8_t BSP_SD_IsDetected(void)
Detects if SD card is correctly plugged in the memory slot or not.
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.
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.
void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
Get SD information about specific SD card.
void BSP_SD_WriteCpltCallback(void)
BSP Tx Transfer completed callback.
uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.