1
0

stm32f4xx_ll_fmc.h 60 KB

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