You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

798 lines
42 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_sd.h
  4. * @author MCD Application Team
  5. * @brief Header file of SD HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32H7xx_HAL_SD_H
  21. #define STM32H7xx_HAL_SD_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32h7xx_ll_sdmmc.h"
  27. #if defined (DLYB_SDMMC1) || defined (DLYB_SDMMC2) || defined (DLYB_SDMMC3)
  28. #include "stm32h7xx_ll_delayblock.h"
  29. #endif /* (DLYB_SDMMC1) || (DLYB_SDMMC2) */
  30. /** @addtogroup STM32H7xx_HAL_Driver
  31. * @{
  32. */
  33. /** @defgroup SD SD
  34. * @brief SD HAL module driver
  35. * @{
  36. */
  37. /* Exported types ------------------------------------------------------------*/
  38. /** @defgroup SD_Exported_Types SD Exported Types
  39. * @{
  40. */
  41. /** @defgroup SD_Exported_Types_Group1 SD State enumeration structure
  42. * @{
  43. */
  44. typedef enum
  45. {
  46. HAL_SD_STATE_RESET = ((uint32_t)0x00000000U), /*!< SD not yet initialized or disabled */
  47. HAL_SD_STATE_READY = ((uint32_t)0x00000001U), /*!< SD initialized and ready for use */
  48. HAL_SD_STATE_TIMEOUT = ((uint32_t)0x00000002U), /*!< SD Timeout state */
  49. HAL_SD_STATE_BUSY = ((uint32_t)0x00000003U), /*!< SD process ongoing */
  50. HAL_SD_STATE_PROGRAMMING = ((uint32_t)0x00000004U), /*!< SD Programming State */
  51. HAL_SD_STATE_RECEIVING = ((uint32_t)0x00000005U), /*!< SD Receiving State */
  52. HAL_SD_STATE_TRANSFER = ((uint32_t)0x00000006U), /*!< SD Transfert State */
  53. HAL_SD_STATE_ERROR = ((uint32_t)0x0000000FU) /*!< SD is in error state */
  54. }HAL_SD_StateTypeDef;
  55. /**
  56. * @}
  57. */
  58. /** @defgroup SD_Exported_Types_Group2 SD Card State enumeration structure
  59. * @{
  60. */
  61. typedef uint32_t HAL_SD_CardStateTypeDef;
  62. #define HAL_SD_CARD_READY 0x00000001U /*!< Card state is ready */
  63. #define HAL_SD_CARD_IDENTIFICATION 0x00000002U /*!< Card is in identification state */
  64. #define HAL_SD_CARD_STANDBY 0x00000003U /*!< Card is in standby state */
  65. #define HAL_SD_CARD_TRANSFER 0x00000004U /*!< Card is in transfer state */
  66. #define HAL_SD_CARD_SENDING 0x00000005U /*!< Card is sending an operation */
  67. #define HAL_SD_CARD_RECEIVING 0x00000006U /*!< Card is receiving operation information */
  68. #define HAL_SD_CARD_PROGRAMMING 0x00000007U /*!< Card is in programming state */
  69. #define HAL_SD_CARD_DISCONNECTED 0x00000008U /*!< Card is disconnected */
  70. #define HAL_SD_CARD_ERROR 0x000000FFU /*!< Card response Error */
  71. /**
  72. * @}
  73. */
  74. /** @defgroup SD_Exported_Types_Group3 SD Handle Structure definition
  75. * @{
  76. */
  77. #define SD_InitTypeDef SDMMC_InitTypeDef
  78. #define SD_TypeDef SDMMC_TypeDef
  79. /**
  80. * @brief SD Card Information Structure definition
  81. */
  82. typedef struct
  83. {
  84. uint32_t CardType; /*!< Specifies the card Type */
  85. uint32_t CardVersion; /*!< Specifies the card version */
  86. uint32_t Class; /*!< Specifies the class of the card class */
  87. uint32_t RelCardAdd; /*!< Specifies the Relative Card Address */
  88. uint32_t BlockNbr; /*!< Specifies the Card Capacity in blocks */
  89. uint32_t BlockSize; /*!< Specifies one block size in bytes */
  90. uint32_t LogBlockNbr; /*!< Specifies the Card logical Capacity in blocks */
  91. uint32_t LogBlockSize; /*!< Specifies logical block size in bytes */
  92. uint32_t CardSpeed; /*!< Specifies the card Speed */
  93. }HAL_SD_CardInfoTypeDef;
  94. /**
  95. * @brief SD handle Structure definition
  96. */
  97. #if defined (USE_HAL_SD_REGISTER_CALLBACKS) && (USE_HAL_SD_REGISTER_CALLBACKS == 1U)
  98. typedef struct __SD_HandleTypeDef
  99. #else
  100. typedef struct
  101. #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
  102. {
  103. SD_TypeDef *Instance; /*!< SD registers base address */
  104. SD_InitTypeDef Init; /*!< SD required parameters */
  105. HAL_LockTypeDef Lock; /*!< SD locking object */
  106. uint8_t *pTxBuffPtr; /*!< Pointer to SD Tx transfer Buffer */
  107. uint32_t TxXferSize; /*!< SD Tx Transfer size */
  108. uint8_t *pRxBuffPtr; /*!< Pointer to SD Rx transfer Buffer */
  109. uint32_t RxXferSize; /*!< SD Rx Transfer size */
  110. __IO uint32_t Context; /*!< SD transfer context */
  111. __IO HAL_SD_StateTypeDef State; /*!< SD card State */
  112. __IO uint32_t ErrorCode; /*!< SD Card Error codes */
  113. HAL_SD_CardInfoTypeDef SdCard; /*!< SD Card information */
  114. uint32_t CSD[4]; /*!< SD card specific data table */
  115. uint32_t CID[4]; /*!< SD card identification number table */
  116. #if defined (USE_HAL_SD_REGISTER_CALLBACKS) && (USE_HAL_SD_REGISTER_CALLBACKS == 1U)
  117. void (* TxCpltCallback) (struct __SD_HandleTypeDef *hsd);
  118. void (* RxCpltCallback) (struct __SD_HandleTypeDef *hsd);
  119. void (* ErrorCallback) (struct __SD_HandleTypeDef *hsd);
  120. void (* AbortCpltCallback) (struct __SD_HandleTypeDef *hsd);
  121. void (* Read_DMADblBuf0CpltCallback) (struct __SD_HandleTypeDef *hsd);
  122. void (* Read_DMADblBuf1CpltCallback) (struct __SD_HandleTypeDef *hsd);
  123. void (* Write_DMADblBuf0CpltCallback) (struct __SD_HandleTypeDef *hsd);
  124. void (* Write_DMADblBuf1CpltCallback) (struct __SD_HandleTypeDef *hsd);
  125. #if (USE_SD_TRANSCEIVER != 0U)
  126. void (* DriveTransceiver_1_8V_Callback) (FlagStatus status);
  127. #endif /* USE_SD_TRANSCEIVER */
  128. void (* MspInitCallback) (struct __SD_HandleTypeDef *hsd);
  129. void (* MspDeInitCallback) (struct __SD_HandleTypeDef *hsd);
  130. #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
  131. }SD_HandleTypeDef;
  132. /**
  133. * @}
  134. */
  135. /** @defgroup SD_Exported_Types_Group4 Card Specific Data: CSD Register
  136. * @{
  137. */
  138. typedef struct
  139. {
  140. __IO uint8_t CSDStruct; /*!< CSD structure */
  141. __IO uint8_t SysSpecVersion; /*!< System specification version */
  142. __IO uint8_t Reserved1; /*!< Reserved */
  143. __IO uint8_t TAAC; /*!< Data read access time 1 */
  144. __IO uint8_t NSAC; /*!< Data read access time 2 in CLK cycles */
  145. __IO uint8_t MaxBusClkFrec; /*!< Max. bus clock frequency */
  146. __IO uint16_t CardComdClasses; /*!< Card command classes */
  147. __IO uint8_t RdBlockLen; /*!< Max. read data block length */
  148. __IO uint8_t PartBlockRead; /*!< Partial blocks for read allowed */
  149. __IO uint8_t WrBlockMisalign; /*!< Write block misalignment */
  150. __IO uint8_t RdBlockMisalign; /*!< Read block misalignment */
  151. __IO uint8_t DSRImpl; /*!< DSR implemented */
  152. __IO uint8_t Reserved2; /*!< Reserved */
  153. __IO uint32_t DeviceSize; /*!< Device Size */
  154. __IO uint8_t MaxRdCurrentVDDMin; /*!< Max. read current @ VDD min */
  155. __IO uint8_t MaxRdCurrentVDDMax; /*!< Max. read current @ VDD max */
  156. __IO uint8_t MaxWrCurrentVDDMin; /*!< Max. write current @ VDD min */
  157. __IO uint8_t MaxWrCurrentVDDMax; /*!< Max. write current @ VDD max */
  158. __IO uint8_t DeviceSizeMul; /*!< Device size multiplier */
  159. __IO uint8_t EraseGrSize; /*!< Erase group size */
  160. __IO uint8_t EraseGrMul; /*!< Erase group size multiplier */
  161. __IO uint8_t WrProtectGrSize; /*!< Write protect group size */
  162. __IO uint8_t WrProtectGrEnable; /*!< Write protect group enable */
  163. __IO uint8_t ManDeflECC; /*!< Manufacturer default ECC */
  164. __IO uint8_t WrSpeedFact; /*!< Write speed factor */
  165. __IO uint8_t MaxWrBlockLen; /*!< Max. write data block length */
  166. __IO uint8_t WriteBlockPaPartial; /*!< Partial blocks for write allowed */
  167. __IO uint8_t Reserved3; /*!< Reserved */
  168. __IO uint8_t ContentProtectAppli; /*!< Content protection application */
  169. __IO uint8_t FileFormatGroup; /*!< File format group */
  170. __IO uint8_t CopyFlag; /*!< Copy flag (OTP) */
  171. __IO uint8_t PermWrProtect; /*!< Permanent write protection */
  172. __IO uint8_t TempWrProtect; /*!< Temporary write protection */
  173. __IO uint8_t FileFormat; /*!< File format */
  174. __IO uint8_t ECC; /*!< ECC code */
  175. __IO uint8_t CSD_CRC; /*!< CSD CRC */
  176. __IO uint8_t Reserved4; /*!< Always 1 */
  177. }HAL_SD_CardCSDTypeDef;
  178. /**
  179. * @}
  180. */
  181. /** @defgroup SD_Exported_Types_Group5 Card Identification Data: CID Register
  182. * @{
  183. */
  184. typedef struct
  185. {
  186. __IO uint8_t ManufacturerID; /*!< Manufacturer ID */
  187. __IO uint16_t OEM_AppliID; /*!< OEM/Application ID */
  188. __IO uint32_t ProdName1; /*!< Product Name part1 */
  189. __IO uint8_t ProdName2; /*!< Product Name part2 */
  190. __IO uint8_t ProdRev; /*!< Product Revision */
  191. __IO uint32_t ProdSN; /*!< Product Serial Number */
  192. __IO uint8_t Reserved1; /*!< Reserved1 */
  193. __IO uint16_t ManufactDate; /*!< Manufacturing Date */
  194. __IO uint8_t CID_CRC; /*!< CID CRC */
  195. __IO uint8_t Reserved2; /*!< Always 1 */
  196. }HAL_SD_CardCIDTypeDef;
  197. /**
  198. * @}
  199. */
  200. /** @defgroup SD_Exported_Types_Group6 SD Card Status returned by ACMD13
  201. * @{
  202. */
  203. typedef struct
  204. {
  205. __IO uint8_t DataBusWidth; /*!< Shows the currently defined data bus width */
  206. __IO uint8_t SecuredMode; /*!< Card is in secured mode of operation */
  207. __IO uint16_t CardType; /*!< Carries information about card type */
  208. __IO uint32_t ProtectedAreaSize; /*!< Carries information about the capacity of protected area */
  209. __IO uint8_t SpeedClass; /*!< Carries information about the speed class of the card */
  210. __IO uint8_t PerformanceMove; /*!< Carries information about the card's performance move */
  211. __IO uint8_t AllocationUnitSize; /*!< Carries information about the card's allocation unit size */
  212. __IO uint16_t EraseSize; /*!< Determines the number of AUs to be erased in one operation */
  213. __IO uint8_t EraseTimeout; /*!< Determines the timeout for any number of AU erase */
  214. __IO uint8_t EraseOffset; /*!< Carries information about the erase offset */
  215. __IO uint8_t UhsSpeedGrade; /*!< Carries information about the speed grade of UHS card */
  216. __IO uint8_t UhsAllocationUnitSize; /*!< Carries information about the UHS card's allocation unit size */
  217. __IO uint8_t VideoSpeedClass; /*!< Carries information about the Video Speed Class of UHS card */
  218. }HAL_SD_CardStatusTypeDef;
  219. /**
  220. * @}
  221. */
  222. #if defined (USE_HAL_SD_REGISTER_CALLBACKS) && (USE_HAL_SD_REGISTER_CALLBACKS == 1U)
  223. /** @defgroup SD_Exported_Types_Group7 SD Callback ID enumeration definition
  224. * @{
  225. */
  226. typedef enum
  227. {
  228. HAL_SD_TX_CPLT_CB_ID = 0x00U, /*!< SD Tx Complete Callback ID */
  229. HAL_SD_RX_CPLT_CB_ID = 0x01U, /*!< SD Rx Complete Callback ID */
  230. HAL_SD_ERROR_CB_ID = 0x02U, /*!< SD Error Callback ID */
  231. HAL_SD_ABORT_CB_ID = 0x03U, /*!< SD Abort Callback ID */
  232. HAL_SD_READ_DMA_DBL_BUF0_CPLT_CB_ID = 0x04U, /*!< SD Rx DMA Double Buffer 0 Complete Callback ID */
  233. HAL_SD_READ_DMA_DBL_BUF1_CPLT_CB_ID = 0x05U, /*!< SD Rx DMA Double Buffer 1 Complete Callback ID */
  234. HAL_SD_WRITE_DMA_DBL_BUF0_CPLT_CB_ID = 0x06U, /*!< SD Tx DMA Double Buffer 0 Complete Callback ID */
  235. HAL_SD_WRITE_DMA_DBL_BUF1_CPLT_CB_ID = 0x07U, /*!< SD Tx DMA Double Buffer 1 Complete Callback ID */
  236. HAL_SD_MSP_INIT_CB_ID = 0x10U, /*!< SD MspInit Callback ID */
  237. HAL_SD_MSP_DEINIT_CB_ID = 0x11U /*!< SD MspDeInit Callback ID */
  238. }HAL_SD_CallbackIDTypeDef;
  239. /**
  240. * @}
  241. */
  242. /** @defgroup SD_Exported_Types_Group8 SD Callback pointer definition
  243. * @{
  244. */
  245. typedef void (*pSD_CallbackTypeDef) (SD_HandleTypeDef *hsd);
  246. #if (USE_SD_TRANSCEIVER != 0U)
  247. typedef void (*pSD_TransceiverCallbackTypeDef)(FlagStatus status);
  248. #endif /* USE_SD_TRANSCEIVER */
  249. /**
  250. * @}
  251. */
  252. #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
  253. /**
  254. * @}
  255. */
  256. /* Exported constants --------------------------------------------------------*/
  257. /** @defgroup SD_Exported_Constants Exported Constants
  258. * @{
  259. */
  260. #define BLOCKSIZE ((uint32_t)512U) /*!< Block size is 512 bytes */
  261. /** @defgroup SD_Exported_Constansts_Group1 SD Error status enumeration Structure definition
  262. * @{
  263. */
  264. #define HAL_SD_ERROR_NONE SDMMC_ERROR_NONE /*!< No error */
  265. #define HAL_SD_ERROR_CMD_CRC_FAIL SDMMC_ERROR_CMD_CRC_FAIL /*!< Command response received (but CRC check failed) */
  266. #define HAL_SD_ERROR_DATA_CRC_FAIL SDMMC_ERROR_DATA_CRC_FAIL /*!< Data block sent/received (CRC check failed) */
  267. #define HAL_SD_ERROR_CMD_RSP_TIMEOUT SDMMC_ERROR_CMD_RSP_TIMEOUT /*!< Command response timeout */
  268. #define HAL_SD_ERROR_DATA_TIMEOUT SDMMC_ERROR_DATA_TIMEOUT /*!< Data timeout */
  269. #define HAL_SD_ERROR_TX_UNDERRUN SDMMC_ERROR_TX_UNDERRUN /*!< Transmit FIFO underrun */
  270. #define HAL_SD_ERROR_RX_OVERRUN SDMMC_ERROR_RX_OVERRUN /*!< Receive FIFO overrun */
  271. #define HAL_SD_ERROR_ADDR_MISALIGNED SDMMC_ERROR_ADDR_MISALIGNED /*!< Misaligned address */
  272. #define HAL_SD_ERROR_BLOCK_LEN_ERR SDMMC_ERROR_BLOCK_LEN_ERR /*!< Transferred block length is not allowed for the card or the
  273. number of transferred bytes does not match the block length */
  274. #define HAL_SD_ERROR_ERASE_SEQ_ERR SDMMC_ERROR_ERASE_SEQ_ERR /*!< An error in the sequence of erase command occurs */
  275. #define HAL_SD_ERROR_BAD_ERASE_PARAM SDMMC_ERROR_BAD_ERASE_PARAM /*!< An invalid selection for erase groups */
  276. #define HAL_SD_ERROR_WRITE_PROT_VIOLATION SDMMC_ERROR_WRITE_PROT_VIOLATION /*!< Attempt to program a write protect block */
  277. #define HAL_SD_ERROR_LOCK_UNLOCK_FAILED SDMMC_ERROR_LOCK_UNLOCK_FAILED /*!< Sequence or password error has been detected in unlock
  278. command or if there was an attempt to access a locked card */
  279. #define HAL_SD_ERROR_COM_CRC_FAILED SDMMC_ERROR_COM_CRC_FAILED /*!< CRC check of the previous command failed */
  280. #define HAL_SD_ERROR_ILLEGAL_CMD SDMMC_ERROR_ILLEGAL_CMD /*!< Command is not legal for the card state */
  281. #define HAL_SD_ERROR_CARD_ECC_FAILED SDMMC_ERROR_CARD_ECC_FAILED /*!< Card internal ECC was applied but failed to correct the data */
  282. #define HAL_SD_ERROR_CC_ERR SDMMC_ERROR_CC_ERR /*!< Internal card controller error */
  283. #define HAL_SD_ERROR_GENERAL_UNKNOWN_ERR SDMMC_ERROR_GENERAL_UNKNOWN_ERR /*!< General or unknown error */
  284. #define HAL_SD_ERROR_STREAM_READ_UNDERRUN SDMMC_ERROR_STREAM_READ_UNDERRUN /*!< The card could not sustain data reading in stream rmode */
  285. #define HAL_SD_ERROR_STREAM_WRITE_OVERRUN SDMMC_ERROR_STREAM_WRITE_OVERRUN /*!< The card could not sustain data programming in stream mode */
  286. #define HAL_SD_ERROR_CID_CSD_OVERWRITE SDMMC_ERROR_CID_CSD_OVERWRITE /*!< CID/CSD overwrite error */
  287. #define HAL_SD_ERROR_WP_ERASE_SKIP SDMMC_ERROR_WP_ERASE_SKIP /*!< Only partial address space was erased */
  288. #define HAL_SD_ERROR_CARD_ECC_DISABLED SDMMC_ERROR_CARD_ECC_DISABLED /*!< Command has been executed without using internal ECC */
  289. #define HAL_SD_ERROR_ERASE_RESET SDMMC_ERROR_ERASE_RESET /*!< Erase sequence was cleared before executing because an out
  290. of erase sequence command was received */
  291. #define HAL_SD_ERROR_AKE_SEQ_ERR SDMMC_ERROR_AKE_SEQ_ERR /*!< Error in sequence of authentication */
  292. #define HAL_SD_ERROR_INVALID_VOLTRANGE SDMMC_ERROR_INVALID_VOLTRANGE /*!< Error in case of invalid voltage range */
  293. #define HAL_SD_ERROR_ADDR_OUT_OF_RANGE SDMMC_ERROR_ADDR_OUT_OF_RANGE /*!< Error when addressed block is out of range */
  294. #define HAL_SD_ERROR_REQUEST_NOT_APPLICABLE SDMMC_ERROR_REQUEST_NOT_APPLICABLE /*!< Error when command request is not applicable */
  295. #define HAL_SD_ERROR_PARAM SDMMC_ERROR_INVALID_PARAMETER /*!< the used parameter is not valid */
  296. #define HAL_SD_ERROR_UNSUPPORTED_FEATURE SDMMC_ERROR_UNSUPPORTED_FEATURE /*!< Error when feature is not insupported */
  297. #define HAL_SD_ERROR_BUSY SDMMC_ERROR_BUSY /*!< Error when transfer process is busy */
  298. #define HAL_SD_ERROR_DMA SDMMC_ERROR_DMA /*!< Error while DMA transfer */
  299. #define HAL_SD_ERROR_TIMEOUT SDMMC_ERROR_TIMEOUT /*!< Timeout error */
  300. #if defined (USE_HAL_SD_REGISTER_CALLBACKS) && (USE_HAL_SD_REGISTER_CALLBACKS == 1U)
  301. #define HAL_SD_ERROR_INVALID_CALLBACK SDMMC_ERROR_INVALID_PARAMETER /*!< Invalid callback error */
  302. #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
  303. /**
  304. * @}
  305. */
  306. /** @defgroup SD_Exported_Constansts_Group2 SD context enumeration
  307. * @{
  308. */
  309. #define SD_CONTEXT_NONE ((uint32_t)0x00000000U) /*!< None */
  310. #define SD_CONTEXT_READ_SINGLE_BLOCK ((uint32_t)0x00000001U) /*!< Read single block operation */
  311. #define SD_CONTEXT_READ_MULTIPLE_BLOCK ((uint32_t)0x00000002U) /*!< Read multiple blocks operation */
  312. #define SD_CONTEXT_WRITE_SINGLE_BLOCK ((uint32_t)0x00000010U) /*!< Write single block operation */
  313. #define SD_CONTEXT_WRITE_MULTIPLE_BLOCK ((uint32_t)0x00000020U) /*!< Write multiple blocks operation */
  314. #define SD_CONTEXT_IT ((uint32_t)0x00000008U) /*!< Process in Interrupt mode */
  315. #define SD_CONTEXT_DMA ((uint32_t)0x00000080U) /*!< Process in DMA mode */
  316. /**
  317. * @}
  318. */
  319. /** @defgroup SD_Exported_Constansts_Group3 SD Supported Memory Cards
  320. * @{
  321. */
  322. #define CARD_NORMAL_SPEED ((uint32_t)0x00000000U) /*!< Normal Speed Card <12.5Mo/s , Spec Version 1.01 */
  323. #define CARD_HIGH_SPEED ((uint32_t)0x00000100U) /*!< High Speed Card <25Mo/s , Spec version 2.00 */
  324. #define CARD_ULTRA_HIGH_SPEED ((uint32_t)0x00000200U) /*!< UHS-I SD Card <50Mo/s for SDR50, DDR5 Cards
  325. and <104Mo/s for SDR104, Spec version 3.01 */
  326. #define CARD_SDSC ((uint32_t)0x00000000U) /*!< SD Standard Capacity <2Go */
  327. #define CARD_SDHC_SDXC ((uint32_t)0x00000001U) /*!< SD High Capacity <32Go, SD Extended Capacity <2To */
  328. #define CARD_SECURED ((uint32_t)0x00000003U)
  329. /**
  330. * @}
  331. */
  332. /** @defgroup SD_Exported_Constansts_Group4 SD Supported Version
  333. * @{
  334. */
  335. #define CARD_V1_X ((uint32_t)0x00000000U)
  336. #define CARD_V2_X ((uint32_t)0x00000001U)
  337. /**
  338. * @}
  339. */
  340. /**
  341. * @}
  342. */
  343. /* Exported macro ------------------------------------------------------------*/
  344. /** @defgroup SD_Exported_macros SD Exported Macros
  345. * @brief macros to handle interrupts and specific clock configurations
  346. * @{
  347. */
  348. /** @brief Reset SD handle state.
  349. * @param __HANDLE__ SD Handle.
  350. * @retval None
  351. */
  352. #if defined (USE_HAL_SD_REGISTER_CALLBACKS) && (USE_HAL_SD_REGISTER_CALLBACKS == 1U)
  353. #define __HAL_SD_RESET_HANDLE_STATE(__HANDLE__) do { \
  354. (__HANDLE__)->State = HAL_SD_STATE_RESET; \
  355. (__HANDLE__)->MspInitCallback = NULL; \
  356. (__HANDLE__)->MspDeInitCallback = NULL; \
  357. } while(0)
  358. #else
  359. #define __HAL_SD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SD_STATE_RESET)
  360. #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
  361. /**
  362. * @brief Enable the SD device interrupt.
  363. * @param __HANDLE__ SD Handle.
  364. * @param __INTERRUPT__ specifies the SDMMC interrupt sources to be enabled.
  365. * This parameter can be one or a combination of the following values:
  366. * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  367. * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  368. * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt
  369. * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt
  370. * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  371. * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt
  372. * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt
  373. * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt
  374. * @arg SDMMC_IT_DATAEND: Data end (data counter, DATACOUNT, is zero) interrupt
  375. * @arg SDMMC_IT_DHOLD: Data transfer Hold interrupt
  376. * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  377. * @arg SDMMC_IT_DABORT: Data transfer aborted by CMD12 interrupt
  378. * @arg SDMMC_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
  379. * @arg SDMMC_IT_RXFIFOHF: Receive FIFO Half Full interrupt
  380. * @arg SDMMC_IT_RXFIFOF: Receive FIFO full interrupt
  381. * @arg SDMMC_IT_TXFIFOE: Transmit FIFO empty interrupt
  382. * @arg SDMMC_IT_BUSYD0END: End of SDMMC_D0 Busy following a CMD response detected interrupt
  383. * @arg SDMMC_IT_SDIOIT: SDIO interrupt received interrupt
  384. * @arg SDMMC_IT_ACKFAIL: Boot Acknowledgment received interrupt
  385. * @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
  386. * @arg SDMMC_IT_VSWEND: Voltage switch critical timing section completion interrupt
  387. * @arg SDMMC_IT_CKSTOP: SDMMC_CK stopped in Voltage switch procedure interrupt
  388. * @arg SDMMC_IT_IDMABTC: IDMA buffer transfer complete interrupt
  389. * @retval None
  390. */
  391. #define __HAL_SD_ENABLE_IT(__HANDLE__, __INTERRUPT__) __SDMMC_ENABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
  392. /**
  393. * @brief Disable the SD device interrupt.
  394. * @param __HANDLE__ SD Handle.
  395. * @param __INTERRUPT__ specifies the SDMMC interrupt sources to be disabled.
  396. * This parameter can be one or a combination of the following values:
  397. * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  398. * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  399. * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt
  400. * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt
  401. * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  402. * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt
  403. * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt
  404. * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt
  405. * @arg SDMMC_IT_DATAEND: Data end (data counter, DATACOUNT, is zero) interrupt
  406. * @arg SDMMC_IT_DHOLD: Data transfer Hold interrupt
  407. * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  408. * @arg SDMMC_IT_DABORT: Data transfer aborted by CMD12 interrupt
  409. * @arg SDMMC_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
  410. * @arg SDMMC_IT_RXFIFOHF: Receive FIFO Half Full interrupt
  411. * @arg SDMMC_IT_RXFIFOF: Receive FIFO full interrupt
  412. * @arg SDMMC_IT_TXFIFOE: Transmit FIFO empty interrupt
  413. * @arg SDMMC_IT_BUSYD0END: End of SDMMC_D0 Busy following a CMD response detected interrupt
  414. * @arg SDMMC_IT_SDIOIT: SDIO interrupt received interrupt
  415. * @arg SDMMC_IT_ACKFAIL: Boot Acknowledgment received interrupt
  416. * @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
  417. * @arg SDMMC_IT_VSWEND: Voltage switch critical timing section completion interrupt
  418. * @arg SDMMC_IT_CKSTOP: SDMMC_CK stopped in Voltage switch procedure interrupt
  419. * @arg SDMMC_IT_IDMABTC: IDMA buffer transfer complete interrupt
  420. * @retval None
  421. */
  422. #define __HAL_SD_DISABLE_IT(__HANDLE__, __INTERRUPT__) __SDMMC_DISABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
  423. /**
  424. * @brief Check whether the specified SD flag is set or not.
  425. * @param __HANDLE__ SD Handle.
  426. * @param __FLAG__ specifies the flag to check.
  427. * This parameter can be one of the following values:
  428. * @arg SDMMC_FLAG_CCRCFAIL: Command response received (CRC check failed)
  429. * @arg SDMMC_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
  430. * @arg SDMMC_FLAG_CTIMEOUT: Command response timeout
  431. * @arg SDMMC_FLAG_DTIMEOUT: Data timeout
  432. * @arg SDMMC_FLAG_TXUNDERR: Transmit FIFO underrun error
  433. * @arg SDMMC_FLAG_RXOVERR: Received FIFO overrun error
  434. * @arg SDMMC_FLAG_CMDREND: Command response received (CRC check passed)
  435. * @arg SDMMC_FLAG_CMDSENT: Command sent (no response required)
  436. * @arg SDMMC_FLAG_DATAEND: Data end (data counter, DATACOUNT, is zero)
  437. * @arg SDMMC_FLAG_DHOLD: Data transfer Hold
  438. * @arg SDMMC_FLAG_DBCKEND: Data block sent/received (CRC check passed)
  439. * @arg SDMMC_FLAG_DABORT: Data transfer aborted by CMD12
  440. * @arg SDMMC_FLAG_DPSMACT: Data path state machine active
  441. * @arg SDMMC_FLAG_CPSMACT: Command path state machine active
  442. * @arg SDMMC_FLAG_TXFIFOHE: Transmit FIFO Half Empty
  443. * @arg SDMMC_FLAG_RXFIFOHF: Receive FIFO Half Full
  444. * @arg SDMMC_FLAG_TXFIFOF: Transmit FIFO full
  445. * @arg SDMMC_FLAG_RXFIFOF: Receive FIFO full
  446. * @arg SDMMC_FLAG_TXFIFOE: Transmit FIFO empty
  447. * @arg SDMMC_FLAG_RXFIFOE: Receive FIFO empty
  448. * @arg SDMMC_FLAG_BUSYD0: Inverted value of SDMMC_D0 line (Busy)
  449. * @arg SDMMC_FLAG_BUSYD0END: End of SDMMC_D0 Busy following a CMD response detected
  450. * @arg SDMMC_FLAG_SDIOIT: SDIO interrupt received
  451. * @arg SDMMC_FLAG_ACKFAIL: Boot Acknowledgment received
  452. * @arg SDMMC_FLAG_ACKTIMEOUT: Boot Acknowledgment timeout
  453. * @arg SDMMC_FLAG_VSWEND: Voltage switch critical timing section completion
  454. * @arg SDMMC_FLAG_CKSTOP: SDMMC_CK stopped in Voltage switch procedure
  455. * @arg SDMMC_FLAG_IDMATE: IDMA transfer error
  456. * @arg SDMMC_FLAG_IDMABTC: IDMA buffer transfer complete
  457. * @retval The new state of SD FLAG (SET or RESET).
  458. */
  459. #define __HAL_SD_GET_FLAG(__HANDLE__, __FLAG__) __SDMMC_GET_FLAG((__HANDLE__)->Instance, (__FLAG__))
  460. /**
  461. * @brief Clear the SD's pending flags.
  462. * @param __HANDLE__ SD Handle.
  463. * @param __FLAG__ specifies the flag to clear.
  464. * This parameter can be one or a combination of the following values:
  465. * @arg SDMMC_FLAG_CCRCFAIL: Command response received (CRC check failed)
  466. * @arg SDMMC_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
  467. * @arg SDMMC_FLAG_CTIMEOUT: Command response timeout
  468. * @arg SDMMC_FLAG_DTIMEOUT: Data timeout
  469. * @arg SDMMC_FLAG_TXUNDERR: Transmit FIFO underrun error
  470. * @arg SDMMC_FLAG_RXOVERR: Received FIFO overrun error
  471. * @arg SDMMC_FLAG_CMDREND: Command response received (CRC check passed)
  472. * @arg SDMMC_FLAG_CMDSENT: Command sent (no response required)
  473. * @arg SDMMC_FLAG_DATAEND: Data end (data counter, DATACOUNT, is zero)
  474. * @arg SDMMC_FLAG_DHOLD: Data transfer Hold
  475. * @arg SDMMC_FLAG_DBCKEND: Data block sent/received (CRC check passed)
  476. * @arg SDMMC_FLAG_DABORT: Data transfer aborted by CMD12
  477. * @arg SDMMC_FLAG_BUSYD0END: End of SDMMC_D0 Busy following a CMD response detected
  478. * @arg SDMMC_FLAG_SDIOIT: SDIO interrupt received
  479. * @arg SDMMC_FLAG_ACKFAIL: Boot Acknowledgment received
  480. * @arg SDMMC_FLAG_ACKTIMEOUT: Boot Acknowledgment timeout
  481. * @arg SDMMC_FLAG_VSWEND: Voltage switch critical timing section completion
  482. * @arg SDMMC_FLAG_CKSTOP: SDMMC_CK stopped in Voltage switch procedure
  483. * @arg SDMMC_FLAG_IDMATE: IDMA transfer error
  484. * @arg SDMMC_FLAG_IDMABTC: IDMA buffer transfer complete
  485. * @retval None
  486. */
  487. #define __HAL_SD_CLEAR_FLAG(__HANDLE__, __FLAG__) __SDMMC_CLEAR_FLAG((__HANDLE__)->Instance, (__FLAG__))
  488. /**
  489. * @brief Check whether the specified SD interrupt has occurred or not.
  490. * @param __HANDLE__ SD Handle.
  491. * @param __INTERRUPT__ specifies the SDMMC interrupt source to check.
  492. * This parameter can be one of the following values:
  493. * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  494. * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  495. * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt
  496. * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt
  497. * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  498. * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt
  499. * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt
  500. * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt
  501. * @arg SDMMC_IT_DATAEND: Data end (data counter, DATACOUNT, is zero) interrupt
  502. * @arg SDMMC_IT_DHOLD: Data transfer Hold interrupt
  503. * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  504. * @arg SDMMC_IT_DABORT: Data transfer aborted by CMD12 interrupt
  505. * @arg SDMMC_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
  506. * @arg SDMMC_IT_RXFIFOHF: Receive FIFO Half Full interrupt
  507. * @arg SDMMC_IT_RXFIFOF: Receive FIFO full interrupt
  508. * @arg SDMMC_IT_TXFIFOE: Transmit FIFO empty interrupt
  509. * @arg SDMMC_IT_BUSYD0END: End of SDMMC_D0 Busy following a CMD response detected interrupt
  510. * @arg SDMMC_IT_SDIOIT: SDIO interrupt received interrupt
  511. * @arg SDMMC_IT_ACKFAIL: Boot Acknowledgment received interrupt
  512. * @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
  513. * @arg SDMMC_IT_VSWEND: Voltage switch critical timing section completion interrupt
  514. * @arg SDMMC_IT_CKSTOP: SDMMC_CK stopped in Voltage switch procedure interrupt
  515. * @arg SDMMC_IT_IDMABTC: IDMA buffer transfer complete interrupt
  516. * @retval The new state of SD IT (SET or RESET).
  517. */
  518. #define __HAL_SD_GET_IT(__HANDLE__, __INTERRUPT__) __SDMMC_GET_IT((__HANDLE__)->Instance, (__INTERRUPT__))
  519. /**
  520. * @brief Clear the SD's interrupt pending bits.
  521. * @param __HANDLE__ SD Handle.
  522. * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
  523. * This parameter can be one or a combination of the following values:
  524. * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  525. * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  526. * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt
  527. * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt
  528. * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  529. * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt
  530. * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt
  531. * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt
  532. * @arg SDMMC_IT_DATAEND: Data end (data counter, DATACOUNT, is zero) interrupt
  533. * @arg SDMMC_IT_DHOLD: Data transfer Hold interrupt
  534. * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  535. * @arg SDMMC_IT_DABORT: Data transfer aborted by CMD12 interrupt
  536. * @arg SDMMC_IT_BUSYD0END: End of SDMMC_D0 Busy following a CMD response detected interrupt
  537. * @arg SDMMC_IT_SDIOIT: SDIO interrupt received interrupt
  538. * @arg SDMMC_IT_ACKFAIL: Boot Acknowledgment received interrupt
  539. * @arg SDMMC_IT_ACKTIMEOUT: Boot Acknowledgment timeout interrupt
  540. * @arg SDMMC_IT_VSWEND: Voltage switch critical timing section completion interrupt
  541. * @arg SDMMC_IT_CKSTOP: SDMMC_CK stopped in Voltage switch procedure interrupt
  542. * @arg SDMMC_IT_IDMABTC: IDMA buffer transfer complete interrupt
  543. * @retval None
  544. */
  545. #define __HAL_SD_CLEAR_IT(__HANDLE__, __INTERRUPT__) __SDMMC_CLEAR_IT((__HANDLE__)->Instance, (__INTERRUPT__))
  546. /**
  547. * @}
  548. */
  549. /* Include SD HAL Extension module */
  550. #include "stm32h7xx_hal_sd_ex.h"
  551. /* Exported functions --------------------------------------------------------*/
  552. /** @defgroup SD_Exported_Functions SD Exported Functions
  553. * @{
  554. */
  555. /** @defgroup SD_Exported_Functions_Group1 Initialization and de-initialization functions
  556. * @{
  557. */
  558. HAL_StatusTypeDef HAL_SD_Init (SD_HandleTypeDef *hsd);
  559. HAL_StatusTypeDef HAL_SD_InitCard (SD_HandleTypeDef *hsd);
  560. HAL_StatusTypeDef HAL_SD_DeInit (SD_HandleTypeDef *hsd);
  561. void HAL_SD_MspInit (SD_HandleTypeDef *hsd);
  562. void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd);
  563. /**
  564. * @}
  565. */
  566. /** @defgroup SD_Exported_Functions_Group2 Input and Output operation functions
  567. * @{
  568. */
  569. /* Blocking mode: Polling */
  570. HAL_StatusTypeDef HAL_SD_ReadBlocks (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks, uint32_t Timeout);
  571. HAL_StatusTypeDef HAL_SD_WriteBlocks (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks, uint32_t Timeout);
  572. HAL_StatusTypeDef HAL_SD_Erase (SD_HandleTypeDef *hsd, uint32_t BlockStartAdd, uint32_t BlockEndAdd);
  573. /* Non-Blocking mode: IT */
  574. HAL_StatusTypeDef HAL_SD_ReadBlocks_IT (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks);
  575. HAL_StatusTypeDef HAL_SD_WriteBlocks_IT (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks);
  576. /* Non-Blocking mode: DMA */
  577. HAL_StatusTypeDef HAL_SD_ReadBlocks_DMA (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks);
  578. HAL_StatusTypeDef HAL_SD_WriteBlocks_DMA(SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks);
  579. void HAL_SD_IRQHandler (SD_HandleTypeDef *hsd);
  580. /* Callback in non blocking modes (DMA) */
  581. void HAL_SD_TxCpltCallback (SD_HandleTypeDef *hsd);
  582. void HAL_SD_RxCpltCallback (SD_HandleTypeDef *hsd);
  583. void HAL_SD_ErrorCallback (SD_HandleTypeDef *hsd);
  584. void HAL_SD_AbortCallback (SD_HandleTypeDef *hsd);
  585. #if (USE_SD_TRANSCEIVER != 0U)
  586. /* Callback to switch in 1.8V mode */
  587. void HAL_SD_DriveTransceiver_1_8V_Callback(FlagStatus status);
  588. #endif /* USE_SD_TRANSCEIVER */
  589. #if defined (USE_HAL_SD_REGISTER_CALLBACKS) && (USE_HAL_SD_REGISTER_CALLBACKS == 1U)
  590. /* SD callback registering/unregistering */
  591. HAL_StatusTypeDef HAL_SD_RegisterCallback (SD_HandleTypeDef *hsd, HAL_SD_CallbackIDTypeDef CallbackID, pSD_CallbackTypeDef pCallback);
  592. HAL_StatusTypeDef HAL_SD_UnRegisterCallback(SD_HandleTypeDef *hsd, HAL_SD_CallbackIDTypeDef CallbackID);
  593. #if (USE_SD_TRANSCEIVER != 0U)
  594. HAL_StatusTypeDef HAL_SD_RegisterTransceiverCallback (SD_HandleTypeDef *hsd, pSD_TransceiverCallbackTypeDef pCallback);
  595. HAL_StatusTypeDef HAL_SD_UnRegisterTransceiverCallback(SD_HandleTypeDef *hsd);
  596. #endif /* USE_SD_TRANSCEIVER */
  597. #endif /* USE_HAL_SD_REGISTER_CALLBACKS */
  598. /**
  599. * @}
  600. */
  601. /** @defgroup SD_Exported_Functions_Group3 Peripheral Control functions
  602. * @{
  603. */
  604. HAL_StatusTypeDef HAL_SD_ConfigWideBusOperation(SD_HandleTypeDef *hsd, uint32_t WideMode);
  605. HAL_StatusTypeDef HAL_SD_ConfigSpeedBusOperation(SD_HandleTypeDef *hsd, uint32_t SpeedMode);
  606. /**
  607. * @}
  608. */
  609. /** @defgroup SD_Exported_Functions_Group4 SD card related functions
  610. * @{
  611. */
  612. HAL_SD_CardStateTypeDef HAL_SD_GetCardState(SD_HandleTypeDef *hsd);
  613. HAL_StatusTypeDef HAL_SD_GetCardCID (SD_HandleTypeDef *hsd, HAL_SD_CardCIDTypeDef *pCID);
  614. HAL_StatusTypeDef HAL_SD_GetCardCSD (SD_HandleTypeDef *hsd, HAL_SD_CardCSDTypeDef *pCSD);
  615. HAL_StatusTypeDef HAL_SD_GetCardStatus(SD_HandleTypeDef *hsd, HAL_SD_CardStatusTypeDef *pStatus);
  616. HAL_StatusTypeDef HAL_SD_GetCardInfo (SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypeDef *pCardInfo);
  617. /**
  618. * @}
  619. */
  620. /** @defgroup SD_Exported_Functions_Group5 Peripheral State and Errors functions
  621. * @{
  622. */
  623. HAL_SD_StateTypeDef HAL_SD_GetState(SD_HandleTypeDef *hsd);
  624. uint32_t HAL_SD_GetError(SD_HandleTypeDef *hsd);
  625. /**
  626. * @}
  627. */
  628. /** @defgroup SD_Exported_Functions_Group6 Perioheral Abort management
  629. * @{
  630. */
  631. HAL_StatusTypeDef HAL_SD_Abort (SD_HandleTypeDef *hsd);
  632. HAL_StatusTypeDef HAL_SD_Abort_IT(SD_HandleTypeDef *hsd);
  633. /**
  634. * @}
  635. */
  636. /* Private types -------------------------------------------------------------*/
  637. /** @defgroup SD_Private_Types SD Private Types
  638. * @{
  639. */
  640. /**
  641. * @}
  642. */
  643. /* Private defines -----------------------------------------------------------*/
  644. /** @defgroup SD_Private_Defines SD Private Defines
  645. * @{
  646. */
  647. /**
  648. * @}
  649. */
  650. /* Private variables ---------------------------------------------------------*/
  651. /** @defgroup SD_Private_Variables SD Private Variables
  652. * @{
  653. */
  654. /**
  655. * @}
  656. */
  657. /* Private constants ---------------------------------------------------------*/
  658. /** @defgroup SD_Private_Constants SD Private Constants
  659. * @{
  660. */
  661. /**
  662. * @}
  663. */
  664. /* Private macros ------------------------------------------------------------*/
  665. /** @defgroup SD_Private_Macros SD Private Macros
  666. * @{
  667. */
  668. /**
  669. * @}
  670. */
  671. /* Private functions prototypes ----------------------------------------------*/
  672. /** @defgroup SD_Private_Functions_Prototypes SD Private Functions Prototypes
  673. * @{
  674. */
  675. /**
  676. * @}
  677. */
  678. /* Private functions ---------------------------------------------------------*/
  679. /** @defgroup SD_Private_Functions SD Private Functions
  680. * @{
  681. */
  682. /**
  683. * @}
  684. */
  685. /**
  686. * @}
  687. */
  688. /**
  689. * @}
  690. */
  691. /**
  692. * @}
  693. */
  694. #ifdef __cplusplus
  695. }
  696. #endif
  697. #endif /* STM32H7xx_HAL_SD_H */
  698. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/