stm32f4xx_ll_fsmc.c 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_fsmc.c
  4. * @author MCD Application Team
  5. * @brief FSMC Low Layer HAL module driver.
  6. *
  7. * This file provides firmware functions to manage the following
  8. * functionalities of the Flexible Static Memory Controller (FSMC) peripheral memories:
  9. * + Initialization/de-initialization functions
  10. * + Peripheral Control functions
  11. * + Peripheral State functions
  12. *
  13. @verbatim
  14. ==============================================================================
  15. ##### FSMC peripheral features #####
  16. ==============================================================================
  17. [..] The Flexible static memory controller (FSMC) includes two memory controllers:
  18. (+) The NOR/PSRAM memory controller
  19. (+) The NAND/PC Card memory controller
  20. [..] The FSMC functional block makes the interface with synchronous and asynchronous static
  21. memories, SDRAM memories, and 16-bit PC memory cards. Its main purposes are:
  22. (+) to translate AHB transactions into the appropriate external device protocol.
  23. (+) to meet the access time requirements of the external memory devices.
  24. [..] All external memories share the addresses, data and control signals with the controller.
  25. Each external device is accessed by means of a unique Chip Select. The FSMC performs
  26. only one access at a time to an external device.
  27. The main features of the FSMC controller are the following:
  28. (+) Interface with static-memory mapped devices including:
  29. (++) Static random access memory (SRAM).
  30. (++) Read-only memory (ROM).
  31. (++) NOR Flash memory/OneNAND Flash memory.
  32. (++) PSRAM (4 memory banks).
  33. (++) 16-bit PC Card compatible devices.
  34. (++) Two banks of NAND Flash memory with ECC hardware to check up to 8 Kbytes of
  35. data.
  36. (+) Independent Chip Select control for each memory bank.
  37. (+) Independent configuration for each memory bank.
  38. @endverbatim
  39. ******************************************************************************
  40. * @attention
  41. *
  42. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  43. * All rights reserved.</center></h2>
  44. *
  45. * This software component is licensed by ST under BSD 3-Clause license,
  46. * the "License"; You may not use this file except in compliance with the
  47. * License. You may obtain a copy of the License at:
  48. * opensource.org/licenses/BSD-3-Clause
  49. *
  50. ******************************************************************************
  51. */
  52. /* Includes ------------------------------------------------------------------*/
  53. #include "stm32f4xx_hal.h"
  54. /** @addtogroup STM32F4xx_HAL_Driver
  55. * @{
  56. */
  57. /** @defgroup FSMC_LL FSMC Low Layer
  58. * @brief FSMC driver modules
  59. * @{
  60. */
  61. #if defined (HAL_SRAM_MODULE_ENABLED) || defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED) || defined(HAL_PCCARD_MODULE_ENABLED)
  62. #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F412Zx) ||\
  63. defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F413xx) || defined(STM32F423xx)
  64. /* Private typedef -----------------------------------------------------------*/
  65. /* Private define ------------------------------------------------------------*/
  66. /* Private macro -------------------------------------------------------------*/
  67. /* Private variables ---------------------------------------------------------*/
  68. /* Private function prototypes -----------------------------------------------*/
  69. /* Private functions ---------------------------------------------------------*/
  70. /** @addtogroup FSMC_LL_Private_Functions
  71. * @{
  72. */
  73. /** @addtogroup FSMC_LL_NORSRAM
  74. * @brief NORSRAM Controller functions
  75. *
  76. @verbatim
  77. ==============================================================================
  78. ##### How to use NORSRAM device driver #####
  79. ==============================================================================
  80. [..]
  81. This driver contains a set of APIs to interface with the FSMC NORSRAM banks in order
  82. to run the NORSRAM external devices.
  83. (+) FSMC NORSRAM bank reset using the function FSMC_NORSRAM_DeInit()
  84. (+) FSMC NORSRAM bank control configuration using the function FSMC_NORSRAM_Init()
  85. (+) FSMC NORSRAM bank timing configuration using the function FSMC_NORSRAM_Timing_Init()
  86. (+) FSMC NORSRAM bank extended timing configuration using the function
  87. FSMC_NORSRAM_Extended_Timing_Init()
  88. (+) FSMC NORSRAM bank enable/disable write operation using the functions
  89. FSMC_NORSRAM_WriteOperation_Enable()/FSMC_NORSRAM_WriteOperation_Disable()
  90. @endverbatim
  91. * @{
  92. */
  93. /** @addtogroup FSMC_LL_NORSRAM_Private_Functions_Group1
  94. * @brief Initialization and Configuration functions
  95. *
  96. @verbatim
  97. ==============================================================================
  98. ##### Initialization and de_initialization functions #####
  99. ==============================================================================
  100. [..]
  101. This section provides functions allowing to:
  102. (+) Initialize and configure the FSMC NORSRAM interface
  103. (+) De-initialize the FSMC NORSRAM interface
  104. (+) Configure the FSMC clock and associated GPIOs
  105. @endverbatim
  106. * @{
  107. */
  108. /**
  109. * @brief Initialize the FSMC_NORSRAM device according to the specified
  110. * control parameters in the FSMC_NORSRAM_InitTypeDef
  111. * @param Device Pointer to NORSRAM device instance
  112. * @param Init Pointer to NORSRAM Initialization structure
  113. * @retval HAL status
  114. */
  115. HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_InitTypeDef* Init)
  116. {
  117. uint32_t tmpr = 0U;
  118. /* Check the parameters */
  119. assert_param(IS_FSMC_NORSRAM_DEVICE(Device));
  120. assert_param(IS_FSMC_NORSRAM_BANK(Init->NSBank));
  121. assert_param(IS_FSMC_MUX(Init->DataAddressMux));
  122. assert_param(IS_FSMC_MEMORY(Init->MemoryType));
  123. assert_param(IS_FSMC_NORSRAM_MEMORY_WIDTH(Init->MemoryDataWidth));
  124. assert_param(IS_FSMC_BURSTMODE(Init->BurstAccessMode));
  125. assert_param(IS_FSMC_WAIT_POLARITY(Init->WaitSignalPolarity));
  126. #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
  127. assert_param(IS_FSMC_WRAP_MODE(Init->WrapMode));
  128. #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
  129. assert_param(IS_FSMC_WAIT_SIGNAL_ACTIVE(Init->WaitSignalActive));
  130. assert_param(IS_FSMC_WRITE_OPERATION(Init->WriteOperation));
  131. assert_param(IS_FSMC_WAITE_SIGNAL(Init->WaitSignal));
  132. assert_param(IS_FSMC_EXTENDED_MODE(Init->ExtendedMode));
  133. assert_param(IS_FSMC_ASYNWAIT(Init->AsynchronousWait));
  134. assert_param(IS_FSMC_WRITE_BURST(Init->WriteBurst));
  135. assert_param(IS_FSMC_PAGESIZE(Init->PageSize));
  136. #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F413xx) || defined(STM32F423xx)
  137. assert_param(IS_FSMC_WRITE_FIFO(Init->WriteFifo));
  138. assert_param(IS_FSMC_CONTINOUS_CLOCK(Init->ContinuousClock));
  139. #endif /* STM32F412Zx || STM32F412Vx || STM32F413xx || STM32F423xx */
  140. /* Get the BTCR register value */
  141. tmpr = Device->BTCR[Init->NSBank];
  142. #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
  143. /* Clear MBKEN, MUXEN, MTYP, MWID, FACCEN, BURSTEN, WAITPOL, WRAPMOD, WAITCFG, WREN,
  144. WAITEN, EXTMOD, ASYNCWAIT, CPSIZE and CBURSTRW bits */
  145. tmpr &= ((uint32_t)~(FSMC_BCR1_MBKEN | FSMC_BCR1_MUXEN | FSMC_BCR1_MTYP | \
  146. FSMC_BCR1_MWID | FSMC_BCR1_FACCEN | FSMC_BCR1_BURSTEN | \
  147. FSMC_BCR1_WAITPOL | FSMC_BCR1_WRAPMOD | FSMC_BCR1_WAITCFG | \
  148. FSMC_BCR1_WREN | FSMC_BCR1_WAITEN | FSMC_BCR1_EXTMOD | \
  149. FSMC_BCR1_ASYNCWAIT | FSMC_BCR1_CPSIZE | FSMC_BCR1_CBURSTRW));
  150. /* Set NORSRAM device control parameters */
  151. tmpr |= (uint32_t)(Init->DataAddressMux |\
  152. Init->MemoryType |\
  153. Init->MemoryDataWidth |\
  154. Init->BurstAccessMode |\
  155. Init->WaitSignalPolarity |\
  156. Init->WrapMode |\
  157. Init->WaitSignalActive |\
  158. Init->WriteOperation |\
  159. Init->WaitSignal |\
  160. Init->ExtendedMode |\
  161. Init->AsynchronousWait |\
  162. Init->PageSize |\
  163. Init->WriteBurst
  164. );
  165. #else /* STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F413xx || STM32F423xx */
  166. /* Clear MBKEN, MUXEN, MTYP, MWID, FACCEN, BURSTEN, WAITPOL, WAITCFG, WREN,
  167. WAITEN, EXTMOD, ASYNCWAIT,CPSIZE, CBURSTRW, CCLKEN and WFDIS bits */
  168. tmpr &= ((uint32_t)~(FSMC_BCR1_MBKEN | FSMC_BCR1_MUXEN | FSMC_BCR1_MTYP | \
  169. FSMC_BCR1_MWID | FSMC_BCR1_FACCEN | FSMC_BCR1_BURSTEN | \
  170. FSMC_BCR1_WAITPOL | FSMC_BCR1_WAITCFG | FSMC_BCR1_WREN | \
  171. FSMC_BCR1_WAITEN | FSMC_BCR1_EXTMOD | FSMC_BCR1_ASYNCWAIT | \
  172. FSMC_BCR1_CPSIZE | FSMC_BCR1_CBURSTRW | FSMC_BCR1_CCLKEN | \
  173. FSMC_BCR1_WFDIS));
  174. /* Set NORSRAM device control parameters */
  175. tmpr |= (uint32_t)(Init->DataAddressMux |\
  176. Init->MemoryType |\
  177. Init->MemoryDataWidth |\
  178. Init->BurstAccessMode |\
  179. Init->WaitSignalPolarity |\
  180. Init->WaitSignalActive |\
  181. Init->WriteOperation |\
  182. Init->WaitSignal |\
  183. Init->ExtendedMode |\
  184. Init->AsynchronousWait |\
  185. Init->WriteBurst |\
  186. Init->ContinuousClock |\
  187. Init->PageSize |\
  188. Init->WriteFifo);
  189. #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
  190. if(Init->MemoryType == FSMC_MEMORY_TYPE_NOR)
  191. {
  192. tmpr |= (uint32_t)FSMC_NORSRAM_FLASH_ACCESS_ENABLE;
  193. }
  194. Device->BTCR[Init->NSBank] = tmpr;
  195. #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F413xx) || defined(STM32F423xx)
  196. /* Configure synchronous mode when Continuous clock is enabled for bank2..4 */
  197. if((Init->ContinuousClock == FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC) && (Init->NSBank != FSMC_NORSRAM_BANK1))
  198. {
  199. Device->BTCR[FSMC_NORSRAM_BANK1] |= (uint32_t)(Init->ContinuousClock);
  200. }
  201. if(Init->NSBank != FSMC_NORSRAM_BANK1)
  202. {
  203. Device->BTCR[FSMC_NORSRAM_BANK1] |= (uint32_t)(Init->WriteFifo);
  204. }
  205. #endif /* STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F413xx || STM32F423xx */
  206. return HAL_OK;
  207. }
  208. /**
  209. * @brief DeInitialize the FSMC_NORSRAM peripheral
  210. * @param Device Pointer to NORSRAM device instance
  211. * @param ExDevice Pointer to NORSRAM extended mode device instance
  212. * @param Bank NORSRAM bank number
  213. * @retval HAL status
  214. */
  215. HAL_StatusTypeDef FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank)
  216. {
  217. /* Check the parameters */
  218. assert_param(IS_FSMC_NORSRAM_DEVICE(Device));
  219. assert_param(IS_FSMC_NORSRAM_EXTENDED_DEVICE(ExDevice));
  220. assert_param(IS_FSMC_NORSRAM_BANK(Bank));
  221. /* Disable the FSMC_NORSRAM device */
  222. __FSMC_NORSRAM_DISABLE(Device, Bank);
  223. /* De-initialize the FSMC_NORSRAM device */
  224. /* FSMC_NORSRAM_BANK1 */
  225. if(Bank == FSMC_NORSRAM_BANK1)
  226. {
  227. Device->BTCR[Bank] = 0x000030DBU;
  228. }
  229. /* FSMC_NORSRAM_BANK2, FSMC_NORSRAM_BANK3 or FSMC_NORSRAM_BANK4 */
  230. else
  231. {
  232. Device->BTCR[Bank] = 0x000030D2U;
  233. }
  234. Device->BTCR[Bank + 1U] = 0x0FFFFFFFU;
  235. ExDevice->BWTR[Bank] = 0x0FFFFFFFU;
  236. return HAL_OK;
  237. }
  238. /**
  239. * @brief Initialize the FSMC_NORSRAM Timing according to the specified
  240. * parameters in the FSMC_NORSRAM_TimingTypeDef
  241. * @param Device Pointer to NORSRAM device instance
  242. * @param Timing Pointer to NORSRAM Timing structure
  243. * @param Bank NORSRAM bank number
  244. * @retval HAL status
  245. */
  246. HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank)
  247. {
  248. uint32_t tmpr = 0U;
  249. /* Check the parameters */
  250. assert_param(IS_FSMC_NORSRAM_DEVICE(Device));
  251. assert_param(IS_FSMC_ADDRESS_SETUP_TIME(Timing->AddressSetupTime));
  252. assert_param(IS_FSMC_ADDRESS_HOLD_TIME(Timing->AddressHoldTime));
  253. assert_param(IS_FSMC_DATASETUP_TIME(Timing->DataSetupTime));
  254. assert_param(IS_FSMC_TURNAROUND_TIME(Timing->BusTurnAroundDuration));
  255. assert_param(IS_FSMC_CLK_DIV(Timing->CLKDivision));
  256. assert_param(IS_FSMC_DATA_LATENCY(Timing->DataLatency));
  257. assert_param(IS_FSMC_ACCESS_MODE(Timing->AccessMode));
  258. assert_param(IS_FSMC_NORSRAM_BANK(Bank));
  259. /* Get the BTCR register value */
  260. tmpr = Device->BTCR[Bank + 1U];
  261. /* Clear ADDSET, ADDHLD, DATAST, BUSTURN, CLKDIV, DATLAT and ACCMOD bits */
  262. tmpr &= ((uint32_t)~(FSMC_BTR1_ADDSET | FSMC_BTR1_ADDHLD | FSMC_BTR1_DATAST | \
  263. FSMC_BTR1_BUSTURN | FSMC_BTR1_CLKDIV | FSMC_BTR1_DATLAT | \
  264. FSMC_BTR1_ACCMOD));
  265. /* Set FSMC_NORSRAM device timing parameters */
  266. tmpr |= (uint32_t)(Timing->AddressSetupTime |\
  267. ((Timing->AddressHoldTime) << 4U) |\
  268. ((Timing->DataSetupTime) << 8U) |\
  269. ((Timing->BusTurnAroundDuration) << 16U) |\
  270. (((Timing->CLKDivision)-1U) << 20U) |\
  271. (((Timing->DataLatency)-2U) << 24U) |\
  272. (Timing->AccessMode));
  273. Device->BTCR[Bank + 1] = tmpr;
  274. #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F413xx) || defined(STM32F423xx)
  275. /* Configure Clock division value (in NORSRAM bank 1) when continuous clock is enabled */
  276. if(HAL_IS_BIT_SET(Device->BTCR[FSMC_NORSRAM_BANK1], FSMC_BCR1_CCLKEN))
  277. {
  278. tmpr = (uint32_t)(Device->BTCR[FSMC_NORSRAM_BANK1 + 1U] & ~(0x0FU << 20U));
  279. tmpr |= (uint32_t)(((Timing->CLKDivision)-1U) << 20U);
  280. Device->BTCR[FSMC_NORSRAM_BANK1 + 1U] = tmpr;
  281. }
  282. #endif /* STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F413xx || STM32F423xx */
  283. return HAL_OK;
  284. }
  285. /**
  286. * @brief Initialize the FSMC_NORSRAM Extended mode Timing according to the specified
  287. * parameters in the FSMC_NORSRAM_TimingTypeDef
  288. * @param Device Pointer to NORSRAM device instance
  289. * @param Timing Pointer to NORSRAM Timing structure
  290. * @param Bank NORSRAM bank number
  291. * @retval HAL status
  292. */
  293. HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode)
  294. {
  295. uint32_t tmpr = 0U;
  296. /* Check the parameters */
  297. assert_param(IS_FSMC_EXTENDED_MODE(ExtendedMode));
  298. /* Set NORSRAM device timing register for write configuration, if extended mode is used */
  299. if(ExtendedMode == FSMC_EXTENDED_MODE_ENABLE)
  300. {
  301. /* Check the parameters */
  302. assert_param(IS_FSMC_NORSRAM_EXTENDED_DEVICE(Device));
  303. assert_param(IS_FSMC_ADDRESS_SETUP_TIME(Timing->AddressSetupTime));
  304. assert_param(IS_FSMC_ADDRESS_HOLD_TIME(Timing->AddressHoldTime));
  305. assert_param(IS_FSMC_DATASETUP_TIME(Timing->DataSetupTime));
  306. assert_param(IS_FSMC_TURNAROUND_TIME(Timing->BusTurnAroundDuration));
  307. assert_param(IS_FSMC_ACCESS_MODE(Timing->AccessMode));
  308. assert_param(IS_FSMC_NORSRAM_BANK(Bank));
  309. /* Get the BWTR register value */
  310. tmpr = Device->BWTR[Bank];
  311. /* Clear ADDSET, ADDHLD, DATAST, BUSTURN and ACCMOD bits */
  312. tmpr &= ((uint32_t)~(FSMC_BWTR1_ADDSET | FSMC_BWTR1_ADDHLD | FSMC_BWTR1_DATAST | \
  313. FSMC_BWTR1_BUSTURN | FSMC_BWTR1_ACCMOD));
  314. tmpr |= (uint32_t)(Timing->AddressSetupTime |\
  315. ((Timing->AddressHoldTime) << 4U) |\
  316. ((Timing->DataSetupTime) << 8U) |\
  317. ((Timing->BusTurnAroundDuration) << 16U) |\
  318. (Timing->AccessMode));
  319. Device->BWTR[Bank] = tmpr;
  320. }
  321. else
  322. {
  323. Device->BWTR[Bank] = 0x0FFFFFFFU;
  324. }
  325. return HAL_OK;
  326. }
  327. /**
  328. * @}
  329. */
  330. /** @addtogroup FSMC_LL_NORSRAM_Private_Functions_Group2
  331. * @brief management functions
  332. *
  333. @verbatim
  334. ==============================================================================
  335. ##### FSMC_NORSRAM Control functions #####
  336. ==============================================================================
  337. [..]
  338. This subsection provides a set of functions allowing to control dynamically
  339. the FSMC NORSRAM interface.
  340. @endverbatim
  341. * @{
  342. */
  343. /**
  344. * @brief Enables dynamically FSMC_NORSRAM write operation.
  345. * @param Device Pointer to NORSRAM device instance
  346. * @param Bank NORSRAM bank number
  347. * @retval HAL status
  348. */
  349. HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank)
  350. {
  351. /* Check the parameters */
  352. assert_param(IS_FSMC_NORSRAM_DEVICE(Device));
  353. assert_param(IS_FSMC_NORSRAM_BANK(Bank));
  354. /* Enable write operation */
  355. Device->BTCR[Bank] |= FSMC_WRITE_OPERATION_ENABLE;
  356. return HAL_OK;
  357. }
  358. /**
  359. * @brief Disables dynamically FSMC_NORSRAM write operation.
  360. * @param Device Pointer to NORSRAM device instance
  361. * @param Bank NORSRAM bank number
  362. * @retval HAL status
  363. */
  364. HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank)
  365. {
  366. /* Check the parameters */
  367. assert_param(IS_FSMC_NORSRAM_DEVICE(Device));
  368. assert_param(IS_FSMC_NORSRAM_BANK(Bank));
  369. /* Disable write operation */
  370. Device->BTCR[Bank] &= ~FSMC_WRITE_OPERATION_ENABLE;
  371. return HAL_OK;
  372. }
  373. /**
  374. * @}
  375. */
  376. /**
  377. * @}
  378. */
  379. #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
  380. /** @addtogroup FSMC_LL_NAND
  381. * @brief NAND Controller functions
  382. *
  383. @verbatim
  384. ==============================================================================
  385. ##### How to use NAND device driver #####
  386. ==============================================================================
  387. [..]
  388. This driver contains a set of APIs to interface with the FSMC NAND banks in order
  389. to run the NAND external devices.
  390. (+) FSMC NAND bank reset using the function FSMC_NAND_DeInit()
  391. (+) FSMC NAND bank control configuration using the function FSMC_NAND_Init()
  392. (+) FSMC NAND bank common space timing configuration using the function
  393. FSMC_NAND_CommonSpace_Timing_Init()
  394. (+) FSMC NAND bank attribute space timing configuration using the function
  395. FSMC_NAND_AttributeSpace_Timing_Init()
  396. (+) FSMC NAND bank enable/disable ECC correction feature using the functions
  397. FSMC_NAND_ECC_Enable()/FSMC_NAND_ECC_Disable()
  398. (+) FSMC NAND bank get ECC correction code using the function FSMC_NAND_GetECC()
  399. @endverbatim
  400. * @{
  401. */
  402. /** @addtogroup FSMC_LL_NAND_Private_Functions_Group1
  403. * @brief Initialization and Configuration functions
  404. *
  405. @verbatim
  406. ==============================================================================
  407. ##### Initialization and de_initialization functions #####
  408. ==============================================================================
  409. [..]
  410. This section provides functions allowing to:
  411. (+) Initialize and configure the FSMC NAND interface
  412. (+) De-initialize the FSMC NAND interface
  413. (+) Configure the FSMC clock and associated GPIOs
  414. @endverbatim
  415. * @{
  416. */
  417. /**
  418. * @brief Initializes the FSMC_NAND device according to the specified
  419. * control parameters in the FSMC_NAND_HandleTypeDef
  420. * @param Device Pointer to NAND device instance
  421. * @param Init Pointer to NAND Initialization structure
  422. * @retval HAL status
  423. */
  424. HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDef *Init)
  425. {
  426. uint32_t tmpr = 0U;
  427. /* Check the parameters */
  428. assert_param(IS_FSMC_NAND_BANK(Init->NandBank));
  429. assert_param(IS_FSMC_WAIT_FEATURE(Init->Waitfeature));
  430. assert_param(IS_FSMC_NAND_MEMORY_WIDTH(Init->MemoryDataWidth));
  431. assert_param(IS_FSMC_ECC_STATE(Init->EccComputation));
  432. assert_param(IS_FSMC_ECCPAGE_SIZE(Init->ECCPageSize));
  433. assert_param(IS_FSMC_TCLR_TIME(Init->TCLRSetupTime));
  434. assert_param(IS_FSMC_TAR_TIME(Init->TARSetupTime));
  435. if(Init->NandBank == FSMC_NAND_BANK2)
  436. {
  437. /* Get the NAND bank 2 register value */
  438. tmpr = Device->PCR2;
  439. }
  440. else
  441. {
  442. /* Get the NAND bank 3 register value */
  443. tmpr = Device->PCR3;
  444. }
  445. /* Clear PWAITEN, PBKEN, PTYP, PWID, ECCEN, TCLR, TAR and ECCPS bits */
  446. tmpr &= ((uint32_t)~(FSMC_PCR2_PWAITEN | FSMC_PCR2_PBKEN | FSMC_PCR2_PTYP | \
  447. FSMC_PCR2_PWID | FSMC_PCR2_ECCEN | FSMC_PCR2_TCLR | \
  448. FSMC_PCR2_TAR | FSMC_PCR2_ECCPS));
  449. /* Set NAND device control parameters */
  450. tmpr |= (uint32_t)(Init->Waitfeature |\
  451. FSMC_PCR_MEMORY_TYPE_NAND |\
  452. Init->MemoryDataWidth |\
  453. Init->EccComputation |\
  454. Init->ECCPageSize |\
  455. ((Init->TCLRSetupTime) << 9U) |\
  456. ((Init->TARSetupTime) << 13U));
  457. if(Init->NandBank == FSMC_NAND_BANK2)
  458. {
  459. /* NAND bank 2 registers configuration */
  460. Device->PCR2 = tmpr;
  461. }
  462. else
  463. {
  464. /* NAND bank 3 registers configuration */
  465. Device->PCR3 = tmpr;
  466. }
  467. return HAL_OK;
  468. }
  469. /**
  470. * @brief Initializes the FSMC_NAND Common space Timing according to the specified
  471. * parameters in the FSMC_NAND_PCC_TimingTypeDef
  472. * @param Device Pointer to NAND device instance
  473. * @param Timing Pointer to NAND timing structure
  474. * @param Bank NAND bank number
  475. * @retval HAL status
  476. */
  477. HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
  478. {
  479. uint32_t tmpr = 0U;
  480. /* Check the parameters */
  481. assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime));
  482. assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime));
  483. assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime));
  484. assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime));
  485. if(Bank == FSMC_NAND_BANK2)
  486. {
  487. /* Get the NAND bank 2 register value */
  488. tmpr = Device->PMEM2;
  489. }
  490. else
  491. {
  492. /* Get the NAND bank 3 register value */
  493. tmpr = Device->PMEM3;
  494. }
  495. /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */
  496. tmpr &= ((uint32_t)~(FSMC_PMEM2_MEMSET2 | FSMC_PMEM2_MEMWAIT2 | FSMC_PMEM2_MEMHOLD2 | \
  497. FSMC_PMEM2_MEMHIZ2));
  498. /* Set FSMC_NAND device timing parameters */
  499. tmpr |= (uint32_t)(Timing->SetupTime |\
  500. ((Timing->WaitSetupTime) << 8U) |\
  501. ((Timing->HoldSetupTime) << 16U) |\
  502. ((Timing->HiZSetupTime) << 24U)
  503. );
  504. if(Bank == FSMC_NAND_BANK2)
  505. {
  506. /* NAND bank 2 registers configuration */
  507. Device->PMEM2 = tmpr;
  508. }
  509. else
  510. {
  511. /* NAND bank 3 registers configuration */
  512. Device->PMEM3 = tmpr;
  513. }
  514. return HAL_OK;
  515. }
  516. /**
  517. * @brief Initializes the FSMC_NAND Attribute space Timing according to the specified
  518. * parameters in the FSMC_NAND_PCC_TimingTypeDef
  519. * @param Device Pointer to NAND device instance
  520. * @param Timing Pointer to NAND timing structure
  521. * @param Bank NAND bank number
  522. * @retval HAL status
  523. */
  524. HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
  525. {
  526. uint32_t tmpr = 0U;
  527. /* Check the parameters */
  528. assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime));
  529. assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime));
  530. assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime));
  531. assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime));
  532. if(Bank == FSMC_NAND_BANK2)
  533. {
  534. /* Get the NAND bank 2 register value */
  535. tmpr = Device->PATT2;
  536. }
  537. else
  538. {
  539. /* Get the NAND bank 3 register value */
  540. tmpr = Device->PATT3;
  541. }
  542. /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */
  543. tmpr &= ((uint32_t)~(FSMC_PATT2_ATTSET2 | FSMC_PATT2_ATTWAIT2 | FSMC_PATT2_ATTHOLD2 | \
  544. FSMC_PATT2_ATTHIZ2));
  545. /* Set FSMC_NAND device timing parameters */
  546. tmpr |= (uint32_t)(Timing->SetupTime |\
  547. ((Timing->WaitSetupTime) << 8U) |\
  548. ((Timing->HoldSetupTime) << 16U) |\
  549. ((Timing->HiZSetupTime) << 24U)
  550. );
  551. if(Bank == FSMC_NAND_BANK2)
  552. {
  553. /* NAND bank 2 registers configuration */
  554. Device->PATT2 = tmpr;
  555. }
  556. else
  557. {
  558. /* NAND bank 3 registers configuration */
  559. Device->PATT3 = tmpr;
  560. }
  561. return HAL_OK;
  562. }
  563. /**
  564. * @brief DeInitializes the FSMC_NAND device
  565. * @param Device Pointer to NAND device instance
  566. * @param Bank NAND bank number
  567. * @retval HAL status
  568. */
  569. HAL_StatusTypeDef FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank)
  570. {
  571. /* Disable the NAND Bank */
  572. __FSMC_NAND_DISABLE(Device, Bank);
  573. /* De-initialize the NAND Bank */
  574. if(Bank == FSMC_NAND_BANK2)
  575. {
  576. /* Set the FSMC_NAND_BANK2 registers to their reset values */
  577. Device->PCR2 = 0x00000018U;
  578. Device->SR2 = 0x00000040U;
  579. Device->PMEM2 = 0xFCFCFCFCU;
  580. Device->PATT2 = 0xFCFCFCFCU;
  581. }
  582. /* FSMC_Bank3_NAND */
  583. else
  584. {
  585. /* Set the FSMC_NAND_BANK3 registers to their reset values */
  586. Device->PCR3 = 0x00000018U;
  587. Device->SR3 = 0x00000040U;
  588. Device->PMEM3 = 0xFCFCFCFCU;
  589. Device->PATT3 = 0xFCFCFCFCU;
  590. }
  591. return HAL_OK;
  592. }
  593. /**
  594. * @}
  595. */
  596. /** @addtogroup FSMC_LL_NAND_Private_Functions_Group2
  597. * @brief management functions
  598. *
  599. @verbatim
  600. ==============================================================================
  601. ##### FSMC_NAND Control functions #####
  602. ==============================================================================
  603. [..]
  604. This subsection provides a set of functions allowing to control dynamically
  605. the FSMC NAND interface.
  606. @endverbatim
  607. * @{
  608. */
  609. /**
  610. * @brief Enables dynamically FSMC_NAND ECC feature.
  611. * @param Device Pointer to NAND device instance
  612. * @param Bank NAND bank number
  613. * @retval HAL status
  614. */
  615. HAL_StatusTypeDef FSMC_NAND_ECC_Enable(FSMC_NAND_TypeDef *Device, uint32_t Bank)
  616. {
  617. /* Enable ECC feature */
  618. if(Bank == FSMC_NAND_BANK2)
  619. {
  620. Device->PCR2 |= FSMC_PCR2_ECCEN;
  621. }
  622. else
  623. {
  624. Device->PCR3 |= FSMC_PCR3_ECCEN;
  625. }
  626. return HAL_OK;
  627. }
  628. /**
  629. * @brief Disables dynamically FSMC_NAND ECC feature.
  630. * @param Device Pointer to NAND device instance
  631. * @param Bank NAND bank number
  632. * @retval HAL status
  633. */
  634. HAL_StatusTypeDef FSMC_NAND_ECC_Disable(FSMC_NAND_TypeDef *Device, uint32_t Bank)
  635. {
  636. /* Disable ECC feature */
  637. if(Bank == FSMC_NAND_BANK2)
  638. {
  639. Device->PCR2 &= ~FSMC_PCR2_ECCEN;
  640. }
  641. else
  642. {
  643. Device->PCR3 &= ~FSMC_PCR3_ECCEN;
  644. }
  645. return HAL_OK;
  646. }
  647. /**
  648. * @brief Disables dynamically FSMC_NAND ECC feature.
  649. * @param Device Pointer to NAND device instance
  650. * @param ECCval Pointer to ECC value
  651. * @param Bank NAND bank number
  652. * @param Timeout Timeout wait value
  653. * @retval HAL status
  654. */
  655. HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout)
  656. {
  657. uint32_t tickstart = 0U;
  658. /* Check the parameters */
  659. assert_param(IS_FSMC_NAND_DEVICE(Device));
  660. assert_param(IS_FSMC_NAND_BANK(Bank));
  661. /* Get tick */
  662. tickstart = HAL_GetTick();
  663. /* Wait until FIFO is empty */
  664. while(__FSMC_NAND_GET_FLAG(Device, Bank, FSMC_FLAG_FEMPT) == RESET)
  665. {
  666. /* Check for the Timeout */
  667. if(Timeout != HAL_MAX_DELAY)
  668. {
  669. if((Timeout == 0U)||((HAL_GetTick() - tickstart ) > Timeout))
  670. {
  671. return HAL_TIMEOUT;
  672. }
  673. }
  674. }
  675. if(Bank == FSMC_NAND_BANK2)
  676. {
  677. /* Get the ECCR2 register value */
  678. *ECCval = (uint32_t)Device->ECCR2;
  679. }
  680. else
  681. {
  682. /* Get the ECCR3 register value */
  683. *ECCval = (uint32_t)Device->ECCR3;
  684. }
  685. return HAL_OK;
  686. }
  687. /**
  688. * @}
  689. */
  690. /**
  691. * @}
  692. */
  693. /** @addtogroup FSMC_LL_PCCARD
  694. * @brief PCCARD Controller functions
  695. *
  696. @verbatim
  697. ==============================================================================
  698. ##### How to use PCCARD device driver #####
  699. ==============================================================================
  700. [..]
  701. This driver contains a set of APIs to interface with the FSMC PCCARD bank in order
  702. to run the PCCARD/compact flash external devices.
  703. (+) FSMC PCCARD bank reset using the function FSMC_PCCARD_DeInit()
  704. (+) FSMC PCCARD bank control configuration using the function FSMC_PCCARD_Init()
  705. (+) FSMC PCCARD bank common space timing configuration using the function
  706. FSMC_PCCARD_CommonSpace_Timing_Init()
  707. (+) FSMC PCCARD bank attribute space timing configuration using the function
  708. FSMC_PCCARD_AttributeSpace_Timing_Init()
  709. (+) FSMC PCCARD bank IO space timing configuration using the function
  710. FSMC_PCCARD_IOSpace_Timing_Init()
  711. @endverbatim
  712. * @{
  713. */
  714. /** @addtogroup FSMC_LL_PCCARD_Private_Functions_Group1
  715. * @brief Initialization and Configuration functions
  716. *
  717. @verbatim
  718. ==============================================================================
  719. ##### Initialization and de_initialization functions #####
  720. ==============================================================================
  721. [..]
  722. This section provides functions allowing to:
  723. (+) Initialize and configure the FSMC PCCARD interface
  724. (+) De-initialize the FSMC PCCARD interface
  725. (+) Configure the FSMC clock and associated GPIOs
  726. @endverbatim
  727. * @{
  728. */
  729. /**
  730. * @brief Initializes the FSMC_PCCARD device according to the specified
  731. * control parameters in the FSMC_PCCARD_HandleTypeDef
  732. * @param Device Pointer to PCCARD device instance
  733. * @param Init Pointer to PCCARD Initialization structure
  734. * @retval HAL status
  735. */
  736. HAL_StatusTypeDef FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_InitTypeDef *Init)
  737. {
  738. uint32_t tmpr = 0U;
  739. /* Check the parameters */
  740. assert_param(IS_FSMC_WAIT_FEATURE(Init->Waitfeature));
  741. assert_param(IS_FSMC_TCLR_TIME(Init->TCLRSetupTime));
  742. assert_param(IS_FSMC_TAR_TIME(Init->TARSetupTime));
  743. /* Get PCCARD control register value */
  744. tmpr = Device->PCR4;
  745. /* Clear TAR, TCLR, PWAITEN and PWID bits */
  746. tmpr &= ((uint32_t)~(FSMC_PCR4_TAR | FSMC_PCR4_TCLR | FSMC_PCR4_PWAITEN | \
  747. FSMC_PCR4_PWID | FSMC_PCR4_PTYP));
  748. /* Set FSMC_PCCARD device control parameters */
  749. tmpr |= (uint32_t)(Init->Waitfeature |\
  750. FSMC_NAND_PCC_MEM_BUS_WIDTH_16 |\
  751. (Init->TCLRSetupTime << 9U) |\
  752. (Init->TARSetupTime << 13U));
  753. Device->PCR4 = tmpr;
  754. return HAL_OK;
  755. }
  756. /**
  757. * @brief Initializes the FSMC_PCCARD Common space Timing according to the specified
  758. * parameters in the FSMC_NAND_PCC_TimingTypeDef
  759. * @param Device Pointer to PCCARD device instance
  760. * @param Timing Pointer to PCCARD timing structure
  761. * @retval HAL status
  762. */
  763. HAL_StatusTypeDef FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing)
  764. {
  765. uint32_t tmpr = 0U;
  766. /* Check the parameters */
  767. assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime));
  768. assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime));
  769. assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime));
  770. assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime));
  771. /* Get PCCARD common space timing register value */
  772. tmpr = Device->PMEM4;
  773. /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */
  774. tmpr &= ((uint32_t)~(FSMC_PMEM4_MEMSET4 | FSMC_PMEM4_MEMWAIT4 | FSMC_PMEM4_MEMHOLD4 | \
  775. FSMC_PMEM4_MEMHIZ4));
  776. /* Set PCCARD timing parameters */
  777. tmpr |= (uint32_t)((Timing->SetupTime |\
  778. ((Timing->WaitSetupTime) << 8U) |\
  779. (Timing->HoldSetupTime) << 16U) |\
  780. ((Timing->HiZSetupTime) << 24U));
  781. Device->PMEM4 = tmpr;
  782. return HAL_OK;
  783. }
  784. /**
  785. * @brief Initializes the FSMC_PCCARD Attribute space Timing according to the specified
  786. * parameters in the FSMC_NAND_PCC_TimingTypeDef
  787. * @param Device Pointer to PCCARD device instance
  788. * @param Timing Pointer to PCCARD timing structure
  789. * @retval HAL status
  790. */
  791. HAL_StatusTypeDef FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing)
  792. {
  793. uint32_t tmpr = 0U;
  794. /* Check the parameters */
  795. assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime));
  796. assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime));
  797. assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime));
  798. assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime));
  799. /* Get PCCARD timing parameters */
  800. tmpr = Device->PATT4;
  801. /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */
  802. tmpr &= ((uint32_t)~(FSMC_PATT4_ATTSET4 | FSMC_PATT4_ATTWAIT4 | FSMC_PATT4_ATTHOLD4 | \
  803. FSMC_PATT4_ATTHIZ4));
  804. /* Set PCCARD timing parameters */
  805. tmpr |= (uint32_t)(Timing->SetupTime |\
  806. ((Timing->WaitSetupTime) << 8U) |\
  807. ((Timing->HoldSetupTime) << 16U) |\
  808. ((Timing->HiZSetupTime) << 24U));
  809. Device->PATT4 = tmpr;
  810. return HAL_OK;
  811. }
  812. /**
  813. * @brief Initializes the FSMC_PCCARD IO space Timing according to the specified
  814. * parameters in the FSMC_NAND_PCC_TimingTypeDef
  815. * @param Device Pointer to PCCARD device instance
  816. * @param Timing Pointer to PCCARD timing structure
  817. * @retval HAL status
  818. */
  819. HAL_StatusTypeDef FSMC_PCCARD_IOSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing)
  820. {
  821. uint32_t tmpr = 0U;
  822. /* Check the parameters */
  823. assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime));
  824. assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime));
  825. assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime));
  826. assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime));
  827. /* Get FSMC_PCCARD device timing parameters */
  828. tmpr = Device->PIO4;
  829. /* Clear IOSET4, IOWAIT4, IOHOLD4 and IOHIZ4 bits */
  830. tmpr &= ((uint32_t)~(FSMC_PIO4_IOSET4 | FSMC_PIO4_IOWAIT4 | FSMC_PIO4_IOHOLD4 | \
  831. FSMC_PIO4_IOHIZ4));
  832. /* Set FSMC_PCCARD device timing parameters */
  833. tmpr |= (uint32_t)(Timing->SetupTime |\
  834. ((Timing->WaitSetupTime) << 8U) |\
  835. ((Timing->HoldSetupTime) << 16U) |\
  836. ((Timing->HiZSetupTime) << 24U));
  837. Device->PIO4 = tmpr;
  838. return HAL_OK;
  839. }
  840. /**
  841. * @brief DeInitializes the FSMC_PCCARD device
  842. * @param Device Pointer to PCCARD device instance
  843. * @retval HAL status
  844. */
  845. HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device)
  846. {
  847. /* Disable the FSMC_PCCARD device */
  848. __FSMC_PCCARD_DISABLE(Device);
  849. /* De-initialize the FSMC_PCCARD device */
  850. Device->PCR4 = 0x00000018U;
  851. Device->SR4 = 0x00000000U;
  852. Device->PMEM4 = 0xFCFCFCFCU;
  853. Device->PATT4 = 0xFCFCFCFCU;
  854. Device->PIO4 = 0xFCFCFCFCU;
  855. return HAL_OK;
  856. }
  857. /**
  858. * @}
  859. */
  860. /**
  861. * @}
  862. */
  863. #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
  864. /**
  865. * @}
  866. */
  867. #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx || STM32F413xx || STM32F423xx */
  868. #endif /* HAL_SRAM_MODULE_ENABLED || HAL_NOR_MODULE_ENABLED || HAL_NAND_MODULE_ENABLED || HAL_PCCARD_MODULE_ENABLED */
  869. /**
  870. * @}
  871. */
  872. /**
  873. * @}
  874. */
  875. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/