stm32f4xx_fmc.h 43 KB

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