stm32f4xx_ll_fmc.h 62 KB

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