stm32f4xx_ll_sdmmc.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_sdmmc.h
  4. * @author MCD Application Team
  5. * @version V1.3.0
  6. * @date 09-March-2015
  7. * @brief Header file of SDMMC HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F4xx_LL_SDMMC_H
  39. #define __STM32F4xx_LL_SDMMC_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32f4xx_hal_def.h"
  45. /** @addtogroup STM32F4xx_Driver
  46. * @{
  47. */
  48. /** @addtogroup SDMMC_LL
  49. * @{
  50. */
  51. /* Exported types ------------------------------------------------------------*/
  52. /** @defgroup SDMMC_LL_Exported_Types SDMMC_LL Exported Types
  53. * @{
  54. */
  55. /**
  56. * @brief SDMMC Configuration Structure definition
  57. */
  58. typedef struct
  59. {
  60. uint32_t ClockEdge; /*!< Specifies the clock transition on which the bit capture is made.
  61. This parameter can be a value of @ref SDIO_Clock_Edge */
  62. uint32_t ClockBypass; /*!< Specifies whether the SDIO Clock divider bypass is
  63. enabled or disabled.
  64. This parameter can be a value of @ref SDIO_Clock_Bypass */
  65. uint32_t ClockPowerSave; /*!< Specifies whether SDIO Clock output is enabled or
  66. disabled when the bus is idle.
  67. This parameter can be a value of @ref SDIO_Clock_Power_Save */
  68. uint32_t BusWide; /*!< Specifies the SDIO bus width.
  69. This parameter can be a value of @ref SDIO_Bus_Wide */
  70. uint32_t HardwareFlowControl; /*!< Specifies whether the SDIO hardware flow control is enabled or disabled.
  71. This parameter can be a value of @ref SDIO_Hardware_Flow_Control */
  72. uint32_t ClockDiv; /*!< Specifies the clock frequency of the SDIO controller.
  73. This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
  74. }SDIO_InitTypeDef;
  75. /**
  76. * @brief SDIO Command Control structure
  77. */
  78. typedef struct
  79. {
  80. uint32_t Argument; /*!< Specifies the SDIO command argument which is sent
  81. to a card as part of a command message. If a command
  82. contains an argument, it must be loaded into this register
  83. before writing the command to the command register. */
  84. uint32_t CmdIndex; /*!< Specifies the SDIO command index. It must be Min_Data = 0 and
  85. Max_Data = 64 */
  86. uint32_t Response; /*!< Specifies the SDIO response type.
  87. This parameter can be a value of @ref SDIO_Response_Type */
  88. uint32_t WaitForInterrupt; /*!< Specifies whether SDIO wait for interrupt request is
  89. enabled or disabled.
  90. This parameter can be a value of @ref SDIO_Wait_Interrupt_State */
  91. uint32_t CPSM; /*!< Specifies whether SDIO Command path state machine (CPSM)
  92. is enabled or disabled.
  93. This parameter can be a value of @ref SDIO_CPSM_State */
  94. }SDIO_CmdInitTypeDef;
  95. /**
  96. * @brief SDIO Data Control structure
  97. */
  98. typedef struct
  99. {
  100. uint32_t DataTimeOut; /*!< Specifies the data timeout period in card bus clock periods. */
  101. uint32_t DataLength; /*!< Specifies the number of data bytes to be transferred. */
  102. uint32_t DataBlockSize; /*!< Specifies the data block size for block transfer.
  103. This parameter can be a value of @ref SDIO_Data_Block_Size */
  104. uint32_t TransferDir; /*!< Specifies the data transfer direction, whether the transfer
  105. is a read or write.
  106. This parameter can be a value of @ref SDIO_Transfer_Direction */
  107. uint32_t TransferMode; /*!< Specifies whether data transfer is in stream or block mode.
  108. This parameter can be a value of @ref SDIO_Transfer_Type */
  109. uint32_t DPSM; /*!< Specifies whether SDIO Data path state machine (DPSM)
  110. is enabled or disabled.
  111. This parameter can be a value of @ref SDIO_DPSM_State */
  112. }SDIO_DataInitTypeDef;
  113. /**
  114. * @}
  115. */
  116. /* Exported constants --------------------------------------------------------*/
  117. /** @defgroup SDMMC_LL_Exported_Constants SDMMC_LL Exported Constants
  118. * @{
  119. */
  120. /** @defgroup SDIO_Clock_Edge Clock Edge
  121. * @{
  122. */
  123. #define SDIO_CLOCK_EDGE_RISING ((uint32_t)0x00000000)
  124. #define SDIO_CLOCK_EDGE_FALLING SDIO_CLKCR_NEGEDGE
  125. #define IS_SDIO_CLOCK_EDGE(EDGE) (((EDGE) == SDIO_CLOCK_EDGE_RISING) || \
  126. ((EDGE) == SDIO_CLOCK_EDGE_FALLING))
  127. /**
  128. * @}
  129. */
  130. /** @defgroup SDIO_Clock_Bypass Clock Bypass
  131. * @{
  132. */
  133. #define SDIO_CLOCK_BYPASS_DISABLE ((uint32_t)0x00000000)
  134. #define SDIO_CLOCK_BYPASS_ENABLE SDIO_CLKCR_BYPASS
  135. #define IS_SDIO_CLOCK_BYPASS(BYPASS) (((BYPASS) == SDIO_CLOCK_BYPASS_DISABLE) || \
  136. ((BYPASS) == SDIO_CLOCK_BYPASS_ENABLE))
  137. /**
  138. * @}
  139. */
  140. /** @defgroup SDIO_Clock_Power_Save Clock Power Saving
  141. * @{
  142. */
  143. #define SDIO_CLOCK_POWER_SAVE_DISABLE ((uint32_t)0x00000000)
  144. #define SDIO_CLOCK_POWER_SAVE_ENABLE SDIO_CLKCR_PWRSAV
  145. #define IS_SDIO_CLOCK_POWER_SAVE(SAVE) (((SAVE) == SDIO_CLOCK_POWER_SAVE_DISABLE) || \
  146. ((SAVE) == SDIO_CLOCK_POWER_SAVE_ENABLE))
  147. /**
  148. * @}
  149. */
  150. /** @defgroup SDIO_Bus_Wide Bus Width
  151. * @{
  152. */
  153. #define SDIO_BUS_WIDE_1B ((uint32_t)0x00000000)
  154. #define SDIO_BUS_WIDE_4B SDIO_CLKCR_WIDBUS_0
  155. #define SDIO_BUS_WIDE_8B SDIO_CLKCR_WIDBUS_1
  156. #define IS_SDIO_BUS_WIDE(WIDE) (((WIDE) == SDIO_BUS_WIDE_1B) || \
  157. ((WIDE) == SDIO_BUS_WIDE_4B) || \
  158. ((WIDE) == SDIO_BUS_WIDE_8B))
  159. /**
  160. * @}
  161. */
  162. /** @defgroup SDIO_Hardware_Flow_Control Hardware Flow Control
  163. * @{
  164. */
  165. #define SDIO_HARDWARE_FLOW_CONTROL_DISABLE ((uint32_t)0x00000000)
  166. #define SDIO_HARDWARE_FLOW_CONTROL_ENABLE SDIO_CLKCR_HWFC_EN
  167. #define IS_SDIO_HARDWARE_FLOW_CONTROL(CONTROL) (((CONTROL) == SDIO_HARDWARE_FLOW_CONTROL_DISABLE) || \
  168. ((CONTROL) == SDIO_HARDWARE_FLOW_CONTROL_ENABLE))
  169. /**
  170. * @}
  171. */
  172. /** @defgroup SDIO_Clock_Division Clock Division
  173. * @{
  174. */
  175. #define IS_SDIO_CLKDIV(DIV) ((DIV) <= 0xFF)
  176. /**
  177. * @}
  178. */
  179. /** @defgroup SDIO_Command_Index Command Index
  180. * @{
  181. */
  182. #define IS_SDIO_CMD_INDEX(INDEX) ((INDEX) < 0x40)
  183. /**
  184. * @}
  185. */
  186. /** @defgroup SDIO_Response_Type Response Type
  187. * @{
  188. */
  189. #define SDIO_RESPONSE_NO ((uint32_t)0x00000000)
  190. #define SDIO_RESPONSE_SHORT SDIO_CMD_WAITRESP_0
  191. #define SDIO_RESPONSE_LONG SDIO_CMD_WAITRESP
  192. #define IS_SDIO_RESPONSE(RESPONSE) (((RESPONSE) == SDIO_RESPONSE_NO) || \
  193. ((RESPONSE) == SDIO_RESPONSE_SHORT) || \
  194. ((RESPONSE) == SDIO_RESPONSE_LONG))
  195. /**
  196. * @}
  197. */
  198. /** @defgroup SDIO_Wait_Interrupt_State Wait Interrupt
  199. * @{
  200. */
  201. #define SDIO_WAIT_NO ((uint32_t)0x00000000)
  202. #define SDIO_WAIT_IT SDIO_CMD_WAITINT
  203. #define SDIO_WAIT_PEND SDIO_CMD_WAITPEND
  204. #define IS_SDIO_WAIT(WAIT) (((WAIT) == SDIO_WAIT_NO) || \
  205. ((WAIT) == SDIO_WAIT_IT) || \
  206. ((WAIT) == SDIO_WAIT_PEND))
  207. /**
  208. * @}
  209. */
  210. /** @defgroup SDIO_CPSM_State CPSM State
  211. * @{
  212. */
  213. #define SDIO_CPSM_DISABLE ((uint32_t)0x00000000)
  214. #define SDIO_CPSM_ENABLE SDIO_CMD_CPSMEN
  215. #define IS_SDIO_CPSM(CPSM) (((CPSM) == SDIO_CPSM_DISABLE) || \
  216. ((CPSM) == SDIO_CPSM_ENABLE))
  217. /**
  218. * @}
  219. */
  220. /** @defgroup SDIO_Response_Registers Response Register
  221. * @{
  222. */
  223. #define SDIO_RESP1 ((uint32_t)0x00000000)
  224. #define SDIO_RESP2 ((uint32_t)0x00000004)
  225. #define SDIO_RESP3 ((uint32_t)0x00000008)
  226. #define SDIO_RESP4 ((uint32_t)0x0000000C)
  227. #define IS_SDIO_RESP(RESP) (((RESP) == SDIO_RESP1) || \
  228. ((RESP) == SDIO_RESP2) || \
  229. ((RESP) == SDIO_RESP3) || \
  230. ((RESP) == SDIO_RESP4))
  231. /**
  232. * @}
  233. */
  234. /** @defgroup SDIO_Data_Length Data Lenght
  235. * @{
  236. */
  237. #define IS_SDIO_DATA_LENGTH(LENGTH) ((LENGTH) <= 0x01FFFFFF)
  238. /**
  239. * @}
  240. */
  241. /** @defgroup SDIO_Data_Block_Size Data Block Size
  242. * @{
  243. */
  244. #define SDIO_DATABLOCK_SIZE_1B ((uint32_t)0x00000000)
  245. #define SDIO_DATABLOCK_SIZE_2B SDIO_DCTRL_DBLOCKSIZE_0
  246. #define SDIO_DATABLOCK_SIZE_4B SDIO_DCTRL_DBLOCKSIZE_1
  247. #define SDIO_DATABLOCK_SIZE_8B ((uint32_t)0x00000030)
  248. #define SDIO_DATABLOCK_SIZE_16B SDIO_DCTRL_DBLOCKSIZE_2
  249. #define SDIO_DATABLOCK_SIZE_32B ((uint32_t)0x00000050)
  250. #define SDIO_DATABLOCK_SIZE_64B ((uint32_t)0x00000060)
  251. #define SDIO_DATABLOCK_SIZE_128B ((uint32_t)0x00000070)
  252. #define SDIO_DATABLOCK_SIZE_256B SDIO_DCTRL_DBLOCKSIZE_3
  253. #define SDIO_DATABLOCK_SIZE_512B ((uint32_t)0x00000090)
  254. #define SDIO_DATABLOCK_SIZE_1024B ((uint32_t)0x000000A0)
  255. #define SDIO_DATABLOCK_SIZE_2048B ((uint32_t)0x000000B0)
  256. #define SDIO_DATABLOCK_SIZE_4096B ((uint32_t)0x000000C0)
  257. #define SDIO_DATABLOCK_SIZE_8192B ((uint32_t)0x000000D0)
  258. #define SDIO_DATABLOCK_SIZE_16384B ((uint32_t)0x000000E0)
  259. #define IS_SDIO_BLOCK_SIZE(SIZE) (((SIZE) == SDIO_DATABLOCK_SIZE_1B) || \
  260. ((SIZE) == SDIO_DATABLOCK_SIZE_2B) || \
  261. ((SIZE) == SDIO_DATABLOCK_SIZE_4B) || \
  262. ((SIZE) == SDIO_DATABLOCK_SIZE_8B) || \
  263. ((SIZE) == SDIO_DATABLOCK_SIZE_16B) || \
  264. ((SIZE) == SDIO_DATABLOCK_SIZE_32B) || \
  265. ((SIZE) == SDIO_DATABLOCK_SIZE_64B) || \
  266. ((SIZE) == SDIO_DATABLOCK_SIZE_128B) || \
  267. ((SIZE) == SDIO_DATABLOCK_SIZE_256B) || \
  268. ((SIZE) == SDIO_DATABLOCK_SIZE_512B) || \
  269. ((SIZE) == SDIO_DATABLOCK_SIZE_1024B) || \
  270. ((SIZE) == SDIO_DATABLOCK_SIZE_2048B) || \
  271. ((SIZE) == SDIO_DATABLOCK_SIZE_4096B) || \
  272. ((SIZE) == SDIO_DATABLOCK_SIZE_8192B) || \
  273. ((SIZE) == SDIO_DATABLOCK_SIZE_16384B))
  274. /**
  275. * @}
  276. */
  277. /** @defgroup SDIO_Transfer_Direction Transfer Direction
  278. * @{
  279. */
  280. #define SDIO_TRANSFER_DIR_TO_CARD ((uint32_t)0x00000000)
  281. #define SDIO_TRANSFER_DIR_TO_SDIO SDIO_DCTRL_DTDIR
  282. #define IS_SDIO_TRANSFER_DIR(DIR) (((DIR) == SDIO_TRANSFER_DIR_TO_CARD) || \
  283. ((DIR) == SDIO_TRANSFER_DIR_TO_SDIO))
  284. /**
  285. * @}
  286. */
  287. /** @defgroup SDIO_Transfer_Type Transfer Type
  288. * @{
  289. */
  290. #define SDIO_TRANSFER_MODE_BLOCK ((uint32_t)0x00000000)
  291. #define SDIO_TRANSFER_MODE_STREAM SDIO_DCTRL_DTMODE
  292. #define IS_SDIO_TRANSFER_MODE(MODE) (((MODE) == SDIO_TRANSFER_MODE_BLOCK) || \
  293. ((MODE) == SDIO_TRANSFER_MODE_STREAM))
  294. /**
  295. * @}
  296. */
  297. /** @defgroup SDIO_DPSM_State DPSM State
  298. * @{
  299. */
  300. #define SDIO_DPSM_DISABLE ((uint32_t)0x00000000)
  301. #define SDIO_DPSM_ENABLE SDIO_DCTRL_DTEN
  302. #define IS_SDIO_DPSM(DPSM) (((DPSM) == SDIO_DPSM_DISABLE) ||\
  303. ((DPSM) == SDIO_DPSM_ENABLE))
  304. /**
  305. * @}
  306. */
  307. /** @defgroup SDIO_Read_Wait_Mode Read Wait Mode
  308. * @{
  309. */
  310. #define SDIO_READ_WAIT_MODE_DATA2 ((uint32_t)0x00000000)
  311. #define SDIO_READ_WAIT_MODE_CLK ((uint32_t)0x00000001)
  312. #define IS_SDIO_READWAIT_MODE(MODE) (((MODE) == SDIO_READ_WAIT_MODE_CLK) || \
  313. ((MODE) == SDIO_READ_WAIT_MODE_DATA2))
  314. /**
  315. * @}
  316. */
  317. /** @defgroup SDIO_Interrupt_sources Interrupt Sources
  318. * @{
  319. */
  320. #define SDIO_IT_CCRCFAIL SDIO_STA_CCRCFAIL
  321. #define SDIO_IT_DCRCFAIL SDIO_STA_DCRCFAIL
  322. #define SDIO_IT_CTIMEOUT SDIO_STA_CTIMEOUT
  323. #define SDIO_IT_DTIMEOUT SDIO_STA_DTIMEOUT
  324. #define SDIO_IT_TXUNDERR SDIO_STA_TXUNDERR
  325. #define SDIO_IT_RXOVERR SDIO_STA_RXOVERR
  326. #define SDIO_IT_CMDREND SDIO_STA_CMDREND
  327. #define SDIO_IT_CMDSENT SDIO_STA_CMDSENT
  328. #define SDIO_IT_DATAEND SDIO_STA_DATAEND
  329. #define SDIO_IT_STBITERR SDIO_STA_STBITERR
  330. #define SDIO_IT_DBCKEND SDIO_STA_DBCKEND
  331. #define SDIO_IT_CMDACT SDIO_STA_CMDACT
  332. #define SDIO_IT_TXACT SDIO_STA_TXACT
  333. #define SDIO_IT_RXACT SDIO_STA_RXACT
  334. #define SDIO_IT_TXFIFOHE SDIO_STA_TXFIFOHE
  335. #define SDIO_IT_RXFIFOHF SDIO_STA_RXFIFOHF
  336. #define SDIO_IT_TXFIFOF SDIO_STA_TXFIFOF
  337. #define SDIO_IT_RXFIFOF SDIO_STA_RXFIFOF
  338. #define SDIO_IT_TXFIFOE SDIO_STA_TXFIFOE
  339. #define SDIO_IT_RXFIFOE SDIO_STA_RXFIFOE
  340. #define SDIO_IT_TXDAVL SDIO_STA_TXDAVL
  341. #define SDIO_IT_RXDAVL SDIO_STA_RXDAVL
  342. #define SDIO_IT_SDIOIT SDIO_STA_SDIOIT
  343. #define SDIO_IT_CEATAEND SDIO_STA_CEATAEND
  344. /**
  345. * @}
  346. */
  347. /** @defgroup SDIO_Flags Flags
  348. * @{
  349. */
  350. #define SDIO_FLAG_CCRCFAIL SDIO_STA_CCRCFAIL
  351. #define SDIO_FLAG_DCRCFAIL SDIO_STA_DCRCFAIL
  352. #define SDIO_FLAG_CTIMEOUT SDIO_STA_CTIMEOUT
  353. #define SDIO_FLAG_DTIMEOUT SDIO_STA_DTIMEOUT
  354. #define SDIO_FLAG_TXUNDERR SDIO_STA_TXUNDERR
  355. #define SDIO_FLAG_RXOVERR SDIO_STA_RXOVERR
  356. #define SDIO_FLAG_CMDREND SDIO_STA_CMDREND
  357. #define SDIO_FLAG_CMDSENT SDIO_STA_CMDSENT
  358. #define SDIO_FLAG_DATAEND SDIO_STA_DATAEND
  359. #define SDIO_FLAG_STBITERR SDIO_STA_STBITERR
  360. #define SDIO_FLAG_DBCKEND SDIO_STA_DBCKEND
  361. #define SDIO_FLAG_CMDACT SDIO_STA_CMDACT
  362. #define SDIO_FLAG_TXACT SDIO_STA_TXACT
  363. #define SDIO_FLAG_RXACT SDIO_STA_RXACT
  364. #define SDIO_FLAG_TXFIFOHE SDIO_STA_TXFIFOHE
  365. #define SDIO_FLAG_RXFIFOHF SDIO_STA_RXFIFOHF
  366. #define SDIO_FLAG_TXFIFOF SDIO_STA_TXFIFOF
  367. #define SDIO_FLAG_RXFIFOF SDIO_STA_RXFIFOF
  368. #define SDIO_FLAG_TXFIFOE SDIO_STA_TXFIFOE
  369. #define SDIO_FLAG_RXFIFOE SDIO_STA_RXFIFOE
  370. #define SDIO_FLAG_TXDAVL SDIO_STA_TXDAVL
  371. #define SDIO_FLAG_RXDAVL SDIO_STA_RXDAVL
  372. #define SDIO_FLAG_SDIOIT SDIO_STA_SDIOIT
  373. #define SDIO_FLAG_CEATAEND SDIO_STA_CEATAEND
  374. /**
  375. * @}
  376. */
  377. /**
  378. * @}
  379. */
  380. /* Exported macro ------------------------------------------------------------*/
  381. /** @defgroup SDMMC_LL_Exported_macros SDMMC_LL Exported Macros
  382. * @{
  383. */
  384. /** @defgroup SDMMC_LL_Alias_Region Bit Address in the alias region
  385. * @{
  386. */
  387. /* ------------ SDIO registers bit address in the alias region -------------- */
  388. #define SDIO_OFFSET (SDIO_BASE - PERIPH_BASE)
  389. /* --- CLKCR Register ---*/
  390. /* Alias word address of CLKEN bit */
  391. #define CLKCR_OFFSET (SDIO_OFFSET + 0x04)
  392. #define CLKEN_BITNUMBER 0x08
  393. #define CLKCR_CLKEN_BB (PERIPH_BB_BASE + (CLKCR_OFFSET * 32) + (CLKEN_BITNUMBER * 4))
  394. /* --- CMD Register ---*/
  395. /* Alias word address of SDIOSUSPEND bit */
  396. #define CMD_OFFSET (SDIO_OFFSET + 0x0C)
  397. #define SDIOSUSPEND_BITNUMBER 0x0B
  398. #define CMD_SDIOSUSPEND_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (SDIOSUSPEND_BITNUMBER * 4))
  399. /* Alias word address of ENCMDCOMPL bit */
  400. #define ENCMDCOMPL_BITNUMBER 0x0C
  401. #define CMD_ENCMDCOMPL_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ENCMDCOMPL_BITNUMBER * 4))
  402. /* Alias word address of NIEN bit */
  403. #define NIEN_BITNUMBER 0x0D
  404. #define CMD_NIEN_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (NIEN_BITNUMBER * 4))
  405. /* Alias word address of ATACMD bit */
  406. #define ATACMD_BITNUMBER 0x0E
  407. #define CMD_ATACMD_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ATACMD_BITNUMBER * 4))
  408. /* --- DCTRL Register ---*/
  409. /* Alias word address of DMAEN bit */
  410. #define DCTRL_OFFSET (SDIO_OFFSET + 0x2C)
  411. #define DMAEN_BITNUMBER 0x03
  412. #define DCTRL_DMAEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (DMAEN_BITNUMBER * 4))
  413. /* Alias word address of RWSTART bit */
  414. #define RWSTART_BITNUMBER 0x08
  415. #define DCTRL_RWSTART_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTART_BITNUMBER * 4))
  416. /* Alias word address of RWSTOP bit */
  417. #define RWSTOP_BITNUMBER 0x09
  418. #define DCTRL_RWSTOP_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTOP_BITNUMBER * 4))
  419. /* Alias word address of RWMOD bit */
  420. #define RWMOD_BITNUMBER 0x0A
  421. #define DCTRL_RWMOD_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWMOD_BITNUMBER * 4))
  422. /* Alias word address of SDIOEN bit */
  423. #define SDIOEN_BITNUMBER 0x0B
  424. #define DCTRL_SDIOEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (SDIOEN_BITNUMBER * 4))
  425. /**
  426. * @}
  427. */
  428. /** @defgroup SDMMC_LL_Register Bits And Addresses Definitions
  429. * @brief SDMMC_LL registers bit address in the alias region
  430. * @{
  431. */
  432. /* ---------------------- SDIO registers bit mask --------------------------- */
  433. /* --- CLKCR Register ---*/
  434. /* CLKCR register clear mask */
  435. #define CLKCR_CLEAR_MASK ((uint32_t)(SDIO_CLKCR_CLKDIV | SDIO_CLKCR_PWRSAV |\
  436. SDIO_CLKCR_BYPASS | SDIO_CLKCR_WIDBUS |\
  437. SDIO_CLKCR_NEGEDGE | SDIO_CLKCR_HWFC_EN))
  438. /* --- PWRCTRL Register ---*/
  439. /* --- DCTRL Register ---*/
  440. /* SDIO DCTRL Clear Mask */
  441. #define DCTRL_CLEAR_MASK ((uint32_t)(SDIO_DCTRL_DTEN | SDIO_DCTRL_DTDIR |\
  442. SDIO_DCTRL_DTMODE | SDIO_DCTRL_DBLOCKSIZE))
  443. /* --- CMD Register ---*/
  444. /* CMD Register clear mask */
  445. #define CMD_CLEAR_MASK ((uint32_t)(SDIO_CMD_CMDINDEX | SDIO_CMD_WAITRESP |\
  446. SDIO_CMD_WAITINT | SDIO_CMD_WAITPEND |\
  447. SDIO_CMD_CPSMEN | SDIO_CMD_SDIOSUSPEND))
  448. /* SDIO RESP Registers Address */
  449. #define SDIO_RESP_ADDR ((uint32_t)(SDIO_BASE + 0x14))
  450. /* SDIO Initialization Frequency (400KHz max) */
  451. #define SDIO_INIT_CLK_DIV ((uint8_t)0x76)
  452. /* SDIO Data Transfer Frequency (25MHz max) */
  453. #define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x0)
  454. /**
  455. * @}
  456. */
  457. /** @defgroup SDMMC_LL_Interrupt_Clock Interrupt And Clock Configuration
  458. * @brief macros to handle interrupts and specific clock configurations
  459. * @{
  460. */
  461. /**
  462. * @brief Enable the SDIO device.
  463. * @retval None
  464. */
  465. #define __SDIO_ENABLE() (*(__IO uint32_t *)CLKCR_CLKEN_BB = ENABLE)
  466. /**
  467. * @brief Disable the SDIO device.
  468. * @retval None
  469. */
  470. #define __SDIO_DISABLE() (*(__IO uint32_t *)CLKCR_CLKEN_BB = DISABLE)
  471. /**
  472. * @brief Enable the SDIO DMA transfer.
  473. * @retval None
  474. */
  475. #define __SDIO_DMA_ENABLE() (*(__IO uint32_t *)DCTRL_DMAEN_BB = ENABLE)
  476. /**
  477. * @brief Disable the SDIO DMA transfer.
  478. * @retval None
  479. */
  480. #define __SDIO_DMA_DISABLE() (*(__IO uint32_t *)DCTRL_DMAEN_BB = DISABLE)
  481. /**
  482. * @brief Enable the SDIO device interrupt.
  483. * @param __INSTANCE__ : Pointer to SDIO register base
  484. * @param __INTERRUPT__ : specifies the SDIO interrupt sources to be enabled.
  485. * This parameter can be one or a combination of the following values:
  486. * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  487. * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  488. * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
  489. * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
  490. * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  491. * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
  492. * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
  493. * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
  494. * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
  495. * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
  496. * bus mode interrupt
  497. * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  498. * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
  499. * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
  500. * @arg SDIO_IT_RXACT: Data receive in progress interrupt
  501. * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
  502. * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
  503. * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
  504. * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
  505. * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
  506. * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
  507. * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
  508. * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
  509. * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
  510. * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
  511. * @retval None
  512. */
  513. #define __SDIO_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->MASK |= (__INTERRUPT__))
  514. /**
  515. * @brief Disable the SDIO device interrupt.
  516. * @param __INSTANCE__ : Pointer to SDIO register base
  517. * @param __INTERRUPT__ : specifies the SDIO interrupt sources to be disabled.
  518. * This parameter can be one or a combination of the following values:
  519. * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  520. * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  521. * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
  522. * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
  523. * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  524. * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
  525. * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
  526. * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
  527. * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
  528. * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
  529. * bus mode interrupt
  530. * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  531. * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
  532. * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
  533. * @arg SDIO_IT_RXACT: Data receive in progress interrupt
  534. * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
  535. * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
  536. * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
  537. * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
  538. * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
  539. * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
  540. * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
  541. * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
  542. * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
  543. * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
  544. * @retval None
  545. */
  546. #define __SDIO_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->MASK &= ~(__INTERRUPT__))
  547. /**
  548. * @brief Checks whether the specified SDIO flag is set or not.
  549. * @param __INSTANCE__ : Pointer to SDIO register base
  550. * @param __FLAG__: specifies the flag to check.
  551. * This parameter can be one of the following values:
  552. * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
  553. * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
  554. * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
  555. * @arg SDIO_FLAG_DTIMEOUT: Data timeout
  556. * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
  557. * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
  558. * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
  559. * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
  560. * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
  561. * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode.
  562. * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
  563. * @arg SDIO_FLAG_CMDACT: Command transfer in progress
  564. * @arg SDIO_FLAG_TXACT: Data transmit in progress
  565. * @arg SDIO_FLAG_RXACT: Data receive in progress
  566. * @arg SDIO_FLAG_TXFIFOHE: Transmit FIFO Half Empty
  567. * @arg SDIO_FLAG_RXFIFOHF: Receive FIFO Half Full
  568. * @arg SDIO_FLAG_TXFIFOF: Transmit FIFO full
  569. * @arg SDIO_FLAG_RXFIFOF: Receive FIFO full
  570. * @arg SDIO_FLAG_TXFIFOE: Transmit FIFO empty
  571. * @arg SDIO_FLAG_RXFIFOE: Receive FIFO empty
  572. * @arg SDIO_FLAG_TXDAVL: Data available in transmit FIFO
  573. * @arg SDIO_FLAG_RXDAVL: Data available in receive FIFO
  574. * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
  575. * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
  576. * @retval The new state of SDIO_FLAG (SET or RESET).
  577. */
  578. #define __SDIO_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->STA &(__FLAG__)) != RESET)
  579. /**
  580. * @brief Clears the SDIO pending flags.
  581. * @param __INSTANCE__ : Pointer to SDIO register base
  582. * @param __FLAG__: specifies the flag to clear.
  583. * This parameter can be one or a combination of the following values:
  584. * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
  585. * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
  586. * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
  587. * @arg SDIO_FLAG_DTIMEOUT: Data timeout
  588. * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
  589. * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
  590. * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
  591. * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
  592. * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
  593. * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode
  594. * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
  595. * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
  596. * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
  597. * @retval None
  598. */
  599. #define __SDIO_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->ICR = (__FLAG__))
  600. /**
  601. * @brief Checks whether the specified SDIO interrupt has occurred or not.
  602. * @param __INSTANCE__ : Pointer to SDIO register base
  603. * @param __INTERRUPT__: specifies the SDIO interrupt source to check.
  604. * This parameter can be one of the following values:
  605. * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  606. * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  607. * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
  608. * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
  609. * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  610. * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
  611. * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
  612. * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
  613. * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
  614. * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
  615. * bus mode interrupt
  616. * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
  617. * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
  618. * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
  619. * @arg SDIO_IT_RXACT: Data receive in progress interrupt
  620. * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
  621. * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
  622. * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
  623. * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
  624. * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
  625. * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
  626. * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
  627. * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
  628. * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
  629. * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
  630. * @retval The new state of SDIO_IT (SET or RESET).
  631. */
  632. #define __SDIO_GET_IT (__INSTANCE__, __INTERRUPT__) (((__INSTANCE__)->STA &(__INTERRUPT__)) == (__INTERRUPT__))
  633. /**
  634. * @brief Clears the SDIO's interrupt pending bits.
  635. * @param __INSTANCE__ : Pointer to SDIO register base
  636. * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
  637. * This parameter can be one or a combination of the following values:
  638. * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
  639. * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
  640. * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
  641. * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
  642. * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
  643. * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
  644. * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
  645. * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
  646. * @arg SDIO_IT_DATAEND: Data end (data counter, SDIO_DCOUNT, is zero) interrupt
  647. * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
  648. * bus mode interrupt
  649. * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
  650. * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61
  651. * @retval None
  652. */
  653. #define __SDIO_CLEAR_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->ICR = (__INTERRUPT__))
  654. /**
  655. * @brief Enable Start the SD I/O Read Wait operation.
  656. * @retval None
  657. */
  658. #define __SDIO_START_READWAIT_ENABLE() (*(__IO uint32_t *) DCTRL_RWSTART_BB = ENABLE)
  659. /**
  660. * @brief Disable Start the SD I/O Read Wait operations.
  661. * @retval None
  662. */
  663. #define __SDIO_START_READWAIT_DISABLE() (*(__IO uint32_t *) DCTRL_RWSTART_BB = DISABLE)
  664. /**
  665. * @brief Enable Start the SD I/O Read Wait operation.
  666. * @retval None
  667. */
  668. #define __SDIO_STOP_READWAIT_ENABLE() (*(__IO uint32_t *) DCTRL_RWSTOP_BB = ENABLE)
  669. /**
  670. * @brief Disable Stop the SD I/O Read Wait operations.
  671. * @retval None
  672. */
  673. #define __SDIO_STOP_READWAIT_DISABLE() (*(__IO uint32_t *) DCTRL_RWSTOP_BB = DISABLE)
  674. /**
  675. * @brief Enable the SD I/O Mode Operation.
  676. * @retval None
  677. */
  678. #define __SDIO_OPERATION_ENABLE() (*(__IO uint32_t *) DCTRL_SDIOEN_BB = ENABLE)
  679. /**
  680. * @brief Disable the SD I/O Mode Operation.
  681. * @retval None
  682. */
  683. #define __SDIO_OPERATION_DISABLE() (*(__IO uint32_t *) DCTRL_SDIOEN_BB = DISABLE)
  684. /**
  685. * @brief Enable the SD I/O Suspend command sending.
  686. * @retval None
  687. */
  688. #define __SDIO_SUSPEND_CMD_ENABLE() (*(__IO uint32_t *) CMD_SDIOSUSPEND_BB = ENABLE)
  689. /**
  690. * @brief Disable the SD I/O Suspend command sending.
  691. * @retval None
  692. */
  693. #define __SDIO_SUSPEND_CMD_DISABLE() (*(__IO uint32_t *) CMD_SDIOSUSPEND_BB = DISABLE)
  694. #if !defined(STM32F446xx)
  695. /**
  696. * @brief Enable the command completion signal.
  697. * @retval None
  698. */
  699. #define __SDIO_CEATA_CMD_COMPLETION_ENABLE() (*(__IO uint32_t *) CMD_ENCMDCOMPL_BB = ENABLE)
  700. /**
  701. * @brief Disable the command completion signal.
  702. * @retval None
  703. */
  704. #define __SDIO_CEATA_CMD_COMPLETION_DISABLE() (*(__IO uint32_t *) CMD_ENCMDCOMPL_BB = DISABLE)
  705. /**
  706. * @brief Enable the CE-ATA interrupt.
  707. * @retval None
  708. */
  709. #define __SDIO_CEATA_ENABLE_IT() (*(__IO uint32_t *) CMD_NIEN_BB = (uint32_t)0)
  710. /**
  711. * @brief Disable the CE-ATA interrupt.
  712. * @retval None
  713. */
  714. #define __SDIO_CEATA_DISABLE_IT() (*(__IO uint32_t *) CMD_NIEN_BB = (uint32_t)1)
  715. /**
  716. * @brief Enable send CE-ATA command (CMD61).
  717. * @retval None
  718. */
  719. #define __SDIO_CEATA_SENDCMD_ENABLE() (*(__IO uint32_t *) CMD_ATACMD_BB = ENABLE)
  720. /**
  721. * @brief Disable send CE-ATA command (CMD61).
  722. * @retval None
  723. */
  724. #define __SDIO_CEATA_SENDCMD_DISABLE() (*(__IO uint32_t *) CMD_ATACMD_BB = DISABLE)
  725. #endif /* !defined(STM32F446xx) */
  726. /**
  727. * @}
  728. */
  729. /**
  730. * @}
  731. */
  732. /* Exported functions --------------------------------------------------------*/
  733. /** @addtogroup SDMMC_LL_Exported_Functions
  734. * @{
  735. */
  736. /* Initialization/de-initialization functions **********************************/
  737. /** @addtogroup HAL_SDMMC_LL_Group1
  738. * @{
  739. */
  740. HAL_StatusTypeDef SDIO_Init(SDIO_TypeDef *SDIOx, SDIO_InitTypeDef Init);
  741. /**
  742. * @}
  743. */
  744. /* I/O operation functions *****************************************************/
  745. /** @addtogroup HAL_SDMMC_LL_Group2
  746. * @{
  747. */
  748. /* Blocking mode: Polling */
  749. uint32_t SDIO_ReadFIFO(SDIO_TypeDef *SDIOx);
  750. HAL_StatusTypeDef SDIO_WriteFIFO(SDIO_TypeDef *SDIOx, uint32_t *pWriteData);
  751. /**
  752. * @}
  753. */
  754. /* Peripheral Control functions ************************************************/
  755. /** @addtogroup HAL_SDMMC_LL_Group3
  756. * @{
  757. */
  758. HAL_StatusTypeDef SDIO_PowerState_ON(SDIO_TypeDef *SDIOx);
  759. HAL_StatusTypeDef SDIO_PowerState_OFF(SDIO_TypeDef *SDIOx);
  760. uint32_t SDIO_GetPowerState(SDIO_TypeDef *SDIOx);
  761. /* Command path state machine (CPSM) management functions */
  762. HAL_StatusTypeDef SDIO_SendCommand(SDIO_TypeDef *SDIOx, SDIO_CmdInitTypeDef *SDIO_CmdInitStruct);
  763. uint8_t SDIO_GetCommandResponse(SDIO_TypeDef *SDIOx);
  764. uint32_t SDIO_GetResponse(uint32_t SDIO_RESP);
  765. /* Data path state machine (DPSM) management functions */
  766. HAL_StatusTypeDef SDIO_DataConfig(SDIO_TypeDef *SDIOx, SDIO_DataInitTypeDef* SDIO_DataInitStruct);
  767. uint32_t SDIO_GetDataCounter(SDIO_TypeDef *SDIOx);
  768. uint32_t SDIO_GetFIFOCount(SDIO_TypeDef *SDIOx);
  769. /* SDIO IO Cards mode management functions */
  770. HAL_StatusTypeDef SDIO_SetSDIOReadWaitMode(uint32_t SDIO_ReadWaitMode);
  771. /**
  772. * @}
  773. */
  774. /**
  775. * @}
  776. */
  777. /**
  778. * @}
  779. */
  780. /**
  781. * @}
  782. */
  783. #ifdef __cplusplus
  784. }
  785. #endif
  786. #endif /* __STM32F4xx_LL_SDMMC_H */
  787. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/