训练营PLSR题目
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.
 
 
 
 
 
 

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