Go to the documentation of this file.
38 #ifndef __STM32F769I_DISCOVERY_SD_H
39 #define __STM32F769I_DISCOVERY_SD_H
67 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
75 #define MSD_OK ((uint8_t)0x00)
76 #define MSD_ERROR ((uint8_t)0x01)
77 #define MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)
82 #define SD_TRANSFER_OK ((uint8_t)0x00)
83 #define SD_TRANSFER_BUSY ((uint8_t)0x01)
88 #define SD_PRESENT ((uint8_t)0x01)
89 #define SD_NOT_PRESENT ((uint8_t)0x00)
91 #define SD_DATATIMEOUT ((uint32_t)100000000)
94 #define __DMAx_TxRx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
95 #define SD_DMAx_Tx_CHANNEL DMA_CHANNEL_11
96 #define SD_DMAx_Rx_CHANNEL DMA_CHANNEL_11
97 #define SD_DMAx_Tx_STREAM DMA2_Stream5
98 #define SD_DMAx_Rx_STREAM DMA2_Stream0
99 #define SD_DMAx_Tx_IRQn DMA2_Stream5_IRQn
100 #define SD_DMAx_Rx_IRQn DMA2_Stream0_IRQn
101 #define BSP_SDMMC_IRQHandler SDMMC2_IRQHandler
102 #define BSP_SDMMC_DMA_Tx_IRQHandler DMA2_Stream5_IRQHandler
103 #define BSP_SDMMC_DMA_Rx_IRQHandler DMA2_Stream0_IRQHandler
104 #define SD_DetectIRQHandler() HAL_GPIO_EXTI_IRQHandler(SD_DETECT_PIN)
124 uint8_t
BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout);
125 uint8_t
BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout);
128 uint8_t
BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
uint8_t BSP_SD_IsDetected(void)
Detects if SD card is correctly plugged in the memory slot or not.
void BSP_SD_WriteCpltCallback(void)
BSP Tx Transfer completed callbacks.
uint8_t BSP_SD_DeInit(void)
DeInitializes the SD card device.
This file contains definitions for STM32F769I-Discovery LEDs, push-buttons hardware resources.
void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
uint8_t BSP_SD_ITConfig(void)
Configures Interrupt mode for SD detection pin.
void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin MSP.
void BSP_SD_AbortCallback(void)
BSP SD Abort callbacks.
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_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.
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.
void BSP_SD_ReadCpltCallback(void)
BSP Rx Transfer completed callbacks.
void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
uint8_t BSP_SD_GetCardState(void)
Gets the current SD card data status.
void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
Get SD information about specific SD card.
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_Init(void)
Initializes the SD card device.