stm32f769i_discovery_sd.h
Go to the documentation of this file.
1 
37 /* Define to prevent recursive inclusion -------------------------------------*/
38 #ifndef __STM32F769I_DISCOVERY_SD_H
39 #define __STM32F769I_DISCOVERY_SD_H
40 
41 #ifdef __cplusplus
42  extern "C" {
43 #endif
44 
45 /* Includes ------------------------------------------------------------------*/
46 #include "stm32f769i_discovery.h"
47 
67 #define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef
68 
75 #define MSD_OK ((uint8_t)0x00)
76 #define MSD_ERROR ((uint8_t)0x01)
77 #define MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02)
78 
82 #define SD_TRANSFER_OK ((uint8_t)0x00)
83 #define SD_TRANSFER_BUSY ((uint8_t)0x01)
84 
88 #define SD_PRESENT ((uint8_t)0x01)
89 #define SD_NOT_PRESENT ((uint8_t)0x00)
90 
91 #define SD_DATATIMEOUT ((uint32_t)100000000)
92 
93 /* DMA definitions for SD DMA transfer */
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)
105 
106 
121 uint8_t BSP_SD_Init(void);
122 uint8_t BSP_SD_DeInit(void);
123 uint8_t BSP_SD_ITConfig(void);
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);
126 uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks);
127 uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks);
128 uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
129 uint8_t BSP_SD_GetCardState(void);
130 void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
131 uint8_t BSP_SD_IsDetected(void);
132 
133 /* These functions can be modified in case the current settings (e.g. DMA stream)
134  need to be changed for specific application needs */
135 void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
136 void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
137 void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
138 void BSP_SD_AbortCallback(void);
139 void BSP_SD_WriteCpltCallback(void);
140 void BSP_SD_ReadCpltCallback(void);
141 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* __STM32F769I_DISCOVERY_SD_H */
163 
164 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
BSP_SD_IsDetected
uint8_t BSP_SD_IsDetected(void)
Detects if SD card is correctly plugged in the memory slot or not.
Definition: stm32f769i_discovery_sd.c:244
BSP_SD_WriteCpltCallback
void BSP_SD_WriteCpltCallback(void)
BSP Tx Transfer completed callbacks.
Definition: stm32f769i_discovery_sd.c:581
BSP_SD_DeInit
uint8_t BSP_SD_DeInit(void)
DeInitializes the SD card device.
Definition: stm32f769i_discovery_sd.c:199
stm32f769i_discovery.h
This file contains definitions for STM32F769I-Discovery LEDs, push-buttons hardware resources.
BSP_SD_MspInit
void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
Initializes the SD MSP.
Definition: stm32f769i_discovery_sd.c:360
BSP_SD_Erase
uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr)
Erases the specified memory area of the given SD card.
Definition: stm32f769i_discovery_sd.c:343
BSP_SD_ITConfig
uint8_t BSP_SD_ITConfig(void)
Configures Interrupt mode for SD detection pin.
Definition: stm32f769i_discovery_sd.c:222
BSP_SD_Detect_MspInit
void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params)
Initializes the SD Detect pin MSP.
Definition: stm32f769i_discovery_sd.c:465
BSP_SD_AbortCallback
void BSP_SD_AbortCallback(void)
BSP SD Abort callbacks.
Definition: stm32f769i_discovery_sd.c:572
BSP_SD_WriteBlocks_DMA
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.
Definition: stm32f769i_discovery_sd.c:324
BSP_SD_ReadBlocks_DMA
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.
Definition: stm32f769i_discovery_sd.c:304
BSP_SD_ReadBlocks
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.
Definition: stm32f769i_discovery_sd.c:265
BSP_SD_ReadCpltCallback
void BSP_SD_ReadCpltCallback(void)
BSP Rx Transfer completed callbacks.
Definition: stm32f769i_discovery_sd.c:590
BSP_SD_MspDeInit
void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
DeInitializes the SD MSP.
Definition: stm32f769i_discovery_sd.c:484
BSP_SD_GetCardState
uint8_t BSP_SD_GetCardState(void)
Gets the current SD card data status.
Definition: stm32f769i_discovery_sd.c:521
BSP_SD_GetCardInfo
void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo)
Get SD information about specific SD card.
Definition: stm32f769i_discovery_sd.c:532
BSP_SD_WriteBlocks
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.
Definition: stm32f769i_discovery_sd.c:285
BSP_SD_Init
uint8_t BSP_SD_Init(void)
Initializes the SD card device.
Definition: stm32f769i_discovery_sd.c:148


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53