Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

1424 wiersze
60 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_fmc.h
  4. * @author MCD Application Team
  5. * @brief Header file of FMC HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2016 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32F4xx_LL_FMC_H
  20. #define STM32F4xx_LL_FMC_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32f4xx_hal_def.h"
  26. /** @addtogroup STM32F4xx_HAL_Driver
  27. * @{
  28. */
  29. /** @addtogroup FMC_LL
  30. * @{
  31. */
  32. /** @addtogroup FMC_LL_Private_Macros
  33. * @{
  34. */
  35. #if defined(FMC_Bank1)
  36. #define IS_FMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FMC_NORSRAM_BANK1) || \
  37. ((__BANK__) == FMC_NORSRAM_BANK2) || \
  38. ((__BANK__) == FMC_NORSRAM_BANK3) || \
  39. ((__BANK__) == FMC_NORSRAM_BANK4))
  40. #define IS_FMC_MUX(__MUX__) (((__MUX__) == FMC_DATA_ADDRESS_MUX_DISABLE) || \
  41. ((__MUX__) == FMC_DATA_ADDRESS_MUX_ENABLE))
  42. #define IS_FMC_MEMORY(__MEMORY__) (((__MEMORY__) == FMC_MEMORY_TYPE_SRAM) || \
  43. ((__MEMORY__) == FMC_MEMORY_TYPE_PSRAM)|| \
  44. ((__MEMORY__) == FMC_MEMORY_TYPE_NOR))
  45. #define IS_FMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_8) || \
  46. ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_16) || \
  47. ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_32))
  48. #define IS_FMC_PAGESIZE(__SIZE__) (((__SIZE__) == FMC_PAGE_SIZE_NONE) || \
  49. ((__SIZE__) == FMC_PAGE_SIZE_128) || \
  50. ((__SIZE__) == FMC_PAGE_SIZE_256) || \
  51. ((__SIZE__) == FMC_PAGE_SIZE_512) || \
  52. ((__SIZE__) == FMC_PAGE_SIZE_1024))
  53. #if defined(FMC_BCR1_WFDIS)
  54. #define IS_FMC_WRITE_FIFO(__FIFO__) (((__FIFO__) == FMC_WRITE_FIFO_DISABLE) || \
  55. ((__FIFO__) == FMC_WRITE_FIFO_ENABLE))
  56. #endif /* FMC_BCR1_WFDIS */
  57. #define IS_FMC_ACCESS_MODE(__MODE__) (((__MODE__) == FMC_ACCESS_MODE_A) || \
  58. ((__MODE__) == FMC_ACCESS_MODE_B) || \
  59. ((__MODE__) == FMC_ACCESS_MODE_C) || \
  60. ((__MODE__) == FMC_ACCESS_MODE_D))
  61. #define IS_FMC_BURSTMODE(__STATE__) (((__STATE__) == FMC_BURST_ACCESS_MODE_DISABLE) || \
  62. ((__STATE__) == FMC_BURST_ACCESS_MODE_ENABLE))
  63. #define IS_FMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_LOW) || \
  64. ((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_HIGH))
  65. #define IS_FMC_WRAP_MODE(__MODE__) (((__MODE__) == FMC_WRAP_MODE_DISABLE) || \
  66. ((__MODE__) == FMC_WRAP_MODE_ENABLE))
  67. #define IS_FMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FMC_WAIT_TIMING_BEFORE_WS) || \
  68. ((__ACTIVE__) == FMC_WAIT_TIMING_DURING_WS))
  69. #define IS_FMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FMC_WRITE_OPERATION_DISABLE) || \
  70. ((__OPERATION__) == FMC_WRITE_OPERATION_ENABLE))
  71. #define IS_FMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FMC_WAIT_SIGNAL_DISABLE) || \
  72. ((__SIGNAL__) == FMC_WAIT_SIGNAL_ENABLE))
  73. #define IS_FMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FMC_EXTENDED_MODE_DISABLE) || \
  74. ((__MODE__) == FMC_EXTENDED_MODE_ENABLE))
  75. #define IS_FMC_ASYNWAIT(__STATE__) (((__STATE__) == FMC_ASYNCHRONOUS_WAIT_DISABLE) || \
  76. ((__STATE__) == FMC_ASYNCHRONOUS_WAIT_ENABLE))
  77. #define IS_FMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1U) && ((__LATENCY__) <= 17U))
  78. #define IS_FMC_WRITE_BURST(__BURST__) (((__BURST__) == FMC_WRITE_BURST_DISABLE) || \
  79. ((__BURST__) == FMC_WRITE_BURST_ENABLE))
  80. #define IS_FMC_CONTINOUS_CLOCK(__CCLOCK__) (((__CCLOCK__) == FMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \
  81. ((__CCLOCK__) == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC))
  82. #define IS_FMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15U)
  83. #define IS_FMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 15U))
  84. #define IS_FMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 255U))
  85. #define IS_FMC_DATAHOLD_DURATION(__DATAHOLD__) ((__DATAHOLD__) <= 3U)
  86. #define IS_FMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15U)
  87. #define IS_FMC_CLK_DIV(__DIV__) (((__DIV__) > 1U) && ((__DIV__) <= 16U))
  88. #define IS_FMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_DEVICE)
  89. #define IS_FMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_EXTENDED_DEVICE)
  90. #endif /* FMC_Bank1 */
  91. #if (defined(FMC_Bank3) || defined(FMC_Bank2_3))
  92. #if defined(FMC_Bank2_3)
  93. #define IS_FMC_NAND_BANK(__BANK__) (((__BANK__) == FMC_NAND_BANK2) || \
  94. ((__BANK__) == FMC_NAND_BANK3))
  95. #else
  96. #define IS_FMC_NAND_BANK(__BANK__) ((__BANK__) == FMC_NAND_BANK3)
  97. #endif /* FMC_Bank2_3 */
  98. #define IS_FMC_WAIT_FEATURE(__FEATURE__) (((__FEATURE__) == FMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \
  99. ((__FEATURE__) == FMC_NAND_PCC_WAIT_FEATURE_ENABLE))
  100. #define IS_FMC_NAND_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NAND_PCC_MEM_BUS_WIDTH_8) || \
  101. ((__WIDTH__) == FMC_NAND_PCC_MEM_BUS_WIDTH_16))
  102. #define IS_FMC_ECC_STATE(__STATE__) (((__STATE__) == FMC_NAND_ECC_DISABLE) || \
  103. ((__STATE__) == FMC_NAND_ECC_ENABLE))
  104. #define IS_FMC_ECCPAGE_SIZE(__SIZE__) (((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_256BYTE) || \
  105. ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_512BYTE) || \
  106. ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \
  107. ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \
  108. ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \
  109. ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_8192BYTE))
  110. #define IS_FMC_TCLR_TIME(__TIME__) ((__TIME__) <= 255U)
  111. #define IS_FMC_TAR_TIME(__TIME__) ((__TIME__) <= 255U)
  112. #define IS_FMC_SETUP_TIME(__TIME__) ((__TIME__) <= 254U)
  113. #define IS_FMC_WAIT_TIME(__TIME__) ((__TIME__) <= 254U)
  114. #define IS_FMC_HOLD_TIME(__TIME__) ((__TIME__) <= 254U)
  115. #define IS_FMC_HIZ_TIME(__TIME__) ((__TIME__) <= 254U)
  116. #define IS_FMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NAND_DEVICE)
  117. #endif /* FMC_Bank3) || defined(FMC_Bank2_3 */
  118. #if defined(FMC_Bank4)
  119. #define IS_FMC_PCCARD_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_PCCARD_DEVICE)
  120. #endif /* FMC_Bank4 */
  121. #if defined(FMC_Bank5_6)
  122. #define IS_FMC_SDMEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_SDRAM_MEM_BUS_WIDTH_8) || \
  123. ((__WIDTH__) == FMC_SDRAM_MEM_BUS_WIDTH_16) || \
  124. ((__WIDTH__) == FMC_SDRAM_MEM_BUS_WIDTH_32))
  125. #define IS_FMC_WRITE_PROTECTION(__WRITE__) (((__WRITE__) == FMC_SDRAM_WRITE_PROTECTION_DISABLE) || \
  126. ((__WRITE__) == FMC_SDRAM_WRITE_PROTECTION_ENABLE))
  127. #define IS_FMC_SDCLOCK_PERIOD(__PERIOD__) (((__PERIOD__) == FMC_SDRAM_CLOCK_DISABLE) || \
  128. ((__PERIOD__) == FMC_SDRAM_CLOCK_PERIOD_2) || \
  129. ((__PERIOD__) == FMC_SDRAM_CLOCK_PERIOD_3))
  130. #define IS_FMC_READ_BURST(__RBURST__) (((__RBURST__) == FMC_SDRAM_RBURST_DISABLE) || \
  131. ((__RBURST__) == FMC_SDRAM_RBURST_ENABLE))
  132. #define IS_FMC_READPIPE_DELAY(__DELAY__) (((__DELAY__) == FMC_SDRAM_RPIPE_DELAY_0) || \
  133. ((__DELAY__) == FMC_SDRAM_RPIPE_DELAY_1) || \
  134. ((__DELAY__) == FMC_SDRAM_RPIPE_DELAY_2))
  135. #define IS_FMC_COMMAND_MODE(__COMMAND__) (((__COMMAND__) == FMC_SDRAM_CMD_NORMAL_MODE) || \
  136. ((__COMMAND__) == FMC_SDRAM_CMD_CLK_ENABLE) || \
  137. ((__COMMAND__) == FMC_SDRAM_CMD_PALL) || \
  138. ((__COMMAND__) == FMC_SDRAM_CMD_AUTOREFRESH_MODE) || \
  139. ((__COMMAND__) == FMC_SDRAM_CMD_LOAD_MODE) || \
  140. ((__COMMAND__) == FMC_SDRAM_CMD_SELFREFRESH_MODE) || \
  141. ((__COMMAND__) == FMC_SDRAM_CMD_POWERDOWN_MODE))
  142. #define IS_FMC_COMMAND_TARGET(__TARGET__) (((__TARGET__) == FMC_SDRAM_CMD_TARGET_BANK1) || \
  143. ((__TARGET__) == FMC_SDRAM_CMD_TARGET_BANK2) || \
  144. ((__TARGET__) == FMC_SDRAM_CMD_TARGET_BANK1_2))
  145. #define IS_FMC_LOADTOACTIVE_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
  146. #define IS_FMC_EXITSELFREFRESH_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
  147. #define IS_FMC_SELFREFRESH_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 16U))
  148. #define IS_FMC_ROWCYCLE_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
  149. #define IS_FMC_WRITE_RECOVERY_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 16U))
  150. #define IS_FMC_RP_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
  151. #define IS_FMC_RCD_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
  152. #define IS_FMC_AUTOREFRESH_NUMBER(__NUMBER__) (((__NUMBER__) > 0U) && ((__NUMBER__) <= 15U))
  153. #define IS_FMC_MODE_REGISTER(__CONTENT__) ((__CONTENT__) <= 8191U)
  154. #define IS_FMC_REFRESH_RATE(__RATE__) ((__RATE__) <= 8191U)
  155. #define IS_FMC_SDRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_SDRAM_DEVICE)
  156. #define IS_FMC_SDRAM_BANK(__BANK__) (((__BANK__) == FMC_SDRAM_BANK1) || \
  157. ((__BANK__) == FMC_SDRAM_BANK2))
  158. #define IS_FMC_COLUMNBITS_NUMBER(__COLUMN__) (((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_8) || \
  159. ((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_9) || \
  160. ((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_10) || \
  161. ((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_11))
  162. #define IS_FMC_ROWBITS_NUMBER(__ROW__) (((__ROW__) == FMC_SDRAM_ROW_BITS_NUM_11) || \
  163. ((__ROW__) == FMC_SDRAM_ROW_BITS_NUM_12) || \
  164. ((__ROW__) == FMC_SDRAM_ROW_BITS_NUM_13))
  165. #define IS_FMC_INTERNALBANK_NUMBER(__NUMBER__) (((__NUMBER__) == FMC_SDRAM_INTERN_BANKS_NUM_2) || \
  166. ((__NUMBER__) == FMC_SDRAM_INTERN_BANKS_NUM_4))
  167. #define IS_FMC_CAS_LATENCY(__LATENCY__) (((__LATENCY__) == FMC_SDRAM_CAS_LATENCY_1) || \
  168. ((__LATENCY__) == FMC_SDRAM_CAS_LATENCY_2) || \
  169. ((__LATENCY__) == FMC_SDRAM_CAS_LATENCY_3))
  170. #endif /* FMC_Bank5_6 */
  171. /**
  172. * @}
  173. */
  174. /* Exported typedef ----------------------------------------------------------*/
  175. /** @defgroup FMC_LL_Exported_typedef FMC Low Layer Exported Types
  176. * @{
  177. */
  178. #if defined(FMC_Bank1)
  179. #define FMC_NORSRAM_TypeDef FMC_Bank1_TypeDef
  180. #define FMC_NORSRAM_EXTENDED_TypeDef FMC_Bank1E_TypeDef
  181. #endif /* FMC_Bank1 */
  182. #if defined(FMC_Bank2_3)
  183. #define FMC_NAND_TypeDef FMC_Bank2_3_TypeDef
  184. #else
  185. #define FMC_NAND_TypeDef FMC_Bank3_TypeDef
  186. #endif /* FMC_Bank2_3 */
  187. #if defined(FMC_Bank4)
  188. #define FMC_PCCARD_TypeDef FMC_Bank4_TypeDef
  189. #endif /* FMC_Bank4 */
  190. #if defined(FMC_Bank5_6)
  191. #define FMC_SDRAM_TypeDef FMC_Bank5_6_TypeDef
  192. #endif /* FMC_Bank5_6 */
  193. #if defined(FMC_Bank1)
  194. #define FMC_NORSRAM_DEVICE FMC_Bank1
  195. #define FMC_NORSRAM_EXTENDED_DEVICE FMC_Bank1E
  196. #endif /* FMC_Bank1 */
  197. #if defined(FMC_Bank2_3)
  198. #define FMC_NAND_DEVICE FMC_Bank2_3
  199. #else
  200. #define FMC_NAND_DEVICE FMC_Bank3
  201. #endif /* FMC_Bank2_3 */
  202. #if defined(FMC_Bank4)
  203. #define FMC_PCCARD_DEVICE FMC_Bank4
  204. #endif /* FMC_Bank4 */
  205. #if defined(FMC_Bank5_6)
  206. #define FMC_SDRAM_DEVICE FMC_Bank5_6
  207. #endif /* FMC_Bank5_6 */
  208. #if defined(FMC_Bank1)
  209. /**
  210. * @brief FMC NORSRAM Configuration Structure definition
  211. */
  212. typedef struct
  213. {
  214. uint32_t NSBank; /*!< Specifies the NORSRAM memory device that will be used.
  215. This parameter can be a value of @ref FMC_NORSRAM_Bank */
  216. uint32_t DataAddressMux; /*!< Specifies whether the address and data values are
  217. multiplexed on the data bus or not.
  218. This parameter can be a value of @ref FMC_Data_Address_Bus_Multiplexing*/
  219. uint32_t MemoryType; /*!< Specifies the type of external memory attached to
  220. the corresponding memory device.
  221. This parameter can be a value of @ref FMC_Memory_Type */
  222. uint32_t MemoryDataWidth; /*!< Specifies the external memory device width.
  223. This parameter can be a value of @ref FMC_NORSRAM_Data_Width */
  224. uint32_t BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory,
  225. valid only with synchronous burst Flash memories.
  226. This parameter can be a value of @ref FMC_Burst_Access_Mode */
  227. uint32_t WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing
  228. the Flash memory in burst mode.
  229. This parameter can be a value of @ref FMC_Wait_Signal_Polarity */
  230. uint32_t WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash
  231. memory, valid only when accessing Flash memories in burst mode.
  232. This parameter can be a value of @ref FMC_Wrap_Mode
  233. This mode is not available for the STM32F446/467/479xx devices */
  234. uint32_t WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one
  235. clock cycle before the wait state or during the wait state,
  236. valid only when accessing memories in burst mode.
  237. This parameter can be a value of @ref FMC_Wait_Timing */
  238. uint32_t WriteOperation; /*!< Enables or disables the write operation in the selected device
  239. by the FMC.
  240. This parameter can be a value of @ref FMC_Write_Operation */
  241. uint32_t WaitSignal; /*!< Enables or disables the wait state insertion via wait
  242. signal, valid for Flash memory access in burst mode.
  243. This parameter can be a value of @ref FMC_Wait_Signal */
  244. uint32_t ExtendedMode; /*!< Enables or disables the extended mode.
  245. This parameter can be a value of @ref FMC_Extended_Mode */
  246. uint32_t AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers,
  247. valid only with asynchronous Flash memories.
  248. This parameter can be a value of @ref FMC_AsynchronousWait */
  249. uint32_t WriteBurst; /*!< Enables or disables the write burst operation.
  250. This parameter can be a value of @ref FMC_Write_Burst */
  251. uint32_t ContinuousClock; /*!< Enables or disables the FMC clock output to external memory devices.
  252. This parameter is only enabled through the FMC_BCR1 register,
  253. and don't care through FMC_BCR2..4 registers.
  254. This parameter can be a value of @ref FMC_Continous_Clock */
  255. uint32_t WriteFifo; /*!< Enables or disables the write FIFO used by the FMC controller.
  256. This parameter is only enabled through the FMC_BCR1 register,
  257. and don't care through FMC_BCR2..4 registers.
  258. This parameter can be a value of @ref FMC_Write_FIFO
  259. This mode is available only for the STM32F446/469/479xx devices */
  260. uint32_t PageSize; /*!< Specifies the memory page size.
  261. This parameter can be a value of @ref FMC_Page_Size */
  262. } FMC_NORSRAM_InitTypeDef;
  263. /**
  264. * @brief FMC NORSRAM Timing parameters structure definition
  265. */
  266. typedef struct
  267. {
  268. uint32_t AddressSetupTime; /*!< Defines the number of HCLK cycles to configure
  269. the duration of the address setup time.
  270. This parameter can be a value between Min_Data = 0 and Max_Data = 15.
  271. @note This parameter is not used with synchronous NOR Flash memories. */
  272. uint32_t AddressHoldTime; /*!< Defines the number of HCLK cycles to configure
  273. the duration of the address hold time.
  274. This parameter can be a value between Min_Data = 1 and Max_Data = 15.
  275. @note This parameter is not used with synchronous NOR Flash memories. */
  276. uint32_t DataSetupTime; /*!< Defines the number of HCLK cycles to configure
  277. the duration of the data setup time.
  278. This parameter can be a value between Min_Data = 1 and Max_Data = 255.
  279. @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed
  280. NOR Flash memories. */
  281. uint32_t BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure
  282. the duration of the bus turnaround.
  283. This parameter can be a value between Min_Data = 0 and Max_Data = 15.
  284. @note This parameter is only used for multiplexed NOR Flash memories. */
  285. uint32_t CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of
  286. HCLK cycles. This parameter can be a value between Min_Data = 2 and
  287. Max_Data = 16.
  288. @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM
  289. accesses. */
  290. uint32_t DataLatency; /*!< Defines the number of memory clock cycles to issue
  291. to the memory before getting the first data.
  292. The parameter value depends on the memory type as shown below:
  293. - It must be set to 0 in case of a CRAM
  294. - It is don't care in asynchronous NOR, SRAM or ROM accesses
  295. - It may assume a value between Min_Data = 2 and Max_Data = 17
  296. in NOR Flash memories with synchronous burst mode enable */
  297. uint32_t AccessMode; /*!< Specifies the asynchronous access mode.
  298. This parameter can be a value of @ref FMC_Access_Mode */
  299. } FMC_NORSRAM_TimingTypeDef;
  300. #endif /* FMC_Bank1 */
  301. #if defined(FMC_Bank3) || defined(FMC_Bank2_3)
  302. /**
  303. * @brief FMC NAND Configuration Structure definition
  304. */
  305. typedef struct
  306. {
  307. uint32_t NandBank; /*!< Specifies the NAND memory device that will be used.
  308. This parameter can be a value of @ref FMC_NAND_Bank */
  309. uint32_t Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory device.
  310. This parameter can be any value of @ref FMC_Wait_feature */
  311. uint32_t MemoryDataWidth; /*!< Specifies the external memory device width.
  312. This parameter can be any value of @ref FMC_NAND_Data_Width */
  313. uint32_t EccComputation; /*!< Enables or disables the ECC computation.
  314. This parameter can be any value of @ref FMC_ECC */
  315. uint32_t ECCPageSize; /*!< Defines the page size for the extended ECC.
  316. This parameter can be any value of @ref FMC_ECC_Page_Size */
  317. uint32_t TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
  318. delay between CLE low and RE low.
  319. This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
  320. uint32_t TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
  321. delay between ALE low and RE low.
  322. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  323. } FMC_NAND_InitTypeDef;
  324. #endif /* FMC_Bank3 || FMC_Bank2_3 */
  325. #if defined(FMC_Bank3) || defined(FMC_Bank2_3) || defined(FMC_Bank4)
  326. /**
  327. * @brief FMC NAND Timing parameters structure definition
  328. */
  329. typedef struct
  330. {
  331. uint32_t SetupTime; /*!< Defines the number of HCLK cycles to setup address before
  332. the command assertion for NAND-Flash read or write access
  333. to common/Attribute or I/O memory space (depending on
  334. the memory space timing to be configured).
  335. This parameter can be a value between Min_Data = 0 and Max_Data = 254 */
  336. uint32_t WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the
  337. command for NAND-Flash read or write access to
  338. common/Attribute or I/O memory space (depending on the
  339. memory space timing to be configured).
  340. This parameter can be a number between Min_Data = 0 and Max_Data = 254 */
  341. uint32_t HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address
  342. (and data for write access) after the command de-assertion
  343. for NAND-Flash read or write access to common/Attribute
  344. or I/O memory space (depending on the memory space timing
  345. to be configured).
  346. This parameter can be a number between Min_Data = 0 and Max_Data = 254 */
  347. uint32_t HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the
  348. data bus is kept in HiZ after the start of a NAND-Flash
  349. write access to common/Attribute or I/O memory space (depending
  350. on the memory space timing to be configured).
  351. This parameter can be a number between Min_Data = 0 and Max_Data = 254 */
  352. } FMC_NAND_PCC_TimingTypeDef;
  353. #endif /* FMC_Bank3 || FMC_Bank2_3 */
  354. #if defined(FMC_Bank4)
  355. /**
  356. * @brief FMC PCCARD Configuration Structure definition
  357. */
  358. typedef struct
  359. {
  360. uint32_t Waitfeature; /*!< Enables or disables the Wait feature for the PCCARD Memory device.
  361. This parameter can be any value of @ref FMC_Wait_feature */
  362. uint32_t TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
  363. delay between CLE low and RE low.
  364. This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
  365. uint32_t TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
  366. delay between ALE low and RE low.
  367. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  368. } FMC_PCCARD_InitTypeDef;
  369. #endif /* FMC_Bank4 */
  370. #if defined(FMC_Bank5_6)
  371. /**
  372. * @brief FMC SDRAM Configuration Structure definition
  373. */
  374. typedef struct
  375. {
  376. uint32_t SDBank; /*!< Specifies the SDRAM memory device that will be used.
  377. This parameter can be a value of @ref FMC_SDRAM_Bank */
  378. uint32_t ColumnBitsNumber; /*!< Defines the number of bits of column address.
  379. This parameter can be a value of @ref FMC_SDRAM_Column_Bits_number. */
  380. uint32_t RowBitsNumber; /*!< Defines the number of bits of column address.
  381. This parameter can be a value of @ref FMC_SDRAM_Row_Bits_number. */
  382. uint32_t MemoryDataWidth; /*!< Defines the memory device width.
  383. This parameter can be a value of @ref FMC_SDRAM_Memory_Bus_Width. */
  384. uint32_t InternalBankNumber; /*!< Defines the number of the device's internal banks.
  385. This parameter can be of @ref FMC_SDRAM_Internal_Banks_Number. */
  386. uint32_t CASLatency; /*!< Defines the SDRAM CAS latency in number of memory clock cycles.
  387. This parameter can be a value of @ref FMC_SDRAM_CAS_Latency. */
  388. uint32_t WriteProtection; /*!< Enables the SDRAM device to be accessed in write mode.
  389. This parameter can be a value of @ref FMC_SDRAM_Write_Protection. */
  390. uint32_t SDClockPeriod; /*!< Define the SDRAM Clock Period for both SDRAM devices and they allow
  391. to disable the clock before changing frequency.
  392. This parameter can be a value of @ref FMC_SDRAM_Clock_Period. */
  393. uint32_t ReadBurst; /*!< This bit enable the SDRAM controller to anticipate the next read
  394. commands during the CAS latency and stores data in the Read FIFO.
  395. This parameter can be a value of @ref FMC_SDRAM_Read_Burst. */
  396. uint32_t ReadPipeDelay; /*!< Define the delay in system clock cycles on read data path.
  397. This parameter can be a value of @ref FMC_SDRAM_Read_Pipe_Delay. */
  398. } FMC_SDRAM_InitTypeDef;
  399. /**
  400. * @brief FMC SDRAM Timing parameters structure definition
  401. */
  402. typedef struct
  403. {
  404. uint32_t LoadToActiveDelay; /*!< Defines the delay between a Load Mode Register command and
  405. an active or Refresh command in number of memory clock cycles.
  406. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  407. uint32_t ExitSelfRefreshDelay; /*!< Defines the delay from releasing the self refresh command to
  408. issuing the Activate command in number of memory clock cycles.
  409. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  410. uint32_t SelfRefreshTime; /*!< Defines the minimum Self Refresh period in number of memory clock
  411. cycles.
  412. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  413. uint32_t RowCycleDelay; /*!< Defines the delay between the Refresh command and the Activate command
  414. and the delay between two consecutive Refresh commands in number of
  415. memory clock cycles.
  416. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  417. uint32_t WriteRecoveryTime; /*!< Defines the Write recovery Time in number of memory clock cycles.
  418. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  419. uint32_t RPDelay; /*!< Defines the delay between a Precharge Command and an other command
  420. in number of memory clock cycles.
  421. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  422. uint32_t RCDDelay; /*!< Defines the delay between the Activate Command and a Read/Write
  423. command in number of memory clock cycles.
  424. This parameter can be a value between Min_Data = 1 and Max_Data = 16 */
  425. } FMC_SDRAM_TimingTypeDef;
  426. /**
  427. * @brief SDRAM command parameters structure definition
  428. */
  429. typedef struct
  430. {
  431. uint32_t CommandMode; /*!< Defines the command issued to the SDRAM device.
  432. This parameter can be a value of @ref FMC_SDRAM_Command_Mode. */
  433. uint32_t CommandTarget; /*!< Defines which device (1 or 2) the command will be issued to.
  434. This parameter can be a value of @ref FMC_SDRAM_Command_Target. */
  435. uint32_t AutoRefreshNumber; /*!< Defines the number of consecutive auto refresh command issued
  436. in auto refresh mode.
  437. This parameter can be a value between Min_Data = 1 and Max_Data = 15 */
  438. uint32_t ModeRegisterDefinition; /*!< Defines the SDRAM Mode register content */
  439. } FMC_SDRAM_CommandTypeDef;
  440. #endif /* FMC_Bank5_6 */
  441. /**
  442. * @}
  443. */
  444. /* Exported constants --------------------------------------------------------*/
  445. /** @addtogroup FMC_LL_Exported_Constants FMC Low Layer Exported Constants
  446. * @{
  447. */
  448. #if defined(FMC_Bank1)
  449. /** @defgroup FMC_LL_NOR_SRAM_Controller FMC NOR/SRAM Controller
  450. * @{
  451. */
  452. /** @defgroup FMC_NORSRAM_Bank FMC NOR/SRAM Bank
  453. * @{
  454. */
  455. #define FMC_NORSRAM_BANK1 (0x00000000U)
  456. #define FMC_NORSRAM_BANK2 (0x00000002U)
  457. #define FMC_NORSRAM_BANK3 (0x00000004U)
  458. #define FMC_NORSRAM_BANK4 (0x00000006U)
  459. /**
  460. * @}
  461. */
  462. /** @defgroup FMC_Data_Address_Bus_Multiplexing FMC Data Address Bus Multiplexing
  463. * @{
  464. */
  465. #define FMC_DATA_ADDRESS_MUX_DISABLE (0x00000000U)
  466. #define FMC_DATA_ADDRESS_MUX_ENABLE (0x00000002U)
  467. /**
  468. * @}
  469. */
  470. /** @defgroup FMC_Memory_Type FMC Memory Type
  471. * @{
  472. */
  473. #define FMC_MEMORY_TYPE_SRAM (0x00000000U)
  474. #define FMC_MEMORY_TYPE_PSRAM (0x00000004U)
  475. #define FMC_MEMORY_TYPE_NOR (0x00000008U)
  476. /**
  477. * @}
  478. */
  479. /** @defgroup FMC_NORSRAM_Data_Width FMC NORSRAM Data Width
  480. * @{
  481. */
  482. #define FMC_NORSRAM_MEM_BUS_WIDTH_8 (0x00000000U)
  483. #define FMC_NORSRAM_MEM_BUS_WIDTH_16 (0x00000010U)
  484. #define FMC_NORSRAM_MEM_BUS_WIDTH_32 (0x00000020U)
  485. /**
  486. * @}
  487. */
  488. /** @defgroup FMC_NORSRAM_Flash_Access FMC NOR/SRAM Flash Access
  489. * @{
  490. */
  491. #define FMC_NORSRAM_FLASH_ACCESS_ENABLE (0x00000040U)
  492. #define FMC_NORSRAM_FLASH_ACCESS_DISABLE (0x00000000U)
  493. /**
  494. * @}
  495. */
  496. /** @defgroup FMC_Burst_Access_Mode FMC Burst Access Mode
  497. * @{
  498. */
  499. #define FMC_BURST_ACCESS_MODE_DISABLE (0x00000000U)
  500. #define FMC_BURST_ACCESS_MODE_ENABLE (0x00000100U)
  501. /**
  502. * @}
  503. */
  504. /** @defgroup FMC_Wait_Signal_Polarity FMC Wait Signal Polarity
  505. * @{
  506. */
  507. #define FMC_WAIT_SIGNAL_POLARITY_LOW (0x00000000U)
  508. #define FMC_WAIT_SIGNAL_POLARITY_HIGH (0x00000200U)
  509. /**
  510. * @}
  511. */
  512. /** @defgroup FMC_Wrap_Mode FMC Wrap Mode
  513. * @note This mode is not available for the STM32F446/469/479xx devices
  514. * @{
  515. */
  516. #define FMC_WRAP_MODE_DISABLE (0x00000000U)
  517. #define FMC_WRAP_MODE_ENABLE (0x00000400U)
  518. /**
  519. * @}
  520. */
  521. /** @defgroup FMC_Wait_Timing FMC Wait Timing
  522. * @{
  523. */
  524. #define FMC_WAIT_TIMING_BEFORE_WS (0x00000000U)
  525. #define FMC_WAIT_TIMING_DURING_WS (0x00000800U)
  526. /**
  527. * @}
  528. */
  529. /** @defgroup FMC_Write_Operation FMC Write Operation
  530. * @{
  531. */
  532. #define FMC_WRITE_OPERATION_DISABLE (0x00000000U)
  533. #define FMC_WRITE_OPERATION_ENABLE (0x00001000U)
  534. /**
  535. * @}
  536. */
  537. /** @defgroup FMC_Wait_Signal FMC Wait Signal
  538. * @{
  539. */
  540. #define FMC_WAIT_SIGNAL_DISABLE (0x00000000U)
  541. #define FMC_WAIT_SIGNAL_ENABLE (0x00002000U)
  542. /**
  543. * @}
  544. */
  545. /** @defgroup FMC_Extended_Mode FMC Extended Mode
  546. * @{
  547. */
  548. #define FMC_EXTENDED_MODE_DISABLE (0x00000000U)
  549. #define FMC_EXTENDED_MODE_ENABLE (0x00004000U)
  550. /**
  551. * @}
  552. */
  553. /** @defgroup FMC_AsynchronousWait FMC Asynchronous Wait
  554. * @{
  555. */
  556. #define FMC_ASYNCHRONOUS_WAIT_DISABLE (0x00000000U)
  557. #define FMC_ASYNCHRONOUS_WAIT_ENABLE (0x00008000U)
  558. /**
  559. * @}
  560. */
  561. /** @defgroup FMC_Page_Size FMC Page Size
  562. * @{
  563. */
  564. #define FMC_PAGE_SIZE_NONE (0x00000000U)
  565. #define FMC_PAGE_SIZE_128 FMC_BCR1_CPSIZE_0
  566. #define FMC_PAGE_SIZE_256 FMC_BCR1_CPSIZE_1
  567. #define FMC_PAGE_SIZE_512 (FMC_BCR1_CPSIZE_0\
  568. | FMC_BCR1_CPSIZE_1)
  569. #define FMC_PAGE_SIZE_1024 FMC_BCR1_CPSIZE_2
  570. /**
  571. * @}
  572. */
  573. /** @defgroup FMC_Write_Burst FMC Write Burst
  574. * @{
  575. */
  576. #define FMC_WRITE_BURST_DISABLE (0x00000000U)
  577. #define FMC_WRITE_BURST_ENABLE (0x00080000U)
  578. /**
  579. * @}
  580. */
  581. /** @defgroup FMC_Continous_Clock FMC Continuous Clock
  582. * @{
  583. */
  584. #define FMC_CONTINUOUS_CLOCK_SYNC_ONLY (0x00000000U)
  585. #define FMC_CONTINUOUS_CLOCK_SYNC_ASYNC (0x00100000U)
  586. /**
  587. * @}
  588. */
  589. #if defined(FMC_BCR1_WFDIS)
  590. /** @defgroup FMC_Write_FIFO FMC Write FIFO
  591. * @note These values are available only for the STM32F446/469/479xx devices.
  592. * @{
  593. */
  594. #define FMC_WRITE_FIFO_DISABLE FMC_BCR1_WFDIS
  595. #define FMC_WRITE_FIFO_ENABLE (0x00000000U)
  596. #endif /* FMC_BCR1_WFDIS */
  597. /**
  598. * @}
  599. */
  600. /** @defgroup FMC_Access_Mode FMC Access Mode
  601. * @{
  602. */
  603. #define FMC_ACCESS_MODE_A (0x00000000U)
  604. #define FMC_ACCESS_MODE_B (0x10000000U)
  605. #define FMC_ACCESS_MODE_C (0x20000000U)
  606. #define FMC_ACCESS_MODE_D (0x30000000U)
  607. /**
  608. * @}
  609. */
  610. /**
  611. * @}
  612. */
  613. #endif /* FMC_Bank1 */
  614. #if defined(FMC_Bank3) || defined(FMC_Bank2_3) || defined(FMC_Bank4)
  615. /** @defgroup FMC_LL_NAND_Controller FMC NAND Controller
  616. * @{
  617. */
  618. /** @defgroup FMC_NAND_Bank FMC NAND Bank
  619. * @{
  620. */
  621. #if defined(FMC_Bank2_3)
  622. #define FMC_NAND_BANK2 (0x00000010U)
  623. #endif /* FMC_Bank2_3 */
  624. #define FMC_NAND_BANK3 (0x00000100U)
  625. /**
  626. * @}
  627. */
  628. /** @defgroup FMC_Wait_feature FMC Wait feature
  629. * @{
  630. */
  631. #define FMC_NAND_PCC_WAIT_FEATURE_DISABLE (0x00000000U)
  632. #define FMC_NAND_PCC_WAIT_FEATURE_ENABLE (0x00000002U)
  633. /**
  634. * @}
  635. */
  636. /** @defgroup FMC_PCR_Memory_Type FMC PCR Memory Type
  637. * @{
  638. */
  639. #if defined(FMC_Bank4)
  640. #define FMC_PCR_MEMORY_TYPE_PCCARD (0x00000000U)
  641. #endif /* FMC_Bank4 */
  642. #define FMC_PCR_MEMORY_TYPE_NAND (0x00000008U)
  643. /**
  644. * @}
  645. */
  646. /** @defgroup FMC_NAND_Data_Width FMC NAND Data Width
  647. * @{
  648. */
  649. #define FMC_NAND_PCC_MEM_BUS_WIDTH_8 (0x00000000U)
  650. #define FMC_NAND_PCC_MEM_BUS_WIDTH_16 (0x00000010U)
  651. /**
  652. * @}
  653. */
  654. /** @defgroup FMC_ECC FMC ECC
  655. * @{
  656. */
  657. #define FMC_NAND_ECC_DISABLE (0x00000000U)
  658. #define FMC_NAND_ECC_ENABLE (0x00000040U)
  659. /**
  660. * @}
  661. */
  662. /** @defgroup FMC_ECC_Page_Size FMC ECC Page Size
  663. * @{
  664. */
  665. #define FMC_NAND_ECC_PAGE_SIZE_256BYTE (0x00000000U)
  666. #define FMC_NAND_ECC_PAGE_SIZE_512BYTE (0x00020000U)
  667. #define FMC_NAND_ECC_PAGE_SIZE_1024BYTE (0x00040000U)
  668. #define FMC_NAND_ECC_PAGE_SIZE_2048BYTE (0x00060000U)
  669. #define FMC_NAND_ECC_PAGE_SIZE_4096BYTE (0x00080000U)
  670. #define FMC_NAND_ECC_PAGE_SIZE_8192BYTE (0x000A0000U)
  671. /**
  672. * @}
  673. */
  674. /**
  675. * @}
  676. */
  677. #endif /* FMC_Bank3 || FMC_Bank2_3 || FMC_Bank4 */
  678. #if defined(FMC_Bank5_6)
  679. /** @defgroup FMC_LL_SDRAM_Controller FMC SDRAM Controller
  680. * @{
  681. */
  682. /** @defgroup FMC_SDRAM_Bank FMC SDRAM Bank
  683. * @{
  684. */
  685. #define FMC_SDRAM_BANK1 (0x00000000U)
  686. #define FMC_SDRAM_BANK2 (0x00000001U)
  687. /**
  688. * @}
  689. */
  690. /** @defgroup FMC_SDRAM_Column_Bits_number FMC SDRAM Column Bits number
  691. * @{
  692. */
  693. #define FMC_SDRAM_COLUMN_BITS_NUM_8 (0x00000000U)
  694. #define FMC_SDRAM_COLUMN_BITS_NUM_9 (0x00000001U)
  695. #define FMC_SDRAM_COLUMN_BITS_NUM_10 (0x00000002U)
  696. #define FMC_SDRAM_COLUMN_BITS_NUM_11 (0x00000003U)
  697. /**
  698. * @}
  699. */
  700. /** @defgroup FMC_SDRAM_Row_Bits_number FMC SDRAM Row Bits number
  701. * @{
  702. */
  703. #define FMC_SDRAM_ROW_BITS_NUM_11 (0x00000000U)
  704. #define FMC_SDRAM_ROW_BITS_NUM_12 (0x00000004U)
  705. #define FMC_SDRAM_ROW_BITS_NUM_13 (0x00000008U)
  706. /**
  707. * @}
  708. */
  709. /** @defgroup FMC_SDRAM_Memory_Bus_Width FMC SDRAM Memory Bus Width
  710. * @{
  711. */
  712. #define FMC_SDRAM_MEM_BUS_WIDTH_8 (0x00000000U)
  713. #define FMC_SDRAM_MEM_BUS_WIDTH_16 (0x00000010U)
  714. #define FMC_SDRAM_MEM_BUS_WIDTH_32 (0x00000020U)
  715. /**
  716. * @}
  717. */
  718. /** @defgroup FMC_SDRAM_Internal_Banks_Number FMC SDRAM Internal Banks Number
  719. * @{
  720. */
  721. #define FMC_SDRAM_INTERN_BANKS_NUM_2 (0x00000000U)
  722. #define FMC_SDRAM_INTERN_BANKS_NUM_4 (0x00000040U)
  723. /**
  724. * @}
  725. */
  726. /** @defgroup FMC_SDRAM_CAS_Latency FMC SDRAM CAS Latency
  727. * @{
  728. */
  729. #define FMC_SDRAM_CAS_LATENCY_1 (0x00000080U)
  730. #define FMC_SDRAM_CAS_LATENCY_2 (0x00000100U)
  731. #define FMC_SDRAM_CAS_LATENCY_3 (0x00000180U)
  732. /**
  733. * @}
  734. */
  735. /** @defgroup FMC_SDRAM_Write_Protection FMC SDRAM Write Protection
  736. * @{
  737. */
  738. #define FMC_SDRAM_WRITE_PROTECTION_DISABLE (0x00000000U)
  739. #define FMC_SDRAM_WRITE_PROTECTION_ENABLE (0x00000200U)
  740. /**
  741. * @}
  742. */
  743. /** @defgroup FMC_SDRAM_Clock_Period FMC SDRAM Clock Period
  744. * @{
  745. */
  746. #define FMC_SDRAM_CLOCK_DISABLE (0x00000000U)
  747. #define FMC_SDRAM_CLOCK_PERIOD_2 (0x00000800U)
  748. #define FMC_SDRAM_CLOCK_PERIOD_3 (0x00000C00U)
  749. /**
  750. * @}
  751. */
  752. /** @defgroup FMC_SDRAM_Read_Burst FMC SDRAM Read Burst
  753. * @{
  754. */
  755. #define FMC_SDRAM_RBURST_DISABLE (0x00000000U)
  756. #define FMC_SDRAM_RBURST_ENABLE (0x00001000U)
  757. /**
  758. * @}
  759. */
  760. /** @defgroup FMC_SDRAM_Read_Pipe_Delay FMC SDRAM Read Pipe Delay
  761. * @{
  762. */
  763. #define FMC_SDRAM_RPIPE_DELAY_0 (0x00000000U)
  764. #define FMC_SDRAM_RPIPE_DELAY_1 (0x00002000U)
  765. #define FMC_SDRAM_RPIPE_DELAY_2 (0x00004000U)
  766. /**
  767. * @}
  768. */
  769. /** @defgroup FMC_SDRAM_Command_Mode FMC SDRAM Command Mode
  770. * @{
  771. */
  772. #define FMC_SDRAM_CMD_NORMAL_MODE (0x00000000U)
  773. #define FMC_SDRAM_CMD_CLK_ENABLE (0x00000001U)
  774. #define FMC_SDRAM_CMD_PALL (0x00000002U)
  775. #define FMC_SDRAM_CMD_AUTOREFRESH_MODE (0x00000003U)
  776. #define FMC_SDRAM_CMD_LOAD_MODE (0x00000004U)
  777. #define FMC_SDRAM_CMD_SELFREFRESH_MODE (0x00000005U)
  778. #define FMC_SDRAM_CMD_POWERDOWN_MODE (0x00000006U)
  779. /**
  780. * @}
  781. */
  782. /** @defgroup FMC_SDRAM_Command_Target FMC SDRAM Command Target
  783. * @{
  784. */
  785. #define FMC_SDRAM_CMD_TARGET_BANK2 FMC_SDCMR_CTB2
  786. #define FMC_SDRAM_CMD_TARGET_BANK1 FMC_SDCMR_CTB1
  787. #define FMC_SDRAM_CMD_TARGET_BANK1_2 (0x00000018U)
  788. /**
  789. * @}
  790. */
  791. /** @defgroup FMC_SDRAM_Mode_Status FMC SDRAM Mode Status
  792. * @{
  793. */
  794. #define FMC_SDRAM_NORMAL_MODE (0x00000000U)
  795. #define FMC_SDRAM_SELF_REFRESH_MODE FMC_SDSR_MODES1_0
  796. #define FMC_SDRAM_POWER_DOWN_MODE FMC_SDSR_MODES1_1
  797. /**
  798. * @}
  799. */
  800. /**
  801. * @}
  802. */
  803. #endif /* FMC_Bank5_6 */
  804. /** @defgroup FMC_LL_Interrupt_definition FMC Low Layer Interrupt definition
  805. * @{
  806. */
  807. #if defined(FMC_Bank3) || defined(FMC_Bank2_3) || defined(FMC_Bank4)
  808. #define FMC_IT_RISING_EDGE (0x00000008U)
  809. #define FMC_IT_LEVEL (0x00000010U)
  810. #define FMC_IT_FALLING_EDGE (0x00000020U)
  811. #endif /* FMC_Bank3 || FMC_Bank2_3 || FMC_Bank4 */
  812. #if defined(FMC_Bank5_6)
  813. #define FMC_IT_REFRESH_ERROR (0x00004000U)
  814. #endif /* FMC_Bank5_6 */
  815. /**
  816. * @}
  817. */
  818. /** @defgroup FMC_LL_Flag_definition FMC Low Layer Flag definition
  819. * @{
  820. */
  821. #if defined(FMC_Bank3) || defined(FMC_Bank2_3) || defined(FMC_Bank4)
  822. #define FMC_FLAG_RISING_EDGE (0x00000001U)
  823. #define FMC_FLAG_LEVEL (0x00000002U)
  824. #define FMC_FLAG_FALLING_EDGE (0x00000004U)
  825. #define FMC_FLAG_FEMPT (0x00000040U)
  826. #endif /* FMC_Bank3 || FMC_Bank2_3 || FMC_Bank4 */
  827. #if defined(FMC_Bank5_6)
  828. #define FMC_SDRAM_FLAG_REFRESH_IT FMC_SDSR_RE
  829. #define FMC_SDRAM_FLAG_BUSY FMC_SDSR_BUSY
  830. #define FMC_SDRAM_FLAG_REFRESH_ERROR FMC_SDRTR_CRE
  831. #endif /* FMC_Bank5_6 */
  832. /**
  833. * @}
  834. */
  835. /**
  836. * @}
  837. */
  838. /**
  839. * @}
  840. */
  841. /* Private macro -------------------------------------------------------------*/
  842. /** @defgroup FMC_LL_Private_Macros FMC_LL Private Macros
  843. * @{
  844. */
  845. #if defined(FMC_Bank1)
  846. /** @defgroup FMC_LL_NOR_Macros FMC NOR/SRAM Macros
  847. * @brief macros to handle NOR device enable/disable and read/write operations
  848. * @{
  849. */
  850. /**
  851. * @brief Enable the NORSRAM device access.
  852. * @param __INSTANCE__ FMC_NORSRAM Instance
  853. * @param __BANK__ FMC_NORSRAM Bank
  854. * @retval None
  855. */
  856. #define __FMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)]\
  857. |= FMC_BCR1_MBKEN)
  858. /**
  859. * @brief Disable the NORSRAM device access.
  860. * @param __INSTANCE__ FMC_NORSRAM Instance
  861. * @param __BANK__ FMC_NORSRAM Bank
  862. * @retval None
  863. */
  864. #define __FMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)]\
  865. &= ~FMC_BCR1_MBKEN)
  866. /**
  867. * @}
  868. */
  869. #endif /* FMC_Bank1 */
  870. #if defined(FMC_Bank3) || defined(FMC_Bank2_3)
  871. /** @defgroup FMC_LL_NAND_Macros FMC NAND Macros
  872. * @brief macros to handle NAND device enable/disable
  873. * @{
  874. */
  875. /**
  876. * @brief Enable the NAND device access.
  877. * @param __INSTANCE__ FMC_NAND Instance
  878. * @param __BANK__ FMC_NAND Bank
  879. * @retval None
  880. */
  881. #if defined(FMC_Bank2_3)
  882. #if defined (FMC_PCR_PBKEN)
  883. #define __FMC_NAND_ENABLE(__INSTANCE__) ((__INSTANCE__)->PCR |= FMC_PCR_PBKEN)
  884. #else
  885. #define __FMC_NAND_ENABLE(__INSTANCE__, __BANK__) (((__BANK__) == FMC_NAND_BANK2) ? \
  886. ((__INSTANCE__)->PCR2 |= FMC_PCR2_PBKEN) : \
  887. ((__INSTANCE__)->PCR3 |= FMC_PCR3_PBKEN))
  888. #endif /* FMC_PCR_PBKEN */
  889. #else
  890. #define __FMC_NAND_ENABLE(__INSTANCE__) ((__INSTANCE__)->PCR |= FMC_PCR_PBKEN)
  891. #endif /* FMC_Bank2_3 */
  892. /**
  893. * @brief Disable the NAND device access.
  894. * @param __INSTANCE__ FMC_NAND Instance
  895. * @param __BANK__ FMC_NAND Bank
  896. * @retval None
  897. */
  898. #if defined(FMC_Bank2_3)
  899. #if defined (FMC_PCR_PBKEN)
  900. #define __FMC_NAND_DISABLE(__INSTANCE__, __BANK__) CLEAR_BIT((__INSTANCE__)->PCR, FMC_PCR_PBKEN)
  901. #else
  902. #define __FMC_NAND_DISABLE(__INSTANCE__, __BANK__) (((__BANK__) == FMC_NAND_BANK2) ? \
  903. CLEAR_BIT((__INSTANCE__)->PCR2, FMC_PCR2_PBKEN) : \
  904. CLEAR_BIT((__INSTANCE__)->PCR3, FMC_PCR3_PBKEN))
  905. #endif /* FMC_PCR_PBKEN */
  906. #else
  907. #define __FMC_NAND_DISABLE(__INSTANCE__, __BANK__) CLEAR_BIT((__INSTANCE__)->PCR, FMC_PCR_PBKEN)
  908. #endif /* FMC_Bank2_3 */
  909. /**
  910. * @}
  911. */
  912. #endif /* FMC_Bank3 || FMC_Bank2_3 */
  913. #if defined(FMC_Bank4)
  914. /** @defgroup FMC_LL_PCCARD_Macros FMC PCCARD Macros
  915. * @brief macros to handle PCCARD read/write operations
  916. * @{
  917. */
  918. /**
  919. * @brief Enable the PCCARD device access.
  920. * @param __INSTANCE__ FMC_PCCARD Instance
  921. * @retval None
  922. */
  923. #define __FMC_PCCARD_ENABLE(__INSTANCE__) ((__INSTANCE__)->PCR4 |= FMC_PCR4_PBKEN)
  924. /**
  925. * @brief Disable the PCCARD device access.
  926. * @param __INSTANCE__ FMC_PCCARD Instance
  927. * @retval None
  928. */
  929. #define __FMC_PCCARD_DISABLE(__INSTANCE__) ((__INSTANCE__)->PCR4 &= ~FMC_PCR4_PBKEN)
  930. /**
  931. * @}
  932. */
  933. #endif /* FMC_Bank4 */
  934. #if defined(FMC_Bank3) || defined(FMC_Bank2_3)
  935. /** @defgroup FMC_LL_NAND_Interrupt FMC NAND Interrupt
  936. * @brief macros to handle NAND interrupts
  937. * @{
  938. */
  939. /**
  940. * @brief Enable the NAND device interrupt.
  941. * @param __INSTANCE__ FMC_NAND instance
  942. * @param __BANK__ FMC_NAND Bank
  943. * @param __INTERRUPT__ FMC_NAND interrupt
  944. * This parameter can be any combination of the following values:
  945. * @arg FMC_IT_RISING_EDGE: Interrupt rising edge.
  946. * @arg FMC_IT_LEVEL: Interrupt level.
  947. * @arg FMC_IT_FALLING_EDGE: Interrupt falling edge.
  948. * @retval None
  949. */
  950. #if defined(FMC_Bank2_3)
  951. #define __FMC_NAND_ENABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) (((__BANK__) == FMC_NAND_BANK2) ? \
  952. ((__INSTANCE__)->SR2 |= (__INTERRUPT__)) : \
  953. ((__INSTANCE__)->SR3 |= (__INTERRUPT__)))
  954. #else
  955. #define __FMC_NAND_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR |= (__INTERRUPT__))
  956. #endif /* FMC_Bank2_3 */
  957. /**
  958. * @brief Disable the NAND device interrupt.
  959. * @param __INSTANCE__ FMC_NAND Instance
  960. * @param __BANK__ FMC_NAND Bank
  961. * @param __INTERRUPT__ FMC_NAND interrupt
  962. * This parameter can be any combination of the following values:
  963. * @arg FMC_IT_RISING_EDGE: Interrupt rising edge.
  964. * @arg FMC_IT_LEVEL: Interrupt level.
  965. * @arg FMC_IT_FALLING_EDGE: Interrupt falling edge.
  966. * @retval None
  967. */
  968. #if defined(FMC_Bank2_3)
  969. #define __FMC_NAND_DISABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) (((__BANK__) == FMC_NAND_BANK2) ? \
  970. ((__INSTANCE__)->SR2 &= ~(__INTERRUPT__)) : \
  971. ((__INSTANCE__)->SR3 &= ~(__INTERRUPT__)))
  972. #else
  973. #define __FMC_NAND_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR &= ~(__INTERRUPT__))
  974. #endif /* FMC_Bank2_3 */
  975. /**
  976. * @brief Get flag status of the NAND device.
  977. * @param __INSTANCE__ FMC_NAND Instance
  978. * @param __BANK__ FMC_NAND Bank
  979. * @param __FLAG__ FMC_NAND flag
  980. * This parameter can be any combination of the following values:
  981. * @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  982. * @arg FMC_FLAG_LEVEL: Interrupt level edge flag.
  983. * @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  984. * @arg FMC_FLAG_FEMPT: FIFO empty flag.
  985. * @retval The state of FLAG (SET or RESET).
  986. */
  987. #if defined(FMC_Bank2_3)
  988. #define __FMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FMC_NAND_BANK2) ? \
  989. (((__INSTANCE__)->SR2 &(__FLAG__)) == (__FLAG__)) : \
  990. (((__INSTANCE__)->SR3 &(__FLAG__)) == (__FLAG__)))
  991. #else
  992. #define __FMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__INSTANCE__)->SR &(__FLAG__)) == (__FLAG__))
  993. #endif /* FMC_Bank2_3 */
  994. /**
  995. * @brief Clear flag status of the NAND device.
  996. * @param __INSTANCE__ FMC_NAND Instance
  997. * @param __BANK__ FMC_NAND Bank
  998. * @param __FLAG__ FMC_NAND flag
  999. * This parameter can be any combination of the following values:
  1000. * @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  1001. * @arg FMC_FLAG_LEVEL: Interrupt level edge flag.
  1002. * @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  1003. * @arg FMC_FLAG_FEMPT: FIFO empty flag.
  1004. * @retval None
  1005. */
  1006. #if defined(FMC_Bank2_3)
  1007. #define __FMC_NAND_CLEAR_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FMC_NAND_BANK2) ? \
  1008. ((__INSTANCE__)->SR2 &= ~(__FLAG__)) : \
  1009. ((__INSTANCE__)->SR3 &= ~(__FLAG__)))
  1010. #else
  1011. #define __FMC_NAND_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SR &= ~(__FLAG__))
  1012. #endif /* FMC_Bank2_3 */
  1013. /**
  1014. * @}
  1015. */
  1016. #endif /* FMC_Bank3) || defined(FMC_Bank2_3 */
  1017. #if defined(FMC_Bank4)
  1018. /** @defgroup FMC_LL_PCCARD_Interrupt FMC PCCARD Interrupt
  1019. * @brief macros to handle PCCARD interrupts
  1020. * @{
  1021. */
  1022. /**
  1023. * @brief Enable the PCCARD device interrupt.
  1024. * @param __INSTANCE__ FMC_PCCARD instance
  1025. * @param __INTERRUPT__ FMC_PCCARD interrupt
  1026. * This parameter can be any combination of the following values:
  1027. * @arg FMC_IT_RISING_EDGE: Interrupt rising edge.
  1028. * @arg FMC_IT_LEVEL: Interrupt level.
  1029. * @arg FMC_IT_FALLING_EDGE: Interrupt falling edge.
  1030. * @retval None
  1031. */
  1032. #define __FMC_PCCARD_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR4 |= (__INTERRUPT__))
  1033. /**
  1034. * @brief Disable the PCCARD device interrupt.
  1035. * @param __INSTANCE__ FMC_PCCARD instance
  1036. * @param __INTERRUPT__ FMC_PCCARD interrupt
  1037. * This parameter can be any combination of the following values:
  1038. * @arg FMC_IT_RISING_EDGE: Interrupt rising edge.
  1039. * @arg FMC_IT_LEVEL: Interrupt level.
  1040. * @arg FMC_IT_FALLING_EDGE: Interrupt falling edge.
  1041. * @retval None
  1042. */
  1043. #define __FMC_PCCARD_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR4 &= ~(__INTERRUPT__))
  1044. /**
  1045. * @brief Get flag status of the PCCARD device.
  1046. * @param __INSTANCE__ FMC_PCCARD instance
  1047. * @param __FLAG__ FMC_PCCARD flag
  1048. * This parameter can be any combination of the following values:
  1049. * @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  1050. * @arg FMC_FLAG_LEVEL: Interrupt level edge flag.
  1051. * @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  1052. * @arg FMC_FLAG_FEMPT: FIFO empty flag.
  1053. * @retval The state of FLAG (SET or RESET).
  1054. */
  1055. #define __FMC_PCCARD_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->SR4 &(__FLAG__)) == (__FLAG__))
  1056. /**
  1057. * @brief Clear flag status of the PCCARD device.
  1058. * @param __INSTANCE__ FMC_PCCARD instance
  1059. * @param __FLAG__ FMC_PCCARD flag
  1060. * This parameter can be any combination of the following values:
  1061. * @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  1062. * @arg FMC_FLAG_LEVEL: Interrupt level edge flag.
  1063. * @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  1064. * @arg FMC_FLAG_FEMPT: FIFO empty flag.
  1065. * @retval None
  1066. */
  1067. #define __FMC_PCCARD_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SR4 &= ~(__FLAG__))
  1068. /**
  1069. * @}
  1070. */
  1071. #endif /* FMC_Bank4 */
  1072. #if defined(FMC_Bank5_6)
  1073. /** @defgroup FMC_LL_SDRAM_Interrupt FMC SDRAM Interrupt
  1074. * @brief macros to handle SDRAM interrupts
  1075. * @{
  1076. */
  1077. /**
  1078. * @brief Enable the SDRAM device interrupt.
  1079. * @param __INSTANCE__ FMC_SDRAM instance
  1080. * @param __INTERRUPT__ FMC_SDRAM interrupt
  1081. * This parameter can be any combination of the following values:
  1082. * @arg FMC_IT_REFRESH_ERROR: Interrupt refresh error
  1083. * @retval None
  1084. */
  1085. #define __FMC_SDRAM_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SDRTR |= (__INTERRUPT__))
  1086. /**
  1087. * @brief Disable the SDRAM device interrupt.
  1088. * @param __INSTANCE__ FMC_SDRAM instance
  1089. * @param __INTERRUPT__ FMC_SDRAM interrupt
  1090. * This parameter can be any combination of the following values:
  1091. * @arg FMC_IT_REFRESH_ERROR: Interrupt refresh error
  1092. * @retval None
  1093. */
  1094. #define __FMC_SDRAM_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SDRTR &= ~(__INTERRUPT__))
  1095. /**
  1096. * @brief Get flag status of the SDRAM device.
  1097. * @param __INSTANCE__ FMC_SDRAM instance
  1098. * @param __FLAG__ FMC_SDRAM flag
  1099. * This parameter can be any combination of the following values:
  1100. * @arg FMC_SDRAM_FLAG_REFRESH_IT: Interrupt refresh error.
  1101. * @arg FMC_SDRAM_FLAG_BUSY: SDRAM busy flag.
  1102. * @arg FMC_SDRAM_FLAG_REFRESH_ERROR: Refresh error flag.
  1103. * @retval The state of FLAG (SET or RESET).
  1104. */
  1105. #define __FMC_SDRAM_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->SDSR &(__FLAG__)) == (__FLAG__))
  1106. /**
  1107. * @brief Clear flag status of the SDRAM device.
  1108. * @param __INSTANCE__ FMC_SDRAM instance
  1109. * @param __FLAG__ FMC_SDRAM flag
  1110. * This parameter can be any combination of the following values:
  1111. * @arg FMC_SDRAM_FLAG_REFRESH_ERROR
  1112. * @retval None
  1113. */
  1114. #define __FMC_SDRAM_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SDRTR |= (__FLAG__))
  1115. /**
  1116. * @}
  1117. */
  1118. #endif /* FMC_Bank5_6 */
  1119. /**
  1120. * @}
  1121. */
  1122. /**
  1123. * @}
  1124. */
  1125. /* Private functions ---------------------------------------------------------*/
  1126. /** @defgroup FMC_LL_Private_Functions FMC LL Private Functions
  1127. * @{
  1128. */
  1129. #if defined(FMC_Bank1)
  1130. /** @defgroup FMC_LL_NORSRAM NOR SRAM
  1131. * @{
  1132. */
  1133. /** @defgroup FMC_LL_NORSRAM_Private_Functions_Group1 NOR SRAM Initialization/de-initialization functions
  1134. * @{
  1135. */
  1136. HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device,
  1137. const FMC_NORSRAM_InitTypeDef *Init);
  1138. HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device,
  1139. const FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank);
  1140. HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device,
  1141. const FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank,
  1142. uint32_t ExtendedMode);
  1143. HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device,
  1144. FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank);
  1145. /**
  1146. * @}
  1147. */
  1148. /** @defgroup FMC_LL_NORSRAM_Private_Functions_Group2 NOR SRAM Control functions
  1149. * @{
  1150. */
  1151. HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Enable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank);
  1152. HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank);
  1153. /**
  1154. * @}
  1155. */
  1156. /**
  1157. * @}
  1158. */
  1159. #endif /* FMC_Bank1 */
  1160. #if defined(FMC_Bank3) || defined(FMC_Bank2_3)
  1161. /** @defgroup FMC_LL_NAND NAND
  1162. * @{
  1163. */
  1164. /** @defgroup FMC_LL_NAND_Private_Functions_Group1 NAND Initialization/de-initialization functions
  1165. * @{
  1166. */
  1167. HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, const FMC_NAND_InitTypeDef *Init);
  1168. HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device,
  1169. const FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
  1170. HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device,
  1171. const FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
  1172. HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank);
  1173. /**
  1174. * @}
  1175. */
  1176. /** @defgroup FMC_LL_NAND_Private_Functions_Group2 NAND Control functions
  1177. * @{
  1178. */
  1179. HAL_StatusTypeDef FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank);
  1180. HAL_StatusTypeDef FMC_NAND_ECC_Disable(FMC_NAND_TypeDef *Device, uint32_t Bank);
  1181. HAL_StatusTypeDef FMC_NAND_GetECC(const FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank,
  1182. uint32_t Timeout);
  1183. /**
  1184. * @}
  1185. */
  1186. /**
  1187. * @}
  1188. */
  1189. #endif /* FMC_Bank3) || defined(FMC_Bank2_3 */
  1190. #if defined(FMC_Bank4)
  1191. /** @defgroup FMC_LL_PCCARD PCCARD
  1192. * @{
  1193. */
  1194. /** @defgroup FMC_LL_PCCARD_Private_Functions_Group1 PCCARD Initialization/de-initialization functions
  1195. * @{
  1196. */
  1197. HAL_StatusTypeDef FMC_PCCARD_Init(FMC_PCCARD_TypeDef *Device, const FMC_PCCARD_InitTypeDef *Init);
  1198. HAL_StatusTypeDef FMC_PCCARD_CommonSpace_Timing_Init(FMC_PCCARD_TypeDef *Device,
  1199. const FMC_NAND_PCC_TimingTypeDef *Timing);
  1200. HAL_StatusTypeDef FMC_PCCARD_AttributeSpace_Timing_Init(FMC_PCCARD_TypeDef *Device,
  1201. const FMC_NAND_PCC_TimingTypeDef *Timing);
  1202. HAL_StatusTypeDef FMC_PCCARD_IOSpace_Timing_Init(FMC_PCCARD_TypeDef *Device,
  1203. const FMC_NAND_PCC_TimingTypeDef *Timing);
  1204. HAL_StatusTypeDef FMC_PCCARD_DeInit(FMC_PCCARD_TypeDef *Device);
  1205. /**
  1206. * @}
  1207. */
  1208. /**
  1209. * @}
  1210. */
  1211. #endif /* FMC_Bank4 */
  1212. #if defined(FMC_Bank5_6)
  1213. /** @defgroup FMC_LL_SDRAM SDRAM
  1214. * @{
  1215. */
  1216. /** @defgroup FMC_LL_SDRAM_Private_Functions_Group1 SDRAM Initialization/de-initialization functions
  1217. * @{
  1218. */
  1219. HAL_StatusTypeDef FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, const FMC_SDRAM_InitTypeDef *Init);
  1220. HAL_StatusTypeDef FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device,
  1221. const FMC_SDRAM_TimingTypeDef *Timing, uint32_t Bank);
  1222. HAL_StatusTypeDef FMC_SDRAM_DeInit(FMC_SDRAM_TypeDef *Device, uint32_t Bank);
  1223. /**
  1224. * @}
  1225. */
  1226. /** @defgroup FMC_LL_SDRAM_Private_Functions_Group2 SDRAM Control functions
  1227. * @{
  1228. */
  1229. HAL_StatusTypeDef FMC_SDRAM_WriteProtection_Enable(FMC_SDRAM_TypeDef *Device, uint32_t Bank);
  1230. HAL_StatusTypeDef FMC_SDRAM_WriteProtection_Disable(FMC_SDRAM_TypeDef *Device, uint32_t Bank);
  1231. HAL_StatusTypeDef FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device,
  1232. const FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout);
  1233. HAL_StatusTypeDef FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, uint32_t RefreshRate);
  1234. HAL_StatusTypeDef FMC_SDRAM_SetAutoRefreshNumber(FMC_SDRAM_TypeDef *Device,
  1235. uint32_t AutoRefreshNumber);
  1236. uint32_t FMC_SDRAM_GetModeStatus(const FMC_SDRAM_TypeDef *Device, uint32_t Bank);
  1237. /**
  1238. * @}
  1239. */
  1240. /**
  1241. * @}
  1242. */
  1243. #endif /* FMC_Bank5_6 */
  1244. /**
  1245. * @}
  1246. */
  1247. /**
  1248. * @}
  1249. */
  1250. /**
  1251. * @}
  1252. */
  1253. #ifdef __cplusplus
  1254. }
  1255. #endif
  1256. #endif /* STM32F4xx_LL_FMC_H */