stm32f4xx_ll_fmc.h 59 KB

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