stm32f4xx_fmc.h 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_fmc.h
  4. * @author MCD Application Team
  5. * @version V1.8.1
  6. * @date 27-January-2022
  7. * @brief This file contains all the functions prototypes for the FMC firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * Copyright (c) 2016 STMicroelectronics.
  13. * All rights reserved.
  14. *
  15. * This software is licensed under terms that can be found in the LICENSE file
  16. * in the root directory of this software component.
  17. * If no LICENSE file comes with this software, it is provided AS-IS.
  18. *
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F4xx_FMC_H
  23. #define __STM32F4xx_FMC_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f4xx.h"
  29. /** @addtogroup STM32F4xx_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup FMC
  33. * @{
  34. */
  35. /* Exported types ------------------------------------------------------------*/
  36. /**
  37. * @brief Timing parameters For NOR/SRAM Banks
  38. */
  39. typedef struct
  40. {
  41. uint32_t FMC_AddressSetupTime; /*!< Defines the number of HCLK cycles to configure
  42. the duration of the address setup time.
  43. This parameter can be a value between 0 and 15.
  44. @note This parameter is not used with synchronous NOR Flash memories. */
  45. uint32_t FMC_AddressHoldTime; /*!< Defines the number of HCLK cycles to configure
  46. the duration of the address hold time.
  47. This parameter can be a value between 1 and 15.
  48. @note This parameter is not used with synchronous NOR Flash memories.*/
  49. uint32_t FMC_DataSetupTime; /*!< Defines the number of HCLK cycles to configure
  50. the duration of the data setup time.
  51. This parameter can be a value between 1 and 255.
  52. @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed NOR Flash memories. */
  53. uint32_t FMC_BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure
  54. the duration of the bus turnaround.
  55. This parameter can be a value between 0 and 15.
  56. @note This parameter is only used for multiplexed NOR Flash memories. */
  57. uint32_t FMC_CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of HCLK cycles.
  58. This parameter can be a value between 1 and 15.
  59. @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM accesses. */
  60. uint32_t FMC_DataLatency; /*!< Defines the number of memory clock cycles to issue
  61. to the memory before getting the first data.
  62. The parameter value depends on the memory type as shown below:
  63. - It must be set to 0 in case of a CRAM
  64. - It is don't care in asynchronous NOR, SRAM or ROM accesses
  65. - It may assume a value between 0 and 15 in NOR Flash memories
  66. with synchronous burst mode enable */
  67. uint32_t FMC_AccessMode; /*!< Specifies the asynchronous access mode.
  68. This parameter can be a value of @ref FMC_Access_Mode */
  69. }FMC_NORSRAMTimingInitTypeDef;
  70. /**
  71. * @brief FMC NOR/SRAM Init structure definition
  72. */
  73. typedef struct
  74. {
  75. uint32_t FMC_Bank; /*!< Specifies the NOR/SRAM memory bank that will be used.
  76. This parameter can be a value of @ref FMC_NORSRAM_Bank */
  77. uint32_t FMC_DataAddressMux; /*!< Specifies whether the address and data values are
  78. multiplexed on the databus or not.
  79. This parameter can be a value of @ref FMC_Data_Address_Bus_Multiplexing */
  80. uint32_t FMC_MemoryType; /*!< Specifies the type of external memory attached to
  81. the corresponding memory bank.
  82. This parameter can be a value of @ref FMC_Memory_Type */
  83. uint32_t FMC_MemoryDataWidth; /*!< Specifies the external memory device width.
  84. This parameter can be a value of @ref FMC_NORSRAM_Data_Width */
  85. uint32_t FMC_BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory,
  86. valid only with synchronous burst Flash memories.
  87. This parameter can be a value of @ref FMC_Burst_Access_Mode */
  88. uint32_t FMC_WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing
  89. the Flash memory in burst mode.
  90. This parameter can be a value of @ref FMC_Wait_Signal_Polarity */
  91. uint32_t FMC_WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash
  92. memory, valid only when accessing Flash memories in burst mode.
  93. This parameter can be a value of @ref FMC_Wrap_Mode */
  94. uint32_t FMC_WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one
  95. clock cycle before the wait state or during the wait state,
  96. valid only when accessing memories in burst mode.
  97. This parameter can be a value of @ref FMC_Wait_Timing */
  98. uint32_t FMC_WriteOperation; /*!< Enables or disables the write operation in the selected bank by the FMC.
  99. This parameter can be a value of @ref FMC_Write_Operation */
  100. uint32_t FMC_WaitSignal; /*!< Enables or disables the wait state insertion via wait
  101. signal, valid for Flash memory access in burst mode.
  102. This parameter can be a value of @ref FMC_Wait_Signal */
  103. uint32_t FMC_ExtendedMode; /*!< Enables or disables the extended mode.
  104. This parameter can be a value of @ref FMC_Extended_Mode */
  105. uint32_t FMC_AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers,
  106. valid only with asynchronous Flash memories.
  107. This parameter can be a value of @ref FMC_AsynchronousWait */
  108. uint32_t FMC_WriteBurst; /*!< Enables or disables the write burst operation.
  109. This parameter can be a value of @ref FMC_Write_Burst */
  110. uint32_t FMC_ContinousClock; /*!< Enables or disables the FMC clock output to external memory devices.
  111. This parameter is only enabled through the FMC_BCR1 register, and don't care
  112. through FMC_BCR2..4 registers.
  113. This parameter can be a value of @ref FMC_Continous_Clock */
  114. FMC_NORSRAMTimingInitTypeDef* FMC_ReadWriteTimingStruct; /*!< Timing Parameters for write and read access if the Extended Mode is not used*/
  115. FMC_NORSRAMTimingInitTypeDef* FMC_WriteTimingStruct; /*!< Timing Parameters for write access if the Extended Mode is used*/
  116. }FMC_NORSRAMInitTypeDef;
  117. /**
  118. * @brief Timing parameters For FMC NAND and PCCARD Banks
  119. */
  120. typedef struct
  121. {
  122. uint32_t FMC_SetupTime; /*!< Defines the number of HCLK cycles to setup address before
  123. the command assertion for NAND-Flash read or write access
  124. to common/Attribute or I/O memory space (depending on
  125. the memory space timing to be configured).
  126. This parameter can be a value between 0 and 255.*/
  127. uint32_t FMC_WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the
  128. command for NAND-Flash read or write access to
  129. common/Attribute or I/O memory space (depending on the
  130. memory space timing to be configured).
  131. This parameter can be a number between 0 and 255 */
  132. uint32_t FMC_HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address
  133. (and data for write access) after the command de-assertion
  134. for NAND-Flash read or write access to common/Attribute
  135. or I/O memory space (depending on the memory space timing
  136. to be configured).
  137. This parameter can be a number between 0 and 255 */
  138. uint32_t FMC_HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the
  139. databus is kept in HiZ after the start of a NAND-Flash
  140. write access to common/Attribute or I/O memory space (depending
  141. on the memory space timing to be configured).
  142. This parameter can be a number between 0 and 255 */
  143. }FMC_NAND_PCCARDTimingInitTypeDef;
  144. /**
  145. * @brief FMC NAND Init structure definition
  146. */
  147. typedef struct
  148. {
  149. uint32_t FMC_Bank; /*!< Specifies the NAND memory bank that will be used.
  150. This parameter can be a value of @ref FMC_NAND_Bank */
  151. uint32_t FMC_Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory Bank.
  152. This parameter can be any value of @ref FMC_Wait_feature */
  153. uint32_t FMC_MemoryDataWidth; /*!< Specifies the external memory device width.
  154. This parameter can be any value of @ref FMC_NAND_Data_Width */
  155. uint32_t FMC_ECC; /*!< Enables or disables the ECC computation.
  156. This parameter can be any value of @ref FMC_ECC */
  157. uint32_t FMC_ECCPageSize; /*!< Defines the page size for the extended ECC.
  158. This parameter can be any value of @ref FMC_ECC_Page_Size */
  159. uint32_t FMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
  160. delay between CLE low and RE low.
  161. This parameter can be a value between 0 and 255. */
  162. uint32_t FMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
  163. delay between ALE low and RE low.
  164. This parameter can be a number between 0 and 255 */
  165. FMC_NAND_PCCARDTimingInitTypeDef* FMC_CommonSpaceTimingStruct; /*!< FMC Common Space Timing */
  166. FMC_NAND_PCCARDTimingInitTypeDef* FMC_AttributeSpaceTimingStruct; /*!< FMC Attribute Space Timing */
  167. }FMC_NANDInitTypeDef;
  168. /**
  169. * @brief FMC PCCARD Init structure definition
  170. */
  171. typedef struct
  172. {
  173. uint32_t FMC_Waitfeature; /*!< Enables or disables the Wait feature for the Memory Bank.
  174. This parameter can be any value of @ref FMC_Wait_feature */
  175. uint32_t FMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
  176. delay between CLE low and RE low.
  177. This parameter can be a value between 0 and 255. */
  178. uint32_t FMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
  179. delay between ALE low and RE low.
  180. This parameter can be a number between 0 and 255 */
  181. FMC_NAND_PCCARDTimingInitTypeDef* FMC_CommonSpaceTimingStruct; /*!< FMC Common Space Timing */
  182. FMC_NAND_PCCARDTimingInitTypeDef* FMC_AttributeSpaceTimingStruct; /*!< FMC Attribute Space Timing */
  183. FMC_NAND_PCCARDTimingInitTypeDef* FMC_IOSpaceTimingStruct; /*!< FMC IO Space Timing */
  184. }FMC_PCCARDInitTypeDef;
  185. /**
  186. * @brief Timing parameters for FMC SDRAM Banks
  187. */
  188. typedef struct
  189. {
  190. uint32_t FMC_LoadToActiveDelay; /*!< Defines the delay between a Load Mode Register command and
  191. an active or Refresh command in number of memory clock cycles.
  192. This parameter can be a value between 1 and 16. */
  193. uint32_t FMC_ExitSelfRefreshDelay; /*!< Defines the delay from releasing the self refresh command to
  194. issuing the Activate command in number of memory clock cycles.
  195. This parameter can be a value between 1 and 16. */
  196. uint32_t FMC_SelfRefreshTime; /*!< Defines the minimum Self Refresh period in number of memory clock
  197. cycles.
  198. This parameter can be a value between 1 and 16. */
  199. uint32_t FMC_RowCycleDelay; /*!< Defines the delay between the Refresh command and the Activate command
  200. and the delay between two consecutive Refresh commands in number of
  201. memory clock cycles.
  202. This parameter can be a value between 1 and 16. */
  203. uint32_t FMC_WriteRecoveryTime; /*!< Defines the Write recovery Time in number of memory clock cycles.
  204. This parameter can be a value between 1 and 16. */
  205. uint32_t FMC_RPDelay; /*!< Defines the delay between a Precharge Command and an other command
  206. in number of memory clock cycles.
  207. This parameter can be a value between 1 and 16. */
  208. uint32_t FMC_RCDDelay; /*!< Defines the delay between the Activate Command and a Read/Write command
  209. in number of memory clock cycles.
  210. This parameter can be a value between 1 and 16. */
  211. }FMC_SDRAMTimingInitTypeDef;
  212. /**
  213. * @brief Command parameters for FMC SDRAM Banks
  214. */
  215. typedef struct
  216. {
  217. uint32_t FMC_CommandMode; /*!< Defines the command issued to the SDRAM device.
  218. This parameter can be a value of @ref FMC_Command_Mode. */
  219. uint32_t FMC_CommandTarget; /*!< Defines which bank (1 or 2) the command will be issued to.
  220. This parameter can be a value of @ref FMC_Command_Target. */
  221. uint32_t FMC_AutoRefreshNumber; /*!< Defines the number of consecutive auto refresh command issued
  222. in auto refresh mode.
  223. This parameter can be a value between 1 and 16. */
  224. uint32_t FMC_ModeRegisterDefinition; /*!< Defines the SDRAM Mode register content */
  225. }FMC_SDRAMCommandTypeDef;
  226. /**
  227. * @brief FMC SDRAM Init structure definition
  228. */
  229. typedef struct
  230. {
  231. uint32_t FMC_Bank; /*!< Specifies the SDRAM memory bank that will be used.
  232. This parameter can be a value of @ref FMC_SDRAM_Bank */
  233. uint32_t FMC_ColumnBitsNumber; /*!< Defines the number of bits of column address.
  234. This parameter can be a value of @ref FMC_ColumnBits_Number. */
  235. uint32_t FMC_RowBitsNumber; /*!< Defines the number of bits of column address..
  236. This parameter can be a value of @ref FMC_RowBits_Number. */
  237. uint32_t FMC_SDMemoryDataWidth; /*!< Defines the memory device width.
  238. This parameter can be a value of @ref FMC_SDMemory_Data_Width. */
  239. uint32_t FMC_InternalBankNumber; /*!< Defines the number of bits of column address.
  240. This parameter can be of @ref FMC_InternalBank_Number. */
  241. uint32_t FMC_CASLatency; /*!< Defines the SDRAM CAS latency in number of memory clock cycles.
  242. This parameter can be a value of @ref FMC_CAS_Latency. */
  243. uint32_t FMC_WriteProtection; /*!< Enables the SDRAM bank to be accessed in write mode.
  244. This parameter can be a value of @ref FMC_Write_Protection. */
  245. uint32_t FMC_SDClockPeriod; /*!< Define the SDRAM Clock Period for both SDRAM Banks and they allow to disable
  246. the clock before changing frequency.
  247. This parameter can be a value of @ref FMC_SDClock_Period. */
  248. uint32_t FMC_ReadBurst; /*!< This bit enable the SDRAM controller to anticipate the next read commands
  249. during the CAS latency and stores data in the Read FIFO.
  250. This parameter can be a value of @ref FMC_Read_Burst. */
  251. uint32_t FMC_ReadPipeDelay; /*!< Define the delay in system clock cycles on read data path.
  252. This parameter can be a value of @ref FMC_ReadPipe_Delay. */
  253. FMC_SDRAMTimingInitTypeDef* FMC_SDRAMTimingStruct; /*!< Timing Parameters for write and read access*/
  254. }FMC_SDRAMInitTypeDef;
  255. /* Exported constants --------------------------------------------------------*/
  256. /** @defgroup FMC_Exported_Constants
  257. * @{
  258. */
  259. /** @defgroup FMC_NORSRAM_Bank
  260. * @{
  261. */
  262. #define FMC_Bank1_NORSRAM1 ((uint32_t)0x00000000)
  263. #define FMC_Bank1_NORSRAM2 ((uint32_t)0x00000002)
  264. #define FMC_Bank1_NORSRAM3 ((uint32_t)0x00000004)
  265. #define FMC_Bank1_NORSRAM4 ((uint32_t)0x00000006)
  266. #define IS_FMC_NORSRAM_BANK(BANK) (((BANK) == FMC_Bank1_NORSRAM1) || \
  267. ((BANK) == FMC_Bank1_NORSRAM2) || \
  268. ((BANK) == FMC_Bank1_NORSRAM3) || \
  269. ((BANK) == FMC_Bank1_NORSRAM4))
  270. /**
  271. * @}
  272. */
  273. /** @defgroup FMC_NAND_Bank
  274. * @{
  275. */
  276. #define FMC_Bank2_NAND ((uint32_t)0x00000010)
  277. #define FMC_Bank3_NAND ((uint32_t)0x00000100)
  278. #define IS_FMC_NAND_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \
  279. ((BANK) == FMC_Bank3_NAND))
  280. /**
  281. * @}
  282. */
  283. /** @defgroup FMC_PCCARD_Bank
  284. * @{
  285. */
  286. #define FMC_Bank4_PCCARD ((uint32_t)0x00001000)
  287. /**
  288. * @}
  289. */
  290. /** @defgroup FMC_SDRAM_Bank
  291. * @{
  292. */
  293. #define FMC_Bank1_SDRAM ((uint32_t)0x00000000)
  294. #define FMC_Bank2_SDRAM ((uint32_t)0x00000001)
  295. #define IS_FMC_SDRAM_BANK(BANK) (((BANK) == FMC_Bank1_SDRAM) || \
  296. ((BANK) == FMC_Bank2_SDRAM))
  297. /**
  298. * @}
  299. */
  300. /** @defgroup FMC_NOR_SRAM_Controller
  301. * @{
  302. */
  303. /** @defgroup FMC_Data_Address_Bus_Multiplexing
  304. * @{
  305. */
  306. #define FMC_DataAddressMux_Disable ((uint32_t)0x00000000)
  307. #define FMC_DataAddressMux_Enable ((uint32_t)0x00000002)
  308. #define IS_FMC_MUX(MUX) (((MUX) == FMC_DataAddressMux_Disable) || \
  309. ((MUX) == FMC_DataAddressMux_Enable))
  310. /**
  311. * @}
  312. */
  313. /** @defgroup FMC_Memory_Type
  314. * @{
  315. */
  316. #define FMC_MemoryType_SRAM ((uint32_t)0x00000000)
  317. #define FMC_MemoryType_PSRAM ((uint32_t)0x00000004)
  318. #define FMC_MemoryType_NOR ((uint32_t)0x00000008)
  319. #define IS_FMC_MEMORY(MEMORY) (((MEMORY) == FMC_MemoryType_SRAM) || \
  320. ((MEMORY) == FMC_MemoryType_PSRAM)|| \
  321. ((MEMORY) == FMC_MemoryType_NOR))
  322. /**
  323. * @}
  324. */
  325. /** @defgroup FMC_NORSRAM_Data_Width
  326. * @{
  327. */
  328. #define FMC_NORSRAM_MemoryDataWidth_8b ((uint32_t)0x00000000)
  329. #define FMC_NORSRAM_MemoryDataWidth_16b ((uint32_t)0x00000010)
  330. #define FMC_NORSRAM_MemoryDataWidth_32b ((uint32_t)0x00000020)
  331. #define IS_FMC_NORSRAM_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NORSRAM_MemoryDataWidth_8b) || \
  332. ((WIDTH) == FMC_NORSRAM_MemoryDataWidth_16b) || \
  333. ((WIDTH) == FMC_NORSRAM_MemoryDataWidth_32b))
  334. /**
  335. * @}
  336. */
  337. /** @defgroup FMC_Burst_Access_Mode
  338. * @{
  339. */
  340. #define FMC_BurstAccessMode_Disable ((uint32_t)0x00000000)
  341. #define FMC_BurstAccessMode_Enable ((uint32_t)0x00000100)
  342. #define IS_FMC_BURSTMODE(STATE) (((STATE) == FMC_BurstAccessMode_Disable) || \
  343. ((STATE) == FMC_BurstAccessMode_Enable))
  344. /**
  345. * @}
  346. */
  347. /** @defgroup FMC_AsynchronousWait
  348. * @{
  349. */
  350. #define FMC_AsynchronousWait_Disable ((uint32_t)0x00000000)
  351. #define FMC_AsynchronousWait_Enable ((uint32_t)0x00008000)
  352. #define IS_FMC_ASYNWAIT(STATE) (((STATE) == FMC_AsynchronousWait_Disable) || \
  353. ((STATE) == FMC_AsynchronousWait_Enable))
  354. /**
  355. * @}
  356. */
  357. /** @defgroup FMC_Wait_Signal_Polarity
  358. * @{
  359. */
  360. #define FMC_WaitSignalPolarity_Low ((uint32_t)0x00000000)
  361. #define FMC_WaitSignalPolarity_High ((uint32_t)0x00000200)
  362. #define IS_FMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FMC_WaitSignalPolarity_Low) || \
  363. ((POLARITY) == FMC_WaitSignalPolarity_High))
  364. /**
  365. * @}
  366. */
  367. /** @defgroup FMC_Wrap_Mode
  368. * @{
  369. */
  370. #define FMC_WrapMode_Disable ((uint32_t)0x00000000)
  371. #define FMC_WrapMode_Enable ((uint32_t)0x00000400)
  372. #define IS_FMC_WRAP_MODE(MODE) (((MODE) == FMC_WrapMode_Disable) || \
  373. ((MODE) == FMC_WrapMode_Enable))
  374. /**
  375. * @}
  376. */
  377. /** @defgroup FMC_Wait_Timing
  378. * @{
  379. */
  380. #define FMC_WaitSignalActive_BeforeWaitState ((uint32_t)0x00000000)
  381. #define FMC_WaitSignalActive_DuringWaitState ((uint32_t)0x00000800)
  382. #define IS_FMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FMC_WaitSignalActive_BeforeWaitState) || \
  383. ((ACTIVE) == FMC_WaitSignalActive_DuringWaitState))
  384. /**
  385. * @}
  386. */
  387. /** @defgroup FMC_Write_Operation
  388. * @{
  389. */
  390. #define FMC_WriteOperation_Disable ((uint32_t)0x00000000)
  391. #define FMC_WriteOperation_Enable ((uint32_t)0x00001000)
  392. #define IS_FMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FMC_WriteOperation_Disable) || \
  393. ((OPERATION) == FMC_WriteOperation_Enable))
  394. /**
  395. * @}
  396. */
  397. /** @defgroup FMC_Wait_Signal
  398. * @{
  399. */
  400. #define FMC_WaitSignal_Disable ((uint32_t)0x00000000)
  401. #define FMC_WaitSignal_Enable ((uint32_t)0x00002000)
  402. #define IS_FMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FMC_WaitSignal_Disable) || \
  403. ((SIGNAL) == FMC_WaitSignal_Enable))
  404. /**
  405. * @}
  406. */
  407. /** @defgroup FMC_Extended_Mode
  408. * @{
  409. */
  410. #define FMC_ExtendedMode_Disable ((uint32_t)0x00000000)
  411. #define FMC_ExtendedMode_Enable ((uint32_t)0x00004000)
  412. #define IS_FMC_EXTENDED_MODE(MODE) (((MODE) == FMC_ExtendedMode_Disable) || \
  413. ((MODE) == FMC_ExtendedMode_Enable))
  414. /**
  415. * @}
  416. */
  417. /** @defgroup FMC_Write_Burst
  418. * @{
  419. */
  420. #define FMC_WriteBurst_Disable ((uint32_t)0x00000000)
  421. #define FMC_WriteBurst_Enable ((uint32_t)0x00080000)
  422. #define IS_FMC_WRITE_BURST(BURST) (((BURST) == FMC_WriteBurst_Disable) || \
  423. ((BURST) == FMC_WriteBurst_Enable))
  424. /**
  425. * @}
  426. */
  427. /** @defgroup FMC_Continous_Clock
  428. * @{
  429. */
  430. #define FMC_CClock_SyncOnly ((uint32_t)0x00000000)
  431. #define FMC_CClock_SyncAsync ((uint32_t)0x00100000)
  432. #define IS_FMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FMC_CClock_SyncOnly) || \
  433. ((CCLOCK) == FMC_CClock_SyncAsync))
  434. /**
  435. * @}
  436. */
  437. /** @defgroup FMC_Address_Setup_Time
  438. * @{
  439. */
  440. #define IS_FMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 15)
  441. /**
  442. * @}
  443. */
  444. /** @defgroup FMC_Address_Hold_Time
  445. * @{
  446. */
  447. #define IS_FMC_ADDRESS_HOLD_TIME(TIME) (((TIME) > 0) && ((TIME) <= 15))
  448. /**
  449. * @}
  450. */
  451. /** @defgroup FMC_Data_Setup_Time
  452. * @{
  453. */
  454. #define IS_FMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 255))
  455. /**
  456. * @}
  457. */
  458. /** @defgroup FMC_Bus_Turn_around_Duration
  459. * @{
  460. */
  461. #define IS_FMC_TURNAROUND_TIME(TIME) ((TIME) <= 15)
  462. /**
  463. * @}
  464. */
  465. /** @defgroup FMC_CLK_Division
  466. * @{
  467. */
  468. #define IS_FMC_CLK_DIV(DIV) (((DIV) > 0) && ((DIV) <= 15))
  469. /**
  470. * @}
  471. */
  472. /** @defgroup FMC_Data_Latency
  473. * @{
  474. */
  475. #define IS_FMC_DATA_LATENCY(LATENCY) ((LATENCY) <= 15)
  476. /**
  477. * @}
  478. */
  479. /** @defgroup FMC_Access_Mode
  480. * @{
  481. */
  482. #define FMC_AccessMode_A ((uint32_t)0x00000000)
  483. #define FMC_AccessMode_B ((uint32_t)0x10000000)
  484. #define FMC_AccessMode_C ((uint32_t)0x20000000)
  485. #define FMC_AccessMode_D ((uint32_t)0x30000000)
  486. #define IS_FMC_ACCESS_MODE(MODE) (((MODE) == FMC_AccessMode_A) || \
  487. ((MODE) == FMC_AccessMode_B) || \
  488. ((MODE) == FMC_AccessMode_C) || \
  489. ((MODE) == FMC_AccessMode_D))
  490. /**
  491. * @}
  492. */
  493. /**
  494. * @}
  495. */
  496. /** @defgroup FMC_NAND_PCCARD_Controller
  497. * @{
  498. */
  499. /** @defgroup FMC_Wait_feature
  500. * @{
  501. */
  502. #define FMC_Waitfeature_Disable ((uint32_t)0x00000000)
  503. #define FMC_Waitfeature_Enable ((uint32_t)0x00000002)
  504. #define IS_FMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FMC_Waitfeature_Disable) || \
  505. ((FEATURE) == FMC_Waitfeature_Enable))
  506. /**
  507. * @}
  508. */
  509. /** @defgroup FMC_NAND_Data_Width
  510. * @{
  511. */
  512. #define FMC_NAND_MemoryDataWidth_8b ((uint32_t)0x00000000)
  513. #define FMC_NAND_MemoryDataWidth_16b ((uint32_t)0x00000010)
  514. #define IS_FMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NAND_MemoryDataWidth_8b) || \
  515. ((WIDTH) == FMC_NAND_MemoryDataWidth_16b))
  516. /**
  517. * @}
  518. */
  519. /** @defgroup FMC_ECC
  520. * @{
  521. */
  522. #define FMC_ECC_Disable ((uint32_t)0x00000000)
  523. #define FMC_ECC_Enable ((uint32_t)0x00000040)
  524. #define IS_FMC_ECC_STATE(STATE) (((STATE) == FMC_ECC_Disable) || \
  525. ((STATE) == FMC_ECC_Enable))
  526. /**
  527. * @}
  528. */
  529. /** @defgroup FMC_ECC_Page_Size
  530. * @{
  531. */
  532. #define FMC_ECCPageSize_256Bytes ((uint32_t)0x00000000)
  533. #define FMC_ECCPageSize_512Bytes ((uint32_t)0x00020000)
  534. #define FMC_ECCPageSize_1024Bytes ((uint32_t)0x00040000)
  535. #define FMC_ECCPageSize_2048Bytes ((uint32_t)0x00060000)
  536. #define FMC_ECCPageSize_4096Bytes ((uint32_t)0x00080000)
  537. #define FMC_ECCPageSize_8192Bytes ((uint32_t)0x000A0000)
  538. #define IS_FMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FMC_ECCPageSize_256Bytes) || \
  539. ((SIZE) == FMC_ECCPageSize_512Bytes) || \
  540. ((SIZE) == FMC_ECCPageSize_1024Bytes) || \
  541. ((SIZE) == FMC_ECCPageSize_2048Bytes) || \
  542. ((SIZE) == FMC_ECCPageSize_4096Bytes) || \
  543. ((SIZE) == FMC_ECCPageSize_8192Bytes))
  544. /**
  545. * @}
  546. */
  547. /** @defgroup FMC_TCLR_Setup_Time
  548. * @{
  549. */
  550. #define IS_FMC_TCLR_TIME(TIME) ((TIME) <= 255)
  551. /**
  552. * @}
  553. */
  554. /** @defgroup FMC_TAR_Setup_Time
  555. * @{
  556. */
  557. #define IS_FMC_TAR_TIME(TIME) ((TIME) <= 255)
  558. /**
  559. * @}
  560. */
  561. /** @defgroup FMC_Setup_Time
  562. * @{
  563. */
  564. #define IS_FMC_SETUP_TIME(TIME) ((TIME) <= 255)
  565. /**
  566. * @}
  567. */
  568. /** @defgroup FMC_Wait_Setup_Time
  569. * @{
  570. */
  571. #define IS_FMC_WAIT_TIME(TIME) ((TIME) <= 255)
  572. /**
  573. * @}
  574. */
  575. /** @defgroup FMC_Hold_Setup_Time
  576. * @{
  577. */
  578. #define IS_FMC_HOLD_TIME(TIME) ((TIME) <= 255)
  579. /**
  580. * @}
  581. */
  582. /** @defgroup FMC_HiZ_Setup_Time
  583. * @{
  584. */
  585. #define IS_FMC_HIZ_TIME(TIME) ((TIME) <= 255)
  586. /**
  587. * @}
  588. */
  589. /**
  590. * @}
  591. */
  592. /** @defgroup FMC_NOR_SRAM_Controller
  593. * @{
  594. */
  595. /** @defgroup FMC_ColumnBits_Number
  596. * @{
  597. */
  598. #define FMC_ColumnBits_Number_8b ((uint32_t)0x00000000)
  599. #define FMC_ColumnBits_Number_9b ((uint32_t)0x00000001)
  600. #define FMC_ColumnBits_Number_10b ((uint32_t)0x00000002)
  601. #define FMC_ColumnBits_Number_11b ((uint32_t)0x00000003)
  602. #define IS_FMC_COLUMNBITS_NUMBER(COLUMN) (((COLUMN) == FMC_ColumnBits_Number_8b) || \
  603. ((COLUMN) == FMC_ColumnBits_Number_9b) || \
  604. ((COLUMN) == FMC_ColumnBits_Number_10b) || \
  605. ((COLUMN) == FMC_ColumnBits_Number_11b))
  606. /**
  607. * @}
  608. */
  609. /** @defgroup FMC_RowBits_Number
  610. * @{
  611. */
  612. #define FMC_RowBits_Number_11b ((uint32_t)0x00000000)
  613. #define FMC_RowBits_Number_12b ((uint32_t)0x00000004)
  614. #define FMC_RowBits_Number_13b ((uint32_t)0x00000008)
  615. #define IS_FMC_ROWBITS_NUMBER(ROW) (((ROW) == FMC_RowBits_Number_11b) || \
  616. ((ROW) == FMC_RowBits_Number_12b) || \
  617. ((ROW) == FMC_RowBits_Number_13b))
  618. /**
  619. * @}
  620. */
  621. /** @defgroup FMC_SDMemory_Data_Width
  622. * @{
  623. */
  624. #define FMC_SDMemory_Width_8b ((uint32_t)0x00000000)
  625. #define FMC_SDMemory_Width_16b ((uint32_t)0x00000010)
  626. #define FMC_SDMemory_Width_32b ((uint32_t)0x00000020)
  627. #define IS_FMC_SDMEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_SDMemory_Width_8b) || \
  628. ((WIDTH) == FMC_SDMemory_Width_16b) || \
  629. ((WIDTH) == FMC_SDMemory_Width_32b))
  630. /**
  631. * @}
  632. */
  633. /** @defgroup FMC_InternalBank_Number
  634. * @{
  635. */
  636. #define FMC_InternalBank_Number_2 ((uint32_t)0x00000000)
  637. #define FMC_InternalBank_Number_4 ((uint32_t)0x00000040)
  638. #define IS_FMC_INTERNALBANK_NUMBER(NUMBER) (((NUMBER) == FMC_InternalBank_Number_2) || \
  639. ((NUMBER) == FMC_InternalBank_Number_4))
  640. /**
  641. * @}
  642. */
  643. /** @defgroup FMC_CAS_Latency
  644. * @{
  645. */
  646. #define FMC_CAS_Latency_1 ((uint32_t)0x00000080)
  647. #define FMC_CAS_Latency_2 ((uint32_t)0x00000100)
  648. #define FMC_CAS_Latency_3 ((uint32_t)0x00000180)
  649. #define IS_FMC_CAS_LATENCY(LATENCY) (((LATENCY) == FMC_CAS_Latency_1) || \
  650. ((LATENCY) == FMC_CAS_Latency_2) || \
  651. ((LATENCY) == FMC_CAS_Latency_3))
  652. /**
  653. * @}
  654. */
  655. /** @defgroup FMC_Write_Protection
  656. * @{
  657. */
  658. #define FMC_Write_Protection_Disable ((uint32_t)0x00000000)
  659. #define FMC_Write_Protection_Enable ((uint32_t)0x00000200)
  660. #define IS_FMC_WRITE_PROTECTION(WRITE) (((WRITE) == FMC_Write_Protection_Disable) || \
  661. ((WRITE) == FMC_Write_Protection_Enable))
  662. /**
  663. * @}
  664. */
  665. /** @defgroup FMC_SDClock_Period
  666. * @{
  667. */
  668. #define FMC_SDClock_Disable ((uint32_t)0x00000000)
  669. #define FMC_SDClock_Period_2 ((uint32_t)0x00000800)
  670. #define FMC_SDClock_Period_3 ((uint32_t)0x00000C00)
  671. #define IS_FMC_SDCLOCK_PERIOD(PERIOD) (((PERIOD) == FMC_SDClock_Disable) || \
  672. ((PERIOD) == FMC_SDClock_Period_2) || \
  673. ((PERIOD) == FMC_SDClock_Period_3))
  674. /**
  675. * @}
  676. */
  677. /** @defgroup FMC_Read_Burst
  678. * @{
  679. */
  680. #define FMC_Read_Burst_Disable ((uint32_t)0x00000000)
  681. #define FMC_Read_Burst_Enable ((uint32_t)0x00001000)
  682. #define IS_FMC_READ_BURST(RBURST) (((RBURST) == FMC_Read_Burst_Disable) || \
  683. ((RBURST) == FMC_Read_Burst_Enable))
  684. /**
  685. * @}
  686. */
  687. /** @defgroup FMC_ReadPipe_Delay
  688. * @{
  689. */
  690. #define FMC_ReadPipe_Delay_0 ((uint32_t)0x00000000)
  691. #define FMC_ReadPipe_Delay_1 ((uint32_t)0x00002000)
  692. #define FMC_ReadPipe_Delay_2 ((uint32_t)0x00004000)
  693. #define IS_FMC_READPIPE_DELAY(DELAY) (((DELAY) == FMC_ReadPipe_Delay_0) || \
  694. ((DELAY) == FMC_ReadPipe_Delay_1) || \
  695. ((DELAY) == FMC_ReadPipe_Delay_2))
  696. /**
  697. * @}
  698. */
  699. /** @defgroup FMC_LoadToActive_Delay
  700. * @{
  701. */
  702. #define IS_FMC_LOADTOACTIVE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
  703. /**
  704. * @}
  705. */
  706. /** @defgroup FMC_ExitSelfRefresh_Delay
  707. * @{
  708. */
  709. #define IS_FMC_EXITSELFREFRESH_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
  710. /**
  711. * @}
  712. */
  713. /** @defgroup FMC_SelfRefresh_Time
  714. * @{
  715. */
  716. #define IS_FMC_SELFREFRESH_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16))
  717. /**
  718. * @}
  719. */
  720. /** @defgroup FMC_RowCycle_Delay
  721. * @{
  722. */
  723. #define IS_FMC_ROWCYCLE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
  724. /**
  725. * @}
  726. */
  727. /** @defgroup FMC_Write_Recovery_Time
  728. * @{
  729. */
  730. #define IS_FMC_WRITE_RECOVERY_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16))
  731. /**
  732. * @}
  733. */
  734. /** @defgroup FMC_RP_Delay
  735. * @{
  736. */
  737. #define IS_FMC_RP_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
  738. /**
  739. * @}
  740. */
  741. /** @defgroup FMC_RCD_Delay
  742. * @{
  743. */
  744. #define IS_FMC_RCD_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
  745. /**
  746. * @}
  747. */
  748. /** @defgroup FMC_Command_Mode
  749. * @{
  750. */
  751. #define FMC_Command_Mode_normal ((uint32_t)0x00000000)
  752. #define FMC_Command_Mode_CLK_Enabled ((uint32_t)0x00000001)
  753. #define FMC_Command_Mode_PALL ((uint32_t)0x00000002)
  754. #define FMC_Command_Mode_AutoRefresh ((uint32_t)0x00000003)
  755. #define FMC_Command_Mode_LoadMode ((uint32_t)0x00000004)
  756. #define FMC_Command_Mode_Selfrefresh ((uint32_t)0x00000005)
  757. #define FMC_Command_Mode_PowerDown ((uint32_t)0x00000006)
  758. #define IS_FMC_COMMAND_MODE(COMMAND) (((COMMAND) == FMC_Command_Mode_normal) || \
  759. ((COMMAND) == FMC_Command_Mode_CLK_Enabled) || \
  760. ((COMMAND) == FMC_Command_Mode_PALL) || \
  761. ((COMMAND) == FMC_Command_Mode_AutoRefresh) || \
  762. ((COMMAND) == FMC_Command_Mode_LoadMode) || \
  763. ((COMMAND) == FMC_Command_Mode_Selfrefresh) || \
  764. ((COMMAND) == FMC_Command_Mode_PowerDown))
  765. /**
  766. * @}
  767. */
  768. /** @defgroup FMC_Command_Target
  769. * @{
  770. */
  771. #define FMC_Command_Target_bank2 ((uint32_t)0x00000008)
  772. #define FMC_Command_Target_bank1 ((uint32_t)0x00000010)
  773. #define FMC_Command_Target_bank1_2 ((uint32_t)0x00000018)
  774. #define IS_FMC_COMMAND_TARGET(TARGET) (((TARGET) == FMC_Command_Target_bank1) || \
  775. ((TARGET) == FMC_Command_Target_bank2) || \
  776. ((TARGET) == FMC_Command_Target_bank1_2))
  777. /**
  778. * @}
  779. */
  780. /** @defgroup FMC_AutoRefresh_Number
  781. * @{
  782. */
  783. #define IS_FMC_AUTOREFRESH_NUMBER(NUMBER) (((NUMBER) > 0) && ((NUMBER) <= 16))
  784. /**
  785. * @}
  786. */
  787. /** @defgroup FMC_ModeRegister_Definition
  788. * @{
  789. */
  790. #define IS_FMC_MODE_REGISTER(CONTENT) ((CONTENT) <= 8191)
  791. /**
  792. * @}
  793. */
  794. /** @defgroup FMC_Mode_Status
  795. * @{
  796. */
  797. #define FMC_NormalMode_Status ((uint32_t)0x00000000)
  798. #define FMC_SelfRefreshMode_Status FMC_SDSR_MODES1_0
  799. #define FMC_PowerDownMode_Status FMC_SDSR_MODES1_1
  800. #define IS_FMC_MODE_STATUS(STATUS) (((STATUS) == FMC_NormalMode_Status) || \
  801. ((STATUS) == FMC_SelfRefreshMode_Status) || \
  802. ((STATUS) == FMC_PowerDownMode_Status))
  803. /**
  804. * @}
  805. */
  806. /**
  807. * @}
  808. */
  809. /** @defgroup FMC_Interrupt_sources
  810. * @{
  811. */
  812. #define FMC_IT_RisingEdge ((uint32_t)0x00000008)
  813. #define FMC_IT_Level ((uint32_t)0x00000010)
  814. #define FMC_IT_FallingEdge ((uint32_t)0x00000020)
  815. #define FMC_IT_Refresh ((uint32_t)0x00004000)
  816. #define IS_FMC_IT(IT) ((((IT) & (uint32_t)0xFFFFBFC7) == 0x00000000) && ((IT) != 0x00000000))
  817. #define IS_FMC_GET_IT(IT) (((IT) == FMC_IT_RisingEdge) || \
  818. ((IT) == FMC_IT_Level) || \
  819. ((IT) == FMC_IT_FallingEdge) || \
  820. ((IT) == FMC_IT_Refresh))
  821. #define IS_FMC_IT_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \
  822. ((BANK) == FMC_Bank3_NAND) || \
  823. ((BANK) == FMC_Bank4_PCCARD) || \
  824. ((BANK) == FMC_Bank1_SDRAM) || \
  825. ((BANK) == FMC_Bank2_SDRAM))
  826. /**
  827. * @}
  828. */
  829. /** @defgroup FMC_Flags
  830. * @{
  831. */
  832. #define FMC_FLAG_RisingEdge ((uint32_t)0x00000001)
  833. #define FMC_FLAG_Level ((uint32_t)0x00000002)
  834. #define FMC_FLAG_FallingEdge ((uint32_t)0x00000004)
  835. #define FMC_FLAG_FEMPT ((uint32_t)0x00000040)
  836. #define FMC_FLAG_Refresh FMC_SDSR_RE
  837. #define FMC_FLAG_Busy FMC_SDSR_BUSY
  838. #define IS_FMC_GET_FLAG(FLAG) (((FLAG) == FMC_FLAG_RisingEdge) || \
  839. ((FLAG) == FMC_FLAG_Level) || \
  840. ((FLAG) == FMC_FLAG_FallingEdge) || \
  841. ((FLAG) == FMC_FLAG_FEMPT) || \
  842. ((FLAG) == FMC_FLAG_Refresh) || \
  843. ((FLAG) == FMC_SDSR_BUSY))
  844. #define IS_FMC_GETFLAG_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \
  845. ((BANK) == FMC_Bank3_NAND) || \
  846. ((BANK) == FMC_Bank4_PCCARD) || \
  847. ((BANK) == FMC_Bank1_SDRAM) || \
  848. ((BANK) == FMC_Bank2_SDRAM) || \
  849. ((BANK) == (FMC_Bank1_SDRAM | FMC_Bank2_SDRAM)))
  850. #define IS_FMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000))
  851. /**
  852. * @}
  853. */
  854. /** @defgroup FMC_Refresh_count
  855. * @{
  856. */
  857. #define IS_FMC_REFRESH_COUNT(COUNT) ((COUNT) <= 8191)
  858. /**
  859. * @}
  860. */
  861. /**
  862. * @}
  863. */
  864. /* Exported macro ------------------------------------------------------------*/
  865. /* Exported functions --------------------------------------------------------*/
  866. /* NOR/SRAM Controller functions **********************************************/
  867. void FMC_NORSRAMDeInit(uint32_t FMC_Bank);
  868. void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct);
  869. void FMC_NORSRAMStructInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct);
  870. void FMC_NORSRAMCmd(uint32_t FMC_Bank, FunctionalState NewState);
  871. /* NAND Controller functions **************************************************/
  872. void FMC_NANDDeInit(uint32_t FMC_Bank);
  873. void FMC_NANDInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct);
  874. void FMC_NANDStructInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct);
  875. void FMC_NANDCmd(uint32_t FMC_Bank, FunctionalState NewState);
  876. void FMC_NANDECCCmd(uint32_t FMC_Bank, FunctionalState NewState);
  877. uint32_t FMC_GetECC(uint32_t FMC_Bank);
  878. /* PCCARD Controller functions ************************************************/
  879. void FMC_PCCARDDeInit(void);
  880. void FMC_PCCARDInit(FMC_PCCARDInitTypeDef* FMC_PCCARDInitStruct);
  881. void FMC_PCCARDStructInit(FMC_PCCARDInitTypeDef* FMC_PCCARDInitStruct);
  882. void FMC_PCCARDCmd(FunctionalState NewState);
  883. /* SDRAM Controller functions ************************************************/
  884. void FMC_SDRAMDeInit(uint32_t FMC_Bank);
  885. void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct);
  886. void FMC_SDRAMStructInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct);
  887. void FMC_SDRAMCmdConfig(FMC_SDRAMCommandTypeDef* FMC_SDRAMCommandStruct);
  888. uint32_t FMC_GetModeStatus(uint32_t SDRAM_Bank);
  889. void FMC_SetRefreshCount(uint32_t FMC_Count);
  890. void FMC_SetAutoRefresh_Number(uint32_t FMC_Number);
  891. void FMC_SDRAMWriteProtectionConfig(uint32_t SDRAM_Bank, FunctionalState NewState);
  892. /* Interrupts and flags management functions **********************************/
  893. void FMC_ITConfig(uint32_t FMC_Bank, uint32_t FMC_IT, FunctionalState NewState);
  894. FlagStatus FMC_GetFlagStatus(uint32_t FMC_Bank, uint32_t FMC_FLAG);
  895. void FMC_ClearFlag(uint32_t FMC_Bank, uint32_t FMC_FLAG);
  896. ITStatus FMC_GetITStatus(uint32_t FMC_Bank, uint32_t FMC_IT);
  897. void FMC_ClearITPendingBit(uint32_t FMC_Bank, uint32_t FMC_IT);
  898. #ifdef __cplusplus
  899. }
  900. #endif
  901. #endif /*__STM32F4xx_FMC_H */
  902. /**
  903. * @}
  904. */
  905. /**
  906. * @}
  907. */