You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1067 lines
39 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_ll_fmc.c
  4. * @author MCD Application Team
  5. * @brief FMC Low Layer HAL module driver.
  6. *
  7. * This file provides firmware functions to manage the following
  8. * functionalities of the Flexible Memory Controller (FMC) peripheral memories:
  9. * + Initialization/de-initialization functions
  10. * + Peripheral Control functions
  11. * + Peripheral State functions
  12. *
  13. @verbatim
  14. ==============================================================================
  15. ##### FMC peripheral features #####
  16. ==============================================================================
  17. [..] The Flexible memory controller (FMC) includes following memory controllers:
  18. (+) The NOR/PSRAM memory controller
  19. (+) The NAND memory controller
  20. (+) The Synchronous DRAM (SDRAM) controller
  21. [..] The FMC functional block makes the interface with synchronous and asynchronous static
  22. memories and SDRAM memories. Its main purposes are:
  23. (+) to translate AHB transactions into the appropriate external device protocol
  24. (+) to meet the access time requirements of the external memory devices
  25. [..] All external memories share the addresses, data and control signals with the controller.
  26. Each external device is accessed by means of a unique Chip Select. The FMC performs
  27. only one access at a time to an external device.
  28. The main features of the FMC controller are the following:
  29. (+) Interface with static-memory mapped devices including:
  30. (++) Static random access memory (SRAM)
  31. (++) Read-only memory (ROM)
  32. (++) NOR Flash memory/OneNAND Flash memory
  33. (++) PSRAM (4 memory banks)
  34. (++) Two banks of NAND Flash memory with ECC hardware to check up to 8 Kbytes of
  35. data
  36. (+) Interface with synchronous DRAM (SDRAM) memories
  37. (+) Independent Chip Select control for each memory bank
  38. (+) Independent configuration for each memory bank
  39. @endverbatim
  40. ******************************************************************************
  41. * @attention
  42. *
  43. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  44. * All rights reserved.</center></h2>
  45. *
  46. * This software component is licensed by ST under BSD 3-Clause license,
  47. * the "License"; You may not use this file except in compliance with the
  48. * License. You may obtain a copy of the License at:
  49. * opensource.org/licenses/BSD-3-Clause
  50. *
  51. ******************************************************************************
  52. */
  53. /* Includes ------------------------------------------------------------------*/
  54. #include "stm32h7xx_hal.h"
  55. /** @addtogroup STM32H7xx_HAL_Driver
  56. * @{
  57. */
  58. #if (((defined HAL_NOR_MODULE_ENABLED || defined HAL_SRAM_MODULE_ENABLED)) || defined HAL_NAND_MODULE_ENABLED || defined HAL_SDRAM_MODULE_ENABLED)
  59. /** @defgroup FMC_LL FMC Low Layer
  60. * @brief FMC driver modules
  61. * @{
  62. */
  63. /* Private typedef -----------------------------------------------------------*/
  64. /* Private define ------------------------------------------------------------*/
  65. /** @defgroup FMC_LL_Private_Constants FMC Low Layer Private Constants
  66. * @{
  67. */
  68. /* ----------------------- FMC registers bit mask --------------------------- */
  69. /* --- BCR Register ---*/
  70. /* BCR register clear mask */
  71. /* --- BTR Register ---*/
  72. /* BTR register clear mask */
  73. #define BTR_CLEAR_MASK ((uint32_t)(FMC_BTRx_ADDSET | FMC_BTRx_ADDHLD |\
  74. FMC_BTRx_DATAST | FMC_BTRx_BUSTURN |\
  75. FMC_BTRx_CLKDIV | FMC_BTRx_DATLAT |\
  76. FMC_BTRx_ACCMOD))
  77. /* --- BWTR Register ---*/
  78. /* BWTR register clear mask */
  79. #if defined(FMC_BWTRx_BUSTURN)
  80. #define BWTR_CLEAR_MASK ((uint32_t)(FMC_BWTRx_ADDSET | FMC_BWTRx_ADDHLD |\
  81. FMC_BWTRx_DATAST | FMC_BWTRx_BUSTURN |\
  82. FMC_BWTRx_ACCMOD))
  83. #else
  84. #define BWTR_CLEAR_MASK ((uint32_t)(FMC_BWTRx_ADDSET | FMC_BWTRx_ADDHLD |\
  85. FMC_BWTRx_DATAST | FMC_BWTRx_ACCMOD))
  86. #endif /* FMC_BWTRx_BUSTURN */
  87. /* --- PCR Register ---*/
  88. /* PCR register clear mask */
  89. #define PCR_CLEAR_MASK ((uint32_t)(FMC_PCR_PWAITEN | FMC_PCR_PBKEN | \
  90. FMC_PCR_PWID | FMC_PCR_ECCEN | \
  91. FMC_PCR_TCLR | FMC_PCR_TAR | \
  92. FMC_PCR_ECCPS))
  93. /* --- PMEM Register ---*/
  94. /* PMEM register clear mask */
  95. #define PMEM_CLEAR_MASK ((uint32_t)(FMC_PMEM_MEMSET | FMC_PMEM_MEMWAIT |\
  96. FMC_PMEM_MEMHOLD | FMC_PMEM_MEMHIZ))
  97. /* --- PATT Register ---*/
  98. /* PATT register clear mask */
  99. #define PATT_CLEAR_MASK ((uint32_t)(FMC_PATT_ATTSET | FMC_PATT_ATTWAIT |\
  100. FMC_PATT_ATTHOLD | FMC_PATT_ATTHIZ))
  101. /* --- SDCR Register ---*/
  102. /* SDCR register clear mask */
  103. #define SDCR_CLEAR_MASK ((uint32_t)(FMC_SDCRx_NC | FMC_SDCRx_NR | \
  104. FMC_SDCRx_MWID | FMC_SDCRx_NB | \
  105. FMC_SDCRx_CAS | FMC_SDCRx_WP | \
  106. FMC_SDCRx_SDCLK | FMC_SDCRx_RBURST | \
  107. FMC_SDCRx_RPIPE))
  108. /* --- SDTR Register ---*/
  109. /* SDTR register clear mask */
  110. #define SDTR_CLEAR_MASK ((uint32_t)(FMC_SDTRx_TMRD | FMC_SDTRx_TXSR | \
  111. FMC_SDTRx_TRAS | FMC_SDTRx_TRC | \
  112. FMC_SDTRx_TWR | FMC_SDTRx_TRP | \
  113. FMC_SDTRx_TRCD))
  114. /**
  115. * @}
  116. */
  117. /* Private macro -------------------------------------------------------------*/
  118. /* Private variables ---------------------------------------------------------*/
  119. /* Private function prototypes -----------------------------------------------*/
  120. /* Exported functions --------------------------------------------------------*/
  121. /** @defgroup FMC_LL_Exported_Functions FMC Low Layer Exported Functions
  122. * @{
  123. */
  124. /** @defgroup FMC_LL_Exported_Functions_NORSRAM FMC Low Layer NOR SRAM Exported Functions
  125. * @brief NORSRAM Controller functions
  126. *
  127. @verbatim
  128. ==============================================================================
  129. ##### How to use NORSRAM device driver #####
  130. ==============================================================================
  131. [..]
  132. This driver contains a set of APIs to interface with the FMC NORSRAM banks in order
  133. to run the NORSRAM external devices.
  134. (+) FMC NORSRAM bank reset using the function FMC_NORSRAM_DeInit()
  135. (+) FMC NORSRAM bank control configuration using the function FMC_NORSRAM_Init()
  136. (+) FMC NORSRAM bank timing configuration using the function FMC_NORSRAM_Timing_Init()
  137. (+) FMC NORSRAM bank extended timing configuration using the function
  138. FMC_NORSRAM_Extended_Timing_Init()
  139. (+) FMC NORSRAM bank enable/disable write operation using the functions
  140. FMC_NORSRAM_WriteOperation_Enable()/FMC_NORSRAM_WriteOperation_Disable()
  141. @endverbatim
  142. * @{
  143. */
  144. /** @defgroup FMC_LL_NORSRAM_Exported_Functions_Group1 Initialization and de-initialization functions
  145. * @brief Initialization and Configuration functions
  146. *
  147. @verbatim
  148. ==============================================================================
  149. ##### Initialization and de_initialization functions #####
  150. ==============================================================================
  151. [..]
  152. This section provides functions allowing to:
  153. (+) Initialize and configure the FMC NORSRAM interface
  154. (+) De-initialize the FMC NORSRAM interface
  155. (+) Configure the FMC clock and associated GPIOs
  156. @endverbatim
  157. * @{
  158. */
  159. /**
  160. * @brief Initialize the FMC_NORSRAM device according to the specified
  161. * control parameters in the FMC_NORSRAM_InitTypeDef
  162. * @param Device Pointer to NORSRAM device instance
  163. * @param Init Pointer to NORSRAM Initialization structure
  164. * @retval HAL status
  165. */
  166. HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_InitTypeDef *Init)
  167. {
  168. uint32_t flashaccess;
  169. /* Check the parameters */
  170. assert_param(IS_FMC_NORSRAM_DEVICE(Device));
  171. assert_param(IS_FMC_NORSRAM_BANK(Init->NSBank));
  172. assert_param(IS_FMC_MUX(Init->DataAddressMux));
  173. assert_param(IS_FMC_MEMORY(Init->MemoryType));
  174. assert_param(IS_FMC_NORSRAM_MEMORY_WIDTH(Init->MemoryDataWidth));
  175. assert_param(IS_FMC_BURSTMODE(Init->BurstAccessMode));
  176. assert_param(IS_FMC_WAIT_POLARITY(Init->WaitSignalPolarity));
  177. assert_param(IS_FMC_WAIT_SIGNAL_ACTIVE(Init->WaitSignalActive));
  178. assert_param(IS_FMC_WRITE_OPERATION(Init->WriteOperation));
  179. assert_param(IS_FMC_WAITE_SIGNAL(Init->WaitSignal));
  180. assert_param(IS_FMC_EXTENDED_MODE(Init->ExtendedMode));
  181. assert_param(IS_FMC_ASYNWAIT(Init->AsynchronousWait));
  182. assert_param(IS_FMC_WRITE_BURST(Init->WriteBurst));
  183. assert_param(IS_FMC_CONTINOUS_CLOCK(Init->ContinuousClock));
  184. assert_param(IS_FMC_WRITE_FIFO(Init->WriteFifo));
  185. assert_param(IS_FMC_PAGESIZE(Init->PageSize));
  186. /* Disable NORSRAM Device */
  187. __FMC_NORSRAM_DISABLE(Device, Init->NSBank);
  188. /* Set NORSRAM device control parameters */
  189. if (Init->MemoryType == FMC_MEMORY_TYPE_NOR)
  190. {
  191. flashaccess = FMC_NORSRAM_FLASH_ACCESS_ENABLE;
  192. }
  193. else
  194. {
  195. flashaccess = FMC_NORSRAM_FLASH_ACCESS_DISABLE;
  196. }
  197. MODIFY_REG(Device->BTCR[Init->NSBank],
  198. (FMC_BCRx_MBKEN |
  199. FMC_BCRx_MUXEN |
  200. FMC_BCRx_MTYP |
  201. FMC_BCRx_MWID |
  202. FMC_BCRx_FACCEN |
  203. FMC_BCRx_BURSTEN |
  204. FMC_BCRx_WAITPOL |
  205. FMC_BCRx_WAITCFG |
  206. FMC_BCRx_WREN |
  207. FMC_BCRx_WAITEN |
  208. FMC_BCRx_EXTMOD |
  209. FMC_BCRx_ASYNCWAIT |
  210. FMC_BCRx_CBURSTRW |
  211. FMC_BCR1_CCLKEN |
  212. FMC_BCR1_WFDIS |
  213. FMC_BCRx_CPSIZE),
  214. (flashaccess |
  215. Init->DataAddressMux |
  216. Init->MemoryType |
  217. Init->MemoryDataWidth |
  218. Init->BurstAccessMode |
  219. Init->WaitSignalPolarity |
  220. Init->WaitSignalActive |
  221. Init->WriteOperation |
  222. Init->WaitSignal |
  223. Init->ExtendedMode |
  224. Init->AsynchronousWait |
  225. Init->WriteBurst |
  226. Init->ContinuousClock |
  227. Init->WriteFifo |
  228. Init->PageSize));
  229. /* Configure synchronous mode when Continuous clock is enabled for bank2..4 */
  230. if ((Init->ContinuousClock == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC) && (Init->NSBank != FMC_NORSRAM_BANK1))
  231. {
  232. MODIFY_REG(Device->BTCR[FMC_NORSRAM_BANK1], FMC_BCR1_CCLKEN, Init->ContinuousClock);
  233. }
  234. if (Init->NSBank != FMC_NORSRAM_BANK1)
  235. {
  236. /* Configure Write FIFO mode when Write Fifo is enabled for bank2..4 */
  237. SET_BIT(Device->BTCR[FMC_NORSRAM_BANK1], (uint32_t)(Init->WriteFifo));
  238. }
  239. return HAL_OK;
  240. }
  241. /**
  242. * @brief DeInitialize the FMC_NORSRAM peripheral
  243. * @param Device Pointer to NORSRAM device instance
  244. * @param ExDevice Pointer to NORSRAM extended mode device instance
  245. * @param Bank NORSRAM bank number
  246. * @retval HAL status
  247. */
  248. HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank)
  249. {
  250. /* Check the parameters */
  251. assert_param(IS_FMC_NORSRAM_DEVICE(Device));
  252. assert_param(IS_FMC_NORSRAM_EXTENDED_DEVICE(ExDevice));
  253. assert_param(IS_FMC_NORSRAM_BANK(Bank));
  254. /* Disable the FMC_NORSRAM device */
  255. __FMC_NORSRAM_DISABLE(Device, Bank);
  256. /* De-initialize the FMC_NORSRAM device */
  257. /* FMC_NORSRAM_BANK1 */
  258. if (Bank == FMC_NORSRAM_BANK1)
  259. {
  260. Device->BTCR[Bank] = 0x000030DBU;
  261. }
  262. /* FMC_NORSRAM_BANK2, FMC_NORSRAM_BANK3 or FMC_NORSRAM_BANK4 */
  263. else
  264. {
  265. Device->BTCR[Bank] = 0x000030D2U;
  266. }
  267. Device->BTCR[Bank + 1U] = 0x0FFFFFFFU;
  268. ExDevice->BWTR[Bank] = 0x0FFFFFFFU;
  269. return HAL_OK;
  270. }
  271. /**
  272. * @brief Initialize the FMC_NORSRAM Timing according to the specified
  273. * parameters in the FMC_NORSRAM_TimingTypeDef
  274. * @param Device Pointer to NORSRAM device instance
  275. * @param Timing Pointer to NORSRAM Timing structure
  276. * @param Bank NORSRAM bank number
  277. * @retval HAL status
  278. */
  279. HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank)
  280. {
  281. uint32_t tmpr;
  282. /* Check the parameters */
  283. assert_param(IS_FMC_NORSRAM_DEVICE(Device));
  284. assert_param(IS_FMC_ADDRESS_SETUP_TIME(Timing->AddressSetupTime));
  285. assert_param(IS_FMC_ADDRESS_HOLD_TIME(Timing->AddressHoldTime));
  286. assert_param(IS_FMC_DATASETUP_TIME(Timing->DataSetupTime));
  287. assert_param(IS_FMC_TURNAROUND_TIME(Timing->BusTurnAroundDuration));
  288. assert_param(IS_FMC_CLK_DIV(Timing->CLKDivision));
  289. assert_param(IS_FMC_DATA_LATENCY(Timing->DataLatency));
  290. assert_param(IS_FMC_ACCESS_MODE(Timing->AccessMode));
  291. assert_param(IS_FMC_NORSRAM_BANK(Bank));
  292. /* Set FMC_NORSRAM device timing parameters */
  293. MODIFY_REG(Device->BTCR[Bank + 1U], BTR_CLEAR_MASK, (Timing->AddressSetupTime |
  294. ((Timing->AddressHoldTime) << FMC_BTRx_ADDHLD_Pos) |
  295. ((Timing->DataSetupTime) << FMC_BTRx_DATAST_Pos) |
  296. ((Timing->BusTurnAroundDuration) << FMC_BTRx_BUSTURN_Pos) |
  297. (((Timing->CLKDivision) - 1U) << FMC_BTRx_CLKDIV_Pos) |
  298. (((Timing->DataLatency) - 2U) << FMC_BTRx_DATLAT_Pos) |
  299. (Timing->AccessMode)));
  300. /* Configure Clock division value (in NORSRAM bank 1) when continuous clock is enabled */
  301. if (HAL_IS_BIT_SET(Device->BTCR[FMC_NORSRAM_BANK1], FMC_BCR1_CCLKEN))
  302. {
  303. tmpr = (uint32_t)(Device->BTCR[FMC_NORSRAM_BANK1 + 1U] & ~(((uint32_t)0x0F) << FMC_BTRx_CLKDIV_Pos));
  304. tmpr |= (uint32_t)(((Timing->CLKDivision) - 1U) << FMC_BTRx_CLKDIV_Pos);
  305. MODIFY_REG(Device->BTCR[FMC_NORSRAM_BANK1 + 1U], FMC_BTRx_CLKDIV, tmpr);
  306. }
  307. return HAL_OK;
  308. }
  309. /**
  310. * @brief Initialize the FMC_NORSRAM Extended mode Timing according to the specified
  311. * parameters in the FMC_NORSRAM_TimingTypeDef
  312. * @param Device Pointer to NORSRAM device instance
  313. * @param Timing Pointer to NORSRAM Timing structure
  314. * @param Bank NORSRAM bank number
  315. * @param ExtendedMode FMC Extended Mode
  316. * This parameter can be one of the following values:
  317. * @arg FMC_EXTENDED_MODE_DISABLE
  318. * @arg FMC_EXTENDED_MODE_ENABLE
  319. * @retval HAL status
  320. */
  321. HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode)
  322. {
  323. /* Check the parameters */
  324. assert_param(IS_FMC_EXTENDED_MODE(ExtendedMode));
  325. /* Set NORSRAM device timing register for write configuration, if extended mode is used */
  326. if (ExtendedMode == FMC_EXTENDED_MODE_ENABLE)
  327. {
  328. /* Check the parameters */
  329. assert_param(IS_FMC_NORSRAM_EXTENDED_DEVICE(Device));
  330. assert_param(IS_FMC_ADDRESS_SETUP_TIME(Timing->AddressSetupTime));
  331. assert_param(IS_FMC_ADDRESS_HOLD_TIME(Timing->AddressHoldTime));
  332. assert_param(IS_FMC_DATASETUP_TIME(Timing->DataSetupTime));
  333. #if defined(FMC_BWTRx_BUSTURN)
  334. assert_param(IS_FMC_TURNAROUND_TIME(Timing->BusTurnAroundDuration));
  335. #endif /* FMC_BWTRx_BUSTURN */
  336. assert_param(IS_FMC_ACCESS_MODE(Timing->AccessMode));
  337. assert_param(IS_FMC_NORSRAM_BANK(Bank));
  338. /* Set NORSRAM device timing register for write configuration, if extended mode is used */
  339. MODIFY_REG(Device->BWTR[Bank], BWTR_CLEAR_MASK, (Timing->AddressSetupTime |
  340. ((Timing->AddressHoldTime) << FMC_BWTRx_ADDHLD_Pos) |
  341. ((Timing->DataSetupTime) << FMC_BWTRx_DATAST_Pos) |
  342. #if defined(FMC_BWTRx_BUSTURN)
  343. Timing->AccessMode |
  344. ((Timing->BusTurnAroundDuration) << FMC_BWTRx_BUSTURN_Pos)));
  345. #else
  346. Timing->AccessMode));
  347. #endif /* FMC_BWTRx_BUSTURN */
  348. }
  349. else
  350. {
  351. Device->BWTR[Bank] = 0x0FFFFFFFU;
  352. }
  353. return HAL_OK;
  354. }
  355. /**
  356. * @}
  357. */
  358. /** @addtogroup FMC_LL_NORSRAM_Private_Functions_Group2
  359. * @brief management functions
  360. *
  361. @verbatim
  362. ==============================================================================
  363. ##### FMC_NORSRAM Control functions #####
  364. ==============================================================================
  365. [..]
  366. This subsection provides a set of functions allowing to control dynamically
  367. the FMC NORSRAM interface.
  368. @endverbatim
  369. * @{
  370. */
  371. /**
  372. * @brief Enables dynamically FMC_NORSRAM write operation.
  373. * @param Device Pointer to NORSRAM device instance
  374. * @param Bank NORSRAM bank number
  375. * @retval HAL status
  376. */
  377. HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Enable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank)
  378. {
  379. /* Check the parameters */
  380. assert_param(IS_FMC_NORSRAM_DEVICE(Device));
  381. assert_param(IS_FMC_NORSRAM_BANK(Bank));
  382. /* Enable write operation */
  383. SET_BIT(Device->BTCR[Bank], FMC_WRITE_OPERATION_ENABLE);
  384. return HAL_OK;
  385. }
  386. /**
  387. * @brief Disables dynamically FMC_NORSRAM write operation.
  388. * @param Device Pointer to NORSRAM device instance
  389. * @param Bank NORSRAM bank number
  390. * @retval HAL status
  391. */
  392. HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank)
  393. {
  394. /* Check the parameters */
  395. assert_param(IS_FMC_NORSRAM_DEVICE(Device));
  396. assert_param(IS_FMC_NORSRAM_BANK(Bank));
  397. /* Disable write operation */
  398. CLEAR_BIT(Device->BTCR[Bank], FMC_WRITE_OPERATION_ENABLE);
  399. return HAL_OK;
  400. }
  401. /**
  402. * @}
  403. */
  404. /**
  405. * @}
  406. */
  407. /** @defgroup FMC_LL_Exported_Functions_NAND FMC Low Layer NAND Exported Functions
  408. * @brief NAND Controller functions
  409. *
  410. @verbatim
  411. ==============================================================================
  412. ##### How to use NAND device driver #####
  413. ==============================================================================
  414. [..]
  415. This driver contains a set of APIs to interface with the FMC NAND banks in order
  416. to run the NAND external devices.
  417. (+) FMC NAND bank reset using the function FMC_NAND_DeInit()
  418. (+) FMC NAND bank control configuration using the function FMC_NAND_Init()
  419. (+) FMC NAND bank common space timing configuration using the function
  420. FMC_NAND_CommonSpace_Timing_Init()
  421. (+) FMC NAND bank attribute space timing configuration using the function
  422. FMC_NAND_AttributeSpace_Timing_Init()
  423. (+) FMC NAND bank enable/disable ECC correction feature using the functions
  424. FMC_NAND_ECC_Enable()/FMC_NAND_ECC_Disable()
  425. (+) FMC NAND bank get ECC correction code using the function FMC_NAND_GetECC()
  426. @endverbatim
  427. * @{
  428. */
  429. /** @defgroup FMC_LL_NAND_Exported_Functions_Group1 Initialization and de-initialization functions
  430. * @brief Initialization and Configuration functions
  431. *
  432. @verbatim
  433. ==============================================================================
  434. ##### Initialization and de_initialization functions #####
  435. ==============================================================================
  436. [..]
  437. This section provides functions allowing to:
  438. (+) Initialize and configure the FMC NAND interface
  439. (+) De-initialize the FMC NAND interface
  440. (+) Configure the FMC clock and associated GPIOs
  441. @endverbatim
  442. * @{
  443. */
  444. /**
  445. * @brief Initializes the FMC_NAND device according to the specified
  446. * control parameters in the FMC_NAND_HandleTypeDef
  447. * @param Device Pointer to NAND device instance
  448. * @param Init Pointer to NAND Initialization structure
  449. * @retval HAL status
  450. */
  451. HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init)
  452. {
  453. /* Check the parameters */
  454. assert_param(IS_FMC_NAND_DEVICE(Device));
  455. assert_param(IS_FMC_NAND_BANK(Init->NandBank));
  456. assert_param(IS_FMC_WAIT_FEATURE(Init->Waitfeature));
  457. assert_param(IS_FMC_NAND_MEMORY_WIDTH(Init->MemoryDataWidth));
  458. assert_param(IS_FMC_ECC_STATE(Init->EccComputation));
  459. assert_param(IS_FMC_ECCPAGE_SIZE(Init->ECCPageSize));
  460. assert_param(IS_FMC_TCLR_TIME(Init->TCLRSetupTime));
  461. assert_param(IS_FMC_TAR_TIME(Init->TARSetupTime));
  462. /* NAND bank 3 registers configuration */
  463. MODIFY_REG(Device->PCR, PCR_CLEAR_MASK, (Init->Waitfeature |
  464. FMC_PCR_MEMORY_TYPE_NAND |
  465. Init->MemoryDataWidth |
  466. Init->EccComputation |
  467. Init->ECCPageSize |
  468. ((Init->TCLRSetupTime) << FMC_PCR_TCLR_Pos) |
  469. ((Init->TARSetupTime) << FMC_PCR_TAR_Pos)));
  470. return HAL_OK;
  471. }
  472. /**
  473. * @brief Initializes the FMC_NAND Common space Timing according to the specified
  474. * parameters in the FMC_NAND_PCC_TimingTypeDef
  475. * @param Device Pointer to NAND device instance
  476. * @param Timing Pointer to NAND timing structure
  477. * @param Bank NAND bank number
  478. * @retval HAL status
  479. */
  480. HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
  481. {
  482. /* Check the parameters */
  483. assert_param(IS_FMC_NAND_DEVICE(Device));
  484. assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime));
  485. assert_param(IS_FMC_WAIT_TIME(Timing->WaitSetupTime));
  486. assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime));
  487. assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime));
  488. assert_param(IS_FMC_NAND_BANK(Bank));
  489. /* NAND bank 3 registers configuration */
  490. MODIFY_REG(Device->PMEM, PMEM_CLEAR_MASK, (Timing->SetupTime |
  491. ((Timing->WaitSetupTime) << FMC_PMEM_MEMWAIT_Pos) |
  492. ((Timing->HoldSetupTime) << FMC_PMEM_MEMHOLD_Pos) |
  493. ((Timing->HiZSetupTime) << FMC_PMEM_MEMHIZ_Pos)));
  494. return HAL_OK;
  495. }
  496. /**
  497. * @brief Initializes the FMC_NAND Attribute space Timing according to the specified
  498. * parameters in the FMC_NAND_PCC_TimingTypeDef
  499. * @param Device Pointer to NAND device instance
  500. * @param Timing Pointer to NAND timing structure
  501. * @param Bank NAND bank number
  502. * @retval HAL status
  503. */
  504. HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
  505. {
  506. /* Check the parameters */
  507. assert_param(IS_FMC_NAND_DEVICE(Device));
  508. assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime));
  509. assert_param(IS_FMC_WAIT_TIME(Timing->WaitSetupTime));
  510. assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime));
  511. assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime));
  512. assert_param(IS_FMC_NAND_BANK(Bank));
  513. /* NAND bank 3 registers configuration */
  514. MODIFY_REG(Device->PATT, PATT_CLEAR_MASK, (Timing->SetupTime |
  515. ((Timing->WaitSetupTime) << FMC_PATT_ATTWAIT_Pos) |
  516. ((Timing->HoldSetupTime) << FMC_PATT_ATTHOLD_Pos) |
  517. ((Timing->HiZSetupTime) << FMC_PATT_ATTHIZ_Pos)));
  518. return HAL_OK;
  519. }
  520. /**
  521. * @brief DeInitializes the FMC_NAND device
  522. * @param Device Pointer to NAND device instance
  523. * @param Bank NAND bank number
  524. * @retval HAL status
  525. */
  526. HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank)
  527. {
  528. /* Check the parameters */
  529. assert_param(IS_FMC_NAND_DEVICE(Device));
  530. assert_param(IS_FMC_NAND_BANK(Bank));
  531. /* Disable the NAND Bank */
  532. __FMC_NAND_DISABLE(Device, Bank);
  533. /* De-initialize the NAND Bank */
  534. /* Set the FMC_NAND_BANK3 registers to their reset values */
  535. WRITE_REG(Device->PCR, 0x00000018U);
  536. WRITE_REG(Device->SR, 0x00000040U);
  537. WRITE_REG(Device->PMEM, 0xFCFCFCFCU);
  538. WRITE_REG(Device->PATT, 0xFCFCFCFCU);
  539. return HAL_OK;
  540. }
  541. /**
  542. * @}
  543. */
  544. /** @defgroup HAL_FMC_NAND_Group2 Peripheral Control functions
  545. * @brief management functions
  546. *
  547. @verbatim
  548. ==============================================================================
  549. ##### FMC_NAND Control functions #####
  550. ==============================================================================
  551. [..]
  552. This subsection provides a set of functions allowing to control dynamically
  553. the FMC NAND interface.
  554. @endverbatim
  555. * @{
  556. */
  557. /**
  558. * @brief Enables dynamically FMC_NAND ECC feature.
  559. * @param Device Pointer to NAND device instance
  560. * @param Bank NAND bank number
  561. * @retval HAL status
  562. */
  563. HAL_StatusTypeDef FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank)
  564. {
  565. /* Check the parameters */
  566. assert_param(IS_FMC_NAND_DEVICE(Device));
  567. assert_param(IS_FMC_NAND_BANK(Bank));
  568. /* Enable ECC feature */
  569. SET_BIT(Device->PCR, FMC_PCR_ECCEN);
  570. return HAL_OK;
  571. }
  572. /**
  573. * @brief Disables dynamically FMC_NAND ECC feature.
  574. * @param Device Pointer to NAND device instance
  575. * @param Bank NAND bank number
  576. * @retval HAL status
  577. */
  578. HAL_StatusTypeDef FMC_NAND_ECC_Disable(FMC_NAND_TypeDef *Device, uint32_t Bank)
  579. {
  580. /* Check the parameters */
  581. assert_param(IS_FMC_NAND_DEVICE(Device));
  582. assert_param(IS_FMC_NAND_BANK(Bank));
  583. /* Disable ECC feature */
  584. CLEAR_BIT(Device->PCR, FMC_PCR_ECCEN);
  585. return HAL_OK;
  586. }
  587. /**
  588. * @brief Disables dynamically FMC_NAND ECC feature.
  589. * @param Device Pointer to NAND device instance
  590. * @param ECCval Pointer to ECC value
  591. * @param Bank NAND bank number
  592. * @param Timeout Timeout wait value
  593. * @retval HAL status
  594. */
  595. HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout)
  596. {
  597. uint32_t tickstart;
  598. /* Check the parameters */
  599. assert_param(IS_FMC_NAND_DEVICE(Device));
  600. assert_param(IS_FMC_NAND_BANK(Bank));
  601. /* Get tick */
  602. tickstart = HAL_GetTick();
  603. /* Wait until FIFO is empty */
  604. while (__FMC_NAND_GET_FLAG(Device, Bank, FMC_FLAG_FEMPT) == RESET)
  605. {
  606. /* Check for the Timeout */
  607. if (Timeout != HAL_MAX_DELAY)
  608. {
  609. if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
  610. {
  611. return HAL_TIMEOUT;
  612. }
  613. }
  614. }
  615. /* Get the ECCR register value */
  616. *ECCval = (uint32_t)Device->ECCR;
  617. return HAL_OK;
  618. }
  619. /**
  620. * @}
  621. */
  622. /** @defgroup FMC_LL_SDRAM
  623. * @brief SDRAM Controller functions
  624. *
  625. @verbatim
  626. ==============================================================================
  627. ##### How to use SDRAM device driver #####
  628. ==============================================================================
  629. [..]
  630. This driver contains a set of APIs to interface with the FMC SDRAM banks in order
  631. to run the SDRAM external devices.
  632. (+) FMC SDRAM bank reset using the function FMC_SDRAM_DeInit()
  633. (+) FMC SDRAM bank control configuration using the function FMC_SDRAM_Init()
  634. (+) FMC SDRAM bank timing configuration using the function FMC_SDRAM_Timing_Init()
  635. (+) FMC SDRAM bank enable/disable write operation using the functions
  636. FMC_SDRAM_WriteOperation_Enable()/FMC_SDRAM_WriteOperation_Disable()
  637. (+) FMC SDRAM bank send command using the function FMC_SDRAM_SendCommand()
  638. @endverbatim
  639. * @{
  640. */
  641. /** @addtogroup FMC_LL_SDRAM_Private_Functions_Group1
  642. * @brief Initialization and Configuration functions
  643. *
  644. @verbatim
  645. ==============================================================================
  646. ##### Initialization and de_initialization functions #####
  647. ==============================================================================
  648. [..]
  649. This section provides functions allowing to:
  650. (+) Initialize and configure the FMC SDRAM interface
  651. (+) De-initialize the FMC SDRAM interface
  652. (+) Configure the FMC clock and associated GPIOs
  653. @endverbatim
  654. * @{
  655. */
  656. /**
  657. * @brief Initializes the FMC_SDRAM device according to the specified
  658. * control parameters in the FMC_SDRAM_InitTypeDef
  659. * @param Device Pointer to SDRAM device instance
  660. * @param Init Pointer to SDRAM Initialization structure
  661. * @retval HAL status
  662. */
  663. HAL_StatusTypeDef FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDef *Init)
  664. {
  665. /* Check the parameters */
  666. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  667. assert_param(IS_FMC_SDRAM_BANK(Init->SDBank));
  668. assert_param(IS_FMC_COLUMNBITS_NUMBER(Init->ColumnBitsNumber));
  669. assert_param(IS_FMC_ROWBITS_NUMBER(Init->RowBitsNumber));
  670. assert_param(IS_FMC_SDMEMORY_WIDTH(Init->MemoryDataWidth));
  671. assert_param(IS_FMC_INTERNALBANK_NUMBER(Init->InternalBankNumber));
  672. assert_param(IS_FMC_CAS_LATENCY(Init->CASLatency));
  673. assert_param(IS_FMC_WRITE_PROTECTION(Init->WriteProtection));
  674. assert_param(IS_FMC_SDCLOCK_PERIOD(Init->SDClockPeriod));
  675. assert_param(IS_FMC_READ_BURST(Init->ReadBurst));
  676. assert_param(IS_FMC_READPIPE_DELAY(Init->ReadPipeDelay));
  677. /* Set SDRAM bank configuration parameters */
  678. if (Init->SDBank == FMC_SDRAM_BANK1)
  679. {
  680. MODIFY_REG(Device->SDCR[FMC_SDRAM_BANK1],
  681. SDCR_CLEAR_MASK,
  682. (Init->ColumnBitsNumber |
  683. Init->RowBitsNumber |
  684. Init->MemoryDataWidth |
  685. Init->InternalBankNumber |
  686. Init->CASLatency |
  687. Init->WriteProtection |
  688. Init->SDClockPeriod |
  689. Init->ReadBurst |
  690. Init->ReadPipeDelay));
  691. }
  692. else /* FMC_Bank2_SDRAM */
  693. {
  694. MODIFY_REG(Device->SDCR[FMC_SDRAM_BANK1],
  695. FMC_SDCRx_SDCLK |
  696. FMC_SDCRx_RBURST |
  697. FMC_SDCRx_RPIPE,
  698. (Init->SDClockPeriod |
  699. Init->ReadBurst |
  700. Init->ReadPipeDelay));
  701. MODIFY_REG(Device->SDCR[FMC_SDRAM_BANK2],
  702. SDCR_CLEAR_MASK,
  703. (Init->ColumnBitsNumber |
  704. Init->RowBitsNumber |
  705. Init->MemoryDataWidth |
  706. Init->InternalBankNumber |
  707. Init->CASLatency |
  708. Init->WriteProtection));
  709. }
  710. return HAL_OK;
  711. }
  712. /**
  713. * @brief Initializes the FMC_SDRAM device timing according to the specified
  714. * parameters in the FMC_SDRAM_TimingTypeDef
  715. * @param Device Pointer to SDRAM device instance
  716. * @param Timing Pointer to SDRAM Timing structure
  717. * @param Bank SDRAM bank number
  718. * @retval HAL status
  719. */
  720. HAL_StatusTypeDef FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_TimingTypeDef *Timing, uint32_t Bank)
  721. {
  722. /* Check the parameters */
  723. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  724. assert_param(IS_FMC_LOADTOACTIVE_DELAY(Timing->LoadToActiveDelay));
  725. assert_param(IS_FMC_EXITSELFREFRESH_DELAY(Timing->ExitSelfRefreshDelay));
  726. assert_param(IS_FMC_SELFREFRESH_TIME(Timing->SelfRefreshTime));
  727. assert_param(IS_FMC_ROWCYCLE_DELAY(Timing->RowCycleDelay));
  728. assert_param(IS_FMC_WRITE_RECOVERY_TIME(Timing->WriteRecoveryTime));
  729. assert_param(IS_FMC_RP_DELAY(Timing->RPDelay));
  730. assert_param(IS_FMC_RCD_DELAY(Timing->RCDDelay));
  731. assert_param(IS_FMC_SDRAM_BANK(Bank));
  732. /* Set SDRAM device timing parameters */
  733. if (Bank == FMC_SDRAM_BANK1)
  734. {
  735. MODIFY_REG(Device->SDTR[FMC_SDRAM_BANK1],
  736. SDTR_CLEAR_MASK,
  737. (((Timing->LoadToActiveDelay) - 1U) |
  738. (((Timing->ExitSelfRefreshDelay) - 1U) << FMC_SDTRx_TXSR_Pos) |
  739. (((Timing->SelfRefreshTime) - 1U) << FMC_SDTRx_TRAS_Pos) |
  740. (((Timing->RowCycleDelay) - 1U) << FMC_SDTRx_TRC_Pos) |
  741. (((Timing->WriteRecoveryTime) - 1U) << FMC_SDTRx_TWR_Pos) |
  742. (((Timing->RPDelay) - 1U) << FMC_SDTRx_TRP_Pos) |
  743. (((Timing->RCDDelay) - 1U) << FMC_SDTRx_TRCD_Pos)));
  744. }
  745. else /* FMC_Bank2_SDRAM */
  746. {
  747. MODIFY_REG(Device->SDTR[FMC_SDRAM_BANK1],
  748. FMC_SDTRx_TRC |
  749. FMC_SDTRx_TRP,
  750. (((Timing->RowCycleDelay) - 1U) << FMC_SDTRx_TRC_Pos) |
  751. (((Timing->RPDelay) - 1U) << FMC_SDTRx_TRP_Pos));
  752. MODIFY_REG(Device->SDTR[FMC_SDRAM_BANK2],
  753. SDTR_CLEAR_MASK,
  754. (((Timing->LoadToActiveDelay) - 1U) |
  755. (((Timing->ExitSelfRefreshDelay) - 1U) << FMC_SDTRx_TXSR_Pos) |
  756. (((Timing->SelfRefreshTime) - 1U) << FMC_SDTRx_TRAS_Pos) |
  757. (((Timing->WriteRecoveryTime) - 1U) << FMC_SDTRx_TWR_Pos) |
  758. (((Timing->RCDDelay) - 1U) << FMC_SDTRx_TRCD_Pos)));
  759. }
  760. return HAL_OK;
  761. }
  762. /**
  763. * @brief DeInitializes the FMC_SDRAM peripheral
  764. * @param Device Pointer to SDRAM device instance
  765. * @retval HAL status
  766. */
  767. HAL_StatusTypeDef FMC_SDRAM_DeInit(FMC_SDRAM_TypeDef *Device, uint32_t Bank)
  768. {
  769. /* Check the parameters */
  770. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  771. assert_param(IS_FMC_SDRAM_BANK(Bank));
  772. /* De-initialize the SDRAM device */
  773. Device->SDCR[Bank] = 0x000002D0U;
  774. Device->SDTR[Bank] = 0x0FFFFFFFU;
  775. Device->SDCMR = 0x00000000U;
  776. Device->SDRTR = 0x00000000U;
  777. Device->SDSR = 0x00000000U;
  778. return HAL_OK;
  779. }
  780. /**
  781. * @}
  782. */
  783. /** @addtogroup FMC_LL_SDRAMPrivate_Functions_Group2
  784. * @brief management functions
  785. *
  786. @verbatim
  787. ==============================================================================
  788. ##### FMC_SDRAM Control functions #####
  789. ==============================================================================
  790. [..]
  791. This subsection provides a set of functions allowing to control dynamically
  792. the FMC SDRAM interface.
  793. @endverbatim
  794. * @{
  795. */
  796. /**
  797. * @brief Enables dynamically FMC_SDRAM write protection.
  798. * @param Device Pointer to SDRAM device instance
  799. * @param Bank SDRAM bank number
  800. * @retval HAL status
  801. */
  802. HAL_StatusTypeDef FMC_SDRAM_WriteProtection_Enable(FMC_SDRAM_TypeDef *Device, uint32_t Bank)
  803. {
  804. /* Check the parameters */
  805. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  806. assert_param(IS_FMC_SDRAM_BANK(Bank));
  807. /* Enable write protection */
  808. SET_BIT(Device->SDCR[Bank], FMC_SDRAM_WRITE_PROTECTION_ENABLE);
  809. return HAL_OK;
  810. }
  811. /**
  812. * @brief Disables dynamically FMC_SDRAM write protection.
  813. * @param hsdram FMC_SDRAM handle
  814. * @retval HAL status
  815. */
  816. HAL_StatusTypeDef FMC_SDRAM_WriteProtection_Disable(FMC_SDRAM_TypeDef *Device, uint32_t Bank)
  817. {
  818. /* Check the parameters */
  819. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  820. assert_param(IS_FMC_SDRAM_BANK(Bank));
  821. /* Disable write protection */
  822. CLEAR_BIT(Device->SDCR[Bank], FMC_SDRAM_WRITE_PROTECTION_ENABLE);
  823. return HAL_OK;
  824. }
  825. /**
  826. * @brief Send Command to the FMC SDRAM bank
  827. * @param Device Pointer to SDRAM device instance
  828. * @param Command Pointer to SDRAM command structure
  829. * @param Timing Pointer to SDRAM Timing structure
  830. * @param Timeout Timeout wait value
  831. * @retval HAL state
  832. */
  833. HAL_StatusTypeDef FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout)
  834. {
  835. /* Check the parameters */
  836. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  837. assert_param(IS_FMC_COMMAND_MODE(Command->CommandMode));
  838. assert_param(IS_FMC_COMMAND_TARGET(Command->CommandTarget));
  839. assert_param(IS_FMC_AUTOREFRESH_NUMBER(Command->AutoRefreshNumber));
  840. assert_param(IS_FMC_MODE_REGISTER(Command->ModeRegisterDefinition));
  841. /* Set command register */
  842. SET_BIT(Device->SDCMR, ((Command->CommandMode) |
  843. (Command->CommandTarget) |
  844. (((Command->AutoRefreshNumber) - 1U) << FMC_SDCMR_NRFS_Pos) |
  845. ((Command->ModeRegisterDefinition) << FMC_SDCMR_MRD_Pos)));
  846. /* Prevent unused argument(s) compilation warning */
  847. UNUSED(Timeout);
  848. return HAL_OK;
  849. }
  850. /**
  851. * @brief Program the SDRAM Memory Refresh rate.
  852. * @param Device Pointer to SDRAM device instance
  853. * @param RefreshRate The SDRAM refresh rate value.
  854. * @retval HAL state
  855. */
  856. HAL_StatusTypeDef FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, uint32_t RefreshRate)
  857. {
  858. /* Check the parameters */
  859. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  860. assert_param(IS_FMC_REFRESH_RATE(RefreshRate));
  861. /* Set the refresh rate in command register */
  862. MODIFY_REG(Device->SDRTR, FMC_SDRTR_COUNT, (RefreshRate << FMC_SDRTR_COUNT_Pos));
  863. return HAL_OK;
  864. }
  865. /**
  866. * @brief Set the Number of consecutive SDRAM Memory auto Refresh commands.
  867. * @param Device Pointer to SDRAM device instance
  868. * @param AutoRefreshNumber Specifies the auto Refresh number.
  869. * @retval None
  870. */
  871. HAL_StatusTypeDef FMC_SDRAM_SetAutoRefreshNumber(FMC_SDRAM_TypeDef *Device, uint32_t AutoRefreshNumber)
  872. {
  873. /* Check the parameters */
  874. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  875. assert_param(IS_FMC_AUTOREFRESH_NUMBER(AutoRefreshNumber));
  876. /* Set the Auto-refresh number in command register */
  877. MODIFY_REG(Device->SDCMR, FMC_SDCMR_NRFS, ((AutoRefreshNumber - 1U) << FMC_SDCMR_NRFS_Pos));
  878. return HAL_OK;
  879. }
  880. /**
  881. * @brief Returns the indicated FMC SDRAM bank mode status.
  882. * @param Device Pointer to SDRAM device instance
  883. * @param Bank Defines the FMC SDRAM bank. This parameter can be
  884. * FMC_Bank1_SDRAM or FMC_Bank2_SDRAM.
  885. * @retval The FMC SDRAM bank mode status, could be on of the following values:
  886. * FMC_SDRAM_NORMAL_MODE, FMC_SDRAM_SELF_REFRESH_MODE or
  887. * FMC_SDRAM_POWER_DOWN_MODE.
  888. */
  889. uint32_t FMC_SDRAM_GetModeStatus(FMC_SDRAM_TypeDef *Device, uint32_t Bank)
  890. {
  891. uint32_t tmpreg;
  892. /* Check the parameters */
  893. assert_param(IS_FMC_SDRAM_DEVICE(Device));
  894. assert_param(IS_FMC_SDRAM_BANK(Bank));
  895. /* Get the corresponding bank mode */
  896. if (Bank == FMC_SDRAM_BANK1)
  897. {
  898. tmpreg = (uint32_t)(Device->SDSR & FMC_SDSR_MODES1);
  899. }
  900. else
  901. {
  902. tmpreg = ((uint32_t)(Device->SDSR & FMC_SDSR_MODES2) >> 2U);
  903. }
  904. /* Return the mode status */
  905. return tmpreg;
  906. }
  907. /**
  908. * @}
  909. */
  910. /**
  911. * @}
  912. */
  913. /**
  914. * @}
  915. */
  916. /**
  917. * @}
  918. */
  919. #endif /* HAL_NOR_MODULE_ENABLED */
  920. /**
  921. * @}
  922. */
  923. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/