stm32f1xx_ll_fsmc.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  1. /**
  2. ******************************************************************************
  3. * @file stm32f1xx_ll_fsmc.h
  4. * @author MCD Application Team
  5. * @version V1.0.4
  6. * @date 29-April-2016
  7. * @brief Header file of FSMC HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F1xx_LL_FSMC_H
  39. #define __STM32F1xx_LL_FSMC_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32f1xx_hal_def.h"
  45. /** @addtogroup STM32F1xx_HAL_Driver
  46. * @{
  47. */
  48. #if defined(FSMC_BANK1)
  49. /** @addtogroup FSMC_LL
  50. * @{
  51. */
  52. /** @addtogroup FSMC_LL_Private_Macros
  53. * @{
  54. */
  55. #define IS_FSMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FSMC_NORSRAM_BANK1) || \
  56. ((__BANK__) == FSMC_NORSRAM_BANK2) || \
  57. ((__BANK__) == FSMC_NORSRAM_BANK3) || \
  58. ((__BANK__) == FSMC_NORSRAM_BANK4))
  59. #define IS_FSMC_MUX(__MUX__) (((__MUX__) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \
  60. ((__MUX__) == FSMC_DATA_ADDRESS_MUX_ENABLE))
  61. #define IS_FSMC_MEMORY(__MEMORY__) (((__MEMORY__) == FSMC_MEMORY_TYPE_SRAM) || \
  62. ((__MEMORY__) == FSMC_MEMORY_TYPE_PSRAM)|| \
  63. ((__MEMORY__) == FSMC_MEMORY_TYPE_NOR))
  64. #define IS_FSMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_8) || \
  65. ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \
  66. ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_32))
  67. #define IS_FSMC_WRITE_BURST(__BURST__) (((__BURST__) == FSMC_WRITE_BURST_DISABLE) || \
  68. ((__BURST__) == FSMC_WRITE_BURST_ENABLE))
  69. #define IS_FSMC_ACCESS_MODE(__MODE__) (((__MODE__) == FSMC_ACCESS_MODE_A) || \
  70. ((__MODE__) == FSMC_ACCESS_MODE_B) || \
  71. ((__MODE__) == FSMC_ACCESS_MODE_C) || \
  72. ((__MODE__) == FSMC_ACCESS_MODE_D))
  73. #define IS_FSMC_NAND_BANK(__BANK__) (((__BANK__) == FSMC_NAND_BANK2) || \
  74. ((__BANK__) == FSMC_NAND_BANK3))
  75. #define IS_FSMC_WAIT_FEATURE(__FEATURE__) (((__FEATURE__) == FSMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \
  76. ((__FEATURE__) == FSMC_NAND_PCC_WAIT_FEATURE_ENABLE))
  77. #define IS_FSMC_NAND_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NAND_PCC_MEM_BUS_WIDTH_8) || \
  78. ((__WIDTH__) == FSMC_NAND_PCC_MEM_BUS_WIDTH_16))
  79. #define IS_FSMC_ECC_STATE(__STATE__) (((__STATE__) == FSMC_NAND_ECC_DISABLE) || \
  80. ((__STATE__) == FSMC_NAND_ECC_ENABLE))
  81. #define IS_FSMC_ECCPAGE_SIZE(__SIZE__) (((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_256BYTE) || \
  82. ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_512BYTE) || \
  83. ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \
  84. ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \
  85. ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \
  86. ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_8192BYTE))
  87. /** @defgroup FSMC_TCLR_Setup_Time FSMC_TCLR_Setup_Time
  88. * @{
  89. */
  90. #define IS_FSMC_TCLR_TIME(__TIME__) ((__TIME__) <= 255)
  91. /**
  92. * @}
  93. */
  94. /** @defgroup FSMC_TAR_Setup_Time FSMC_TAR_Setup_Time
  95. * @{
  96. */
  97. #define IS_FSMC_TAR_TIME(__TIME__) ((__TIME__) <= 255)
  98. /**
  99. * @}
  100. */
  101. /** @defgroup FSMC_Setup_Time FSMC_Setup_Time
  102. * @{
  103. */
  104. #define IS_FSMC_SETUP_TIME(__TIME__) ((__TIME__) <= 255)
  105. /**
  106. * @}
  107. */
  108. /** @defgroup FSMC_Wait_Setup_Time FSMC_Wait_Setup_Time
  109. * @{
  110. */
  111. #define IS_FSMC_WAIT_TIME(__TIME__) ((__TIME__) <= 255)
  112. /**
  113. * @}
  114. */
  115. /** @defgroup FSMC_Hold_Setup_Time FSMC_Hold_Setup_Time
  116. * @{
  117. */
  118. #define IS_FSMC_HOLD_TIME(__TIME__) ((__TIME__) <= 255)
  119. /**
  120. * @}
  121. */
  122. /** @defgroup FSMC_HiZ_Setup_Time FSMC_HiZ_Setup_Time
  123. * @{
  124. */
  125. #define IS_FSMC_HIZ_TIME(__TIME__) ((__TIME__) <= 255)
  126. /**
  127. * @}
  128. */
  129. /** @defgroup FSMC_NORSRAM_Device_Instance FSMC NOR/SRAM Device Instance
  130. * @{
  131. */
  132. #define IS_FSMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_DEVICE)
  133. /**
  134. * @}
  135. */
  136. /** @defgroup FSMC_NORSRAM_EXTENDED_Device_Instance FSMC NOR/SRAM EXTENDED Device Instance
  137. * @{
  138. */
  139. #define IS_FSMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_EXTENDED_DEVICE)
  140. /**
  141. * @}
  142. */
  143. /** @defgroup FSMC_NAND_Device_Instance FSMC NAND Device Instance
  144. * @{
  145. */
  146. #define IS_FSMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NAND_DEVICE)
  147. /**
  148. * @}
  149. */
  150. /** @defgroup FSMC_PCCARD_Device_Instance FSMC PCCARD Device Instance
  151. * @{
  152. */
  153. #define IS_FSMC_PCCARD_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_PCCARD_DEVICE)
  154. /**
  155. * @}
  156. */
  157. #define IS_FSMC_BURSTMODE(__STATE__) (((__STATE__) == FSMC_BURST_ACCESS_MODE_DISABLE) || \
  158. ((__STATE__) == FSMC_BURST_ACCESS_MODE_ENABLE))
  159. #define IS_FSMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \
  160. ((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_HIGH))
  161. #define IS_FSMC_WRAP_MODE(__MODE__) (((__MODE__) == FSMC_WRAP_MODE_DISABLE) || \
  162. ((__MODE__) == FSMC_WRAP_MODE_ENABLE))
  163. #define IS_FSMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FSMC_WAIT_TIMING_BEFORE_WS) || \
  164. ((__ACTIVE__) == FSMC_WAIT_TIMING_DURING_WS))
  165. #define IS_FSMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FSMC_WRITE_OPERATION_DISABLE) || \
  166. ((__OPERATION__) == FSMC_WRITE_OPERATION_ENABLE))
  167. #define IS_FSMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FSMC_WAIT_SIGNAL_DISABLE) || \
  168. ((__SIGNAL__) == FSMC_WAIT_SIGNAL_ENABLE))
  169. #define IS_FSMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FSMC_EXTENDED_MODE_DISABLE) || \
  170. ((__MODE__) == FSMC_EXTENDED_MODE_ENABLE))
  171. #define IS_FSMC_ASYNWAIT(__STATE__) (((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \
  172. ((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_ENABLE))
  173. #define IS_FSMC_CLK_DIV(__DIV__) (((__DIV__) > 1) && ((__DIV__) <= 16))
  174. /** @defgroup FSMC_Data_Latency FSMC Data Latency
  175. * @{
  176. */
  177. #define IS_FSMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1) && ((__LATENCY__) <= 17))
  178. /**
  179. * @}
  180. */
  181. /** @defgroup FSMC_Address_Setup_Time FSMC Address Setup Time
  182. * @{
  183. */
  184. #define IS_FSMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15)
  185. /**
  186. * @}
  187. */
  188. /** @defgroup FSMC_Address_Hold_Time FSMC Address Hold Time
  189. * @{
  190. */
  191. #define IS_FSMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 15))
  192. /**
  193. * @}
  194. */
  195. /** @defgroup FSMC_Data_Setup_Time FSMC Data Setup Time
  196. * @{
  197. */
  198. #define IS_FSMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 255))
  199. /**
  200. * @}
  201. */
  202. /** @defgroup FSMC_Bus_Turn_around_Duration FSMC Bus Turn around Duration
  203. * @{
  204. */
  205. #define IS_FSMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15)
  206. /**
  207. * @}
  208. */
  209. /**
  210. * @}
  211. */
  212. /* Exported typedef ----------------------------------------------------------*/
  213. /** @defgroup FSMC_NORSRAM_Exported_typedef FSMC Low Layer Exported Types
  214. * @{
  215. */
  216. #define FSMC_NORSRAM_TypeDef FSMC_Bank1_TypeDef
  217. #define FSMC_NORSRAM_EXTENDED_TypeDef FSMC_Bank1E_TypeDef
  218. #define FSMC_NAND_TypeDef FSMC_Bank2_3_TypeDef
  219. #define FSMC_PCCARD_TypeDef FSMC_Bank4_TypeDef
  220. #define FSMC_NORSRAM_DEVICE FSMC_Bank1
  221. #define FSMC_NORSRAM_EXTENDED_DEVICE FSMC_Bank1E
  222. #define FSMC_NAND_DEVICE FSMC_Bank2_3
  223. #define FSMC_PCCARD_DEVICE FSMC_Bank4
  224. /**
  225. * @brief FSMC_NORSRAM Configuration Structure definition
  226. */
  227. typedef struct
  228. {
  229. uint32_t NSBank; /*!< Specifies the NORSRAM memory device that will be used.
  230. This parameter can be a value of @ref FSMC_NORSRAM_Bank */
  231. uint32_t DataAddressMux; /*!< Specifies whether the address and data values are
  232. multiplexed on the data bus or not.
  233. This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing */
  234. uint32_t MemoryType; /*!< Specifies the type of external memory attached to
  235. the corresponding memory device.
  236. This parameter can be a value of @ref FSMC_Memory_Type */
  237. uint32_t MemoryDataWidth; /*!< Specifies the external memory device width.
  238. This parameter can be a value of @ref FSMC_NORSRAM_Data_Width */
  239. uint32_t BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory,
  240. valid only with synchronous burst Flash memories.
  241. This parameter can be a value of @ref FSMC_Burst_Access_Mode */
  242. uint32_t WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing
  243. the Flash memory in burst mode.
  244. This parameter can be a value of @ref FSMC_Wait_Signal_Polarity */
  245. uint32_t WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash
  246. memory, valid only when accessing Flash memories in burst mode.
  247. This parameter can be a value of @ref FSMC_Wrap_Mode */
  248. uint32_t WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one
  249. clock cycle before the wait state or during the wait state,
  250. valid only when accessing memories in burst mode.
  251. This parameter can be a value of @ref FSMC_Wait_Timing */
  252. uint32_t WriteOperation; /*!< Enables or disables the write operation in the selected device by the FSMC.
  253. This parameter can be a value of @ref FSMC_Write_Operation */
  254. uint32_t WaitSignal; /*!< Enables or disables the wait state insertion via wait
  255. signal, valid for Flash memory access in burst mode.
  256. This parameter can be a value of @ref FSMC_Wait_Signal */
  257. uint32_t ExtendedMode; /*!< Enables or disables the extended mode.
  258. This parameter can be a value of @ref FSMC_Extended_Mode */
  259. uint32_t AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers,
  260. valid only with asynchronous Flash memories.
  261. This parameter can be a value of @ref FSMC_AsynchronousWait */
  262. uint32_t WriteBurst; /*!< Enables or disables the write burst operation.
  263. This parameter can be a value of @ref FSMC_Write_Burst */
  264. }FSMC_NORSRAM_InitTypeDef;
  265. /**
  266. * @brief FSMC_NORSRAM Timing parameters structure definition
  267. */
  268. typedef struct
  269. {
  270. uint32_t AddressSetupTime; /*!< Defines the number of HCLK cycles to configure
  271. the duration of the address setup time.
  272. This parameter can be a value between Min_Data = 0 and Max_Data = 15.
  273. @note This parameter is not used with synchronous NOR Flash memories. */
  274. uint32_t AddressHoldTime; /*!< Defines the number of HCLK cycles to configure
  275. the duration of the address hold time.
  276. This parameter can be a value between Min_Data = 1 and Max_Data = 15.
  277. @note This parameter is not used with synchronous NOR Flash memories. */
  278. uint32_t DataSetupTime; /*!< Defines the number of HCLK cycles to configure
  279. the duration of the data setup time.
  280. This parameter can be a value between Min_Data = 1 and Max_Data = 255.
  281. @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed
  282. NOR Flash memories. */
  283. uint32_t BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure
  284. the duration of the bus turnaround.
  285. This parameter can be a value between Min_Data = 0 and Max_Data = 15.
  286. @note This parameter is only used for multiplexed NOR Flash memories. */
  287. uint32_t CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of
  288. HCLK cycles. This parameter can be a value between Min_Data = 2 and Max_Data = 16.
  289. @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM
  290. accesses. */
  291. uint32_t DataLatency; /*!< Defines the number of memory clock cycles to issue
  292. to the memory before getting the first data.
  293. The parameter value depends on the memory type as shown below:
  294. - It must be set to 0 in case of a CRAM
  295. - It is don't care in asynchronous NOR, SRAM or ROM accesses
  296. - It may assume a value between Min_Data = 2 and Max_Data = 17 in NOR Flash memories
  297. with synchronous burst mode enable */
  298. uint32_t AccessMode; /*!< Specifies the asynchronous access mode.
  299. This parameter can be a value of @ref FSMC_Access_Mode */
  300. }FSMC_NORSRAM_TimingTypeDef;
  301. #if (defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG))
  302. /**
  303. * @brief FSMC_NAND Configuration Structure definition
  304. */
  305. typedef struct
  306. {
  307. uint32_t NandBank; /*!< Specifies the NAND memory device that will be used.
  308. This parameter can be a value of @ref FSMC_NAND_Bank */
  309. uint32_t Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory device.
  310. This parameter can be any value of @ref FSMC_Wait_feature */
  311. uint32_t MemoryDataWidth; /*!< Specifies the external memory device width.
  312. This parameter can be any value of @ref FSMC_NAND_Data_Width */
  313. uint32_t EccComputation; /*!< Enables or disables the ECC computation.
  314. This parameter can be any value of @ref FSMC_ECC */
  315. uint32_t ECCPageSize; /*!< Defines the page size for the extended ECC.
  316. This parameter can be any value of @ref FSMC_ECC_Page_Size */
  317. uint32_t TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
  318. delay between CLE low and RE low.
  319. This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
  320. uint32_t TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
  321. delay between ALE low and RE low.
  322. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  323. }FSMC_NAND_InitTypeDef;
  324. /**
  325. * @brief FSMC_NAND_PCCARD Timing parameters structure definition
  326. */
  327. typedef struct
  328. {
  329. uint32_t SetupTime; /*!< Defines the number of HCLK cycles to setup address before
  330. the command assertion for NAND-Flash read or write access
  331. to common/Attribute or I/O memory space (depending on
  332. the memory space timing to be configured).
  333. This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
  334. uint32_t WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the
  335. command for NAND-Flash read or write access to
  336. common/Attribute or I/O memory space (depending on the
  337. memory space timing to be configured).
  338. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  339. uint32_t HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address
  340. (and data for write access) after the command de-assertion
  341. for NAND-Flash read or write access to common/Attribute
  342. or I/O memory space (depending on the memory space timing
  343. to be configured).
  344. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  345. uint32_t HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the
  346. data bus is kept in HiZ after the start of a NAND-Flash
  347. write access to common/Attribute or I/O memory space (depending
  348. on the memory space timing to be configured).
  349. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  350. }FSMC_NAND_PCC_TimingTypeDef;
  351. #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
  352. #if (defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG))
  353. /**
  354. * @brief FSMC_NAND Configuration Structure definition
  355. */
  356. typedef struct
  357. {
  358. uint32_t Waitfeature; /*!< Enables or disables the Wait feature for the PCCARD Memory device.
  359. This parameter can be any value of @ref FSMC_Wait_feature */
  360. uint32_t TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
  361. delay between CLE low and RE low.
  362. This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
  363. uint32_t TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
  364. delay between ALE low and RE low.
  365. This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  366. }FSMC_PCCARD_InitTypeDef;
  367. #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
  368. /**
  369. * @}
  370. */
  371. /* Exported constants --------------------------------------------------------*/
  372. /** @defgroup FSMC_Exported_Constants FSMC Low Layer Exported Constants
  373. * @{
  374. */
  375. /** @defgroup FSMC_NORSRAM_Exported_constants FSMC NOR/SRAM Exported constants
  376. * @{
  377. */
  378. /** @defgroup FSMC_NORSRAM_Bank FSMC NOR/SRAM Bank
  379. * @{
  380. */
  381. #define FSMC_NORSRAM_BANK1 ((uint32_t)0x00000000)
  382. #define FSMC_NORSRAM_BANK2 ((uint32_t)0x00000002)
  383. #define FSMC_NORSRAM_BANK3 ((uint32_t)0x00000004)
  384. #define FSMC_NORSRAM_BANK4 ((uint32_t)0x00000006)
  385. /**
  386. * @}
  387. */
  388. /** @defgroup FSMC_Data_Address_Bus_Multiplexing FSMC Data Address Bus Multiplexing
  389. * @{
  390. */
  391. #define FSMC_DATA_ADDRESS_MUX_DISABLE ((uint32_t)0x00000000)
  392. #define FSMC_DATA_ADDRESS_MUX_ENABLE ((uint32_t)FSMC_BCRx_MUXEN)
  393. /**
  394. * @}
  395. */
  396. /** @defgroup FSMC_Memory_Type FSMC Memory Type
  397. * @{
  398. */
  399. #define FSMC_MEMORY_TYPE_SRAM ((uint32_t)0x00000000)
  400. #define FSMC_MEMORY_TYPE_PSRAM ((uint32_t)FSMC_BCRx_MTYP_0)
  401. #define FSMC_MEMORY_TYPE_NOR ((uint32_t)FSMC_BCRx_MTYP_1)
  402. /**
  403. * @}
  404. */
  405. /** @defgroup FSMC_NORSRAM_Data_Width FSMC NOR/SRAM Data Width
  406. * @{
  407. */
  408. #define FSMC_NORSRAM_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000)
  409. #define FSMC_NORSRAM_MEM_BUS_WIDTH_16 ((uint32_t)FSMC_BCRx_MWID_0)
  410. #define FSMC_NORSRAM_MEM_BUS_WIDTH_32 ((uint32_t)FSMC_BCRx_MWID_1)
  411. /**
  412. * @}
  413. */
  414. /** @defgroup FSMC_NORSRAM_Flash_Access FSMC NOR/SRAM Flash Access
  415. * @{
  416. */
  417. #define FSMC_NORSRAM_FLASH_ACCESS_ENABLE ((uint32_t)FSMC_BCRx_FACCEN)
  418. #define FSMC_NORSRAM_FLASH_ACCESS_DISABLE ((uint32_t)0x00000000)
  419. /**
  420. * @}
  421. */
  422. /** @defgroup FSMC_Burst_Access_Mode FSMC Burst Access Mode
  423. * @{
  424. */
  425. #define FSMC_BURST_ACCESS_MODE_DISABLE ((uint32_t)0x00000000)
  426. #define FSMC_BURST_ACCESS_MODE_ENABLE ((uint32_t)FSMC_BCRx_BURSTEN)
  427. /**
  428. * @}
  429. */
  430. /** @defgroup FSMC_Wait_Signal_Polarity FSMC Wait Signal Polarity
  431. * @{
  432. */
  433. #define FSMC_WAIT_SIGNAL_POLARITY_LOW ((uint32_t)0x00000000)
  434. #define FSMC_WAIT_SIGNAL_POLARITY_HIGH ((uint32_t)FSMC_BCRx_WAITPOL)
  435. /**
  436. * @}
  437. */
  438. /** @defgroup FSMC_Wrap_Mode FSMC Wrap Mode
  439. * @{
  440. */
  441. #define FSMC_WRAP_MODE_DISABLE ((uint32_t)0x00000000)
  442. #define FSMC_WRAP_MODE_ENABLE ((uint32_t)FSMC_BCRx_WRAPMOD)
  443. /**
  444. * @}
  445. */
  446. /** @defgroup FSMC_Wait_Timing FSMC Wait Timing
  447. * @{
  448. */
  449. #define FSMC_WAIT_TIMING_BEFORE_WS ((uint32_t)0x00000000)
  450. #define FSMC_WAIT_TIMING_DURING_WS ((uint32_t)FSMC_BCRx_WAITCFG)
  451. /**
  452. * @}
  453. */
  454. /** @defgroup FSMC_Write_Operation FSMC Write Operation
  455. * @{
  456. */
  457. #define FSMC_WRITE_OPERATION_DISABLE ((uint32_t)0x00000000)
  458. #define FSMC_WRITE_OPERATION_ENABLE ((uint32_t)FSMC_BCRx_WREN)
  459. /**
  460. * @}
  461. */
  462. /** @defgroup FSMC_Wait_Signal FSMC Wait Signal
  463. * @{
  464. */
  465. #define FSMC_WAIT_SIGNAL_DISABLE ((uint32_t)0x00000000)
  466. #define FSMC_WAIT_SIGNAL_ENABLE ((uint32_t)FSMC_BCRx_WAITEN)
  467. /**
  468. * @}
  469. */
  470. /** @defgroup FSMC_Extended_Mode FSMC Extended Mode
  471. * @{
  472. */
  473. #define FSMC_EXTENDED_MODE_DISABLE ((uint32_t)0x00000000)
  474. #define FSMC_EXTENDED_MODE_ENABLE ((uint32_t)FSMC_BCRx_EXTMOD)
  475. /**
  476. * @}
  477. */
  478. /** @defgroup FSMC_AsynchronousWait FSMC Asynchronous Wait
  479. * @{
  480. */
  481. #define FSMC_ASYNCHRONOUS_WAIT_DISABLE ((uint32_t)0x00000000)
  482. #define FSMC_ASYNCHRONOUS_WAIT_ENABLE ((uint32_t)FSMC_BCRx_ASYNCWAIT)
  483. /**
  484. * @}
  485. */
  486. /** @defgroup FSMC_Write_Burst FSMC Write Burst
  487. * @{
  488. */
  489. #define FSMC_WRITE_BURST_DISABLE ((uint32_t)0x00000000)
  490. #define FSMC_WRITE_BURST_ENABLE ((uint32_t)FSMC_BCRx_CBURSTRW)
  491. /**
  492. * @}
  493. */
  494. /** @defgroup FSMC_Access_Mode FSMC Access Mode
  495. * @{
  496. */
  497. #define FSMC_ACCESS_MODE_A ((uint32_t)0x00000000)
  498. #define FSMC_ACCESS_MODE_B ((uint32_t)FSMC_BTRx_ACCMOD_0)
  499. #define FSMC_ACCESS_MODE_C ((uint32_t)FSMC_BTRx_ACCMOD_1)
  500. #define FSMC_ACCESS_MODE_D ((uint32_t)(FSMC_BTRx_ACCMOD_0 | FSMC_BTRx_ACCMOD_1))
  501. /**
  502. * @}
  503. */
  504. /**
  505. * @}
  506. */
  507. #if (defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG))
  508. /** @defgroup FSMC_NAND_Controller FSMC NAND and PCCARD Controller
  509. * @{
  510. */
  511. /** @defgroup FSMC_NAND_Bank FSMC NAND Bank
  512. * @{
  513. */
  514. #define FSMC_NAND_BANK2 ((uint32_t)0x00000010)
  515. #define FSMC_NAND_BANK3 ((uint32_t)0x00000100)
  516. /**
  517. * @}
  518. */
  519. /** @defgroup FSMC_Wait_feature FSMC Wait feature
  520. * @{
  521. */
  522. #define FSMC_NAND_PCC_WAIT_FEATURE_DISABLE ((uint32_t)0x00000000)
  523. #define FSMC_NAND_PCC_WAIT_FEATURE_ENABLE ((uint32_t)FSMC_PCRx_PWAITEN)
  524. /**
  525. * @}
  526. */
  527. /** @defgroup FSMC_PCR_Memory_Type FSMC PCR Memory Type
  528. * @{
  529. */
  530. #define FSMC_PCR_MEMORY_TYPE_PCCARD ((uint32_t)0x00000000)
  531. #define FSMC_PCR_MEMORY_TYPE_NAND ((uint32_t)FSMC_PCRx_PTYP)
  532. /**
  533. * @}
  534. */
  535. /** @defgroup FSMC_NAND_Data_Width FSMC NAND Data Width
  536. * @{
  537. */
  538. #define FSMC_NAND_PCC_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000)
  539. #define FSMC_NAND_PCC_MEM_BUS_WIDTH_16 ((uint32_t)FSMC_PCRx_PWID_0)
  540. /**
  541. * @}
  542. */
  543. /** @defgroup FSMC_ECC FSMC NAND ECC
  544. * @{
  545. */
  546. #define FSMC_NAND_ECC_DISABLE ((uint32_t)0x00000000)
  547. #define FSMC_NAND_ECC_ENABLE ((uint32_t)FSMC_PCRx_ECCEN)
  548. /**
  549. * @}
  550. */
  551. /** @defgroup FSMC_ECC_Page_Size FSMC ECC Page Size
  552. * @{
  553. */
  554. #define FSMC_NAND_ECC_PAGE_SIZE_256BYTE ((uint32_t)0x00000000)
  555. #define FSMC_NAND_ECC_PAGE_SIZE_512BYTE ((uint32_t)FSMC_PCRx_ECCPS_0)
  556. #define FSMC_NAND_ECC_PAGE_SIZE_1024BYTE ((uint32_t)FSMC_PCRx_ECCPS_1)
  557. #define FSMC_NAND_ECC_PAGE_SIZE_2048BYTE ((uint32_t)FSMC_PCRx_ECCPS_0|FSMC_PCRx_ECCPS_1)
  558. #define FSMC_NAND_ECC_PAGE_SIZE_4096BYTE ((uint32_t)FSMC_PCRx_ECCPS_2)
  559. #define FSMC_NAND_ECC_PAGE_SIZE_8192BYTE ((uint32_t)FSMC_PCRx_ECCPS_0|FSMC_PCRx_ECCPS_2)
  560. /**
  561. * @}
  562. */
  563. /** @defgroup FSMC_Interrupt_definition FSMC Interrupt definition
  564. * @brief FSMC Interrupt definition
  565. * @{
  566. */
  567. #define FSMC_IT_RISING_EDGE ((uint32_t)FSMC_SRx_IREN)
  568. #define FSMC_IT_LEVEL ((uint32_t)FSMC_SRx_ILEN)
  569. #define FSMC_IT_FALLING_EDGE ((uint32_t)FSMC_SRx_IFEN)
  570. /**
  571. * @}
  572. */
  573. /** @defgroup FSMC_Flag_definition FSMC Flag definition
  574. * @brief FSMC Flag definition
  575. * @{
  576. */
  577. #define FSMC_FLAG_RISING_EDGE ((uint32_t)FSMC_SRx_IRS)
  578. #define FSMC_FLAG_LEVEL ((uint32_t)FSMC_SRx_ILS)
  579. #define FSMC_FLAG_FALLING_EDGE ((uint32_t)FSMC_SRx_IFS)
  580. #define FSMC_FLAG_FEMPT ((uint32_t)FSMC_SRx_FEMPT)
  581. /**
  582. * @}
  583. */
  584. /**
  585. * @}
  586. */
  587. #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
  588. /**
  589. * @}
  590. */
  591. /* Exported macro ------------------------------------------------------------*/
  592. /** @defgroup FSMC_Exported_Macros FSMC Low Layer Exported Macros
  593. * @{
  594. */
  595. /** @defgroup FSMC_NOR_Macros FSMC NOR/SRAM Exported Macros
  596. * @brief macros to handle NOR device enable/disable and read/write operations
  597. * @{
  598. */
  599. /**
  600. * @brief Enable the NORSRAM device access.
  601. * @param __INSTANCE__ FSMC_NORSRAM Instance
  602. * @param __BANK__ FSMC_NORSRAM Bank
  603. * @retval none
  604. */
  605. #define __FSMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__) SET_BIT((__INSTANCE__)->BTCR[(__BANK__)], FSMC_BCRx_MBKEN)
  606. /**
  607. * @brief Disable the NORSRAM device access.
  608. * @param __INSTANCE__ FSMC_NORSRAM Instance
  609. * @param __BANK__ FSMC_NORSRAM Bank
  610. * @retval none
  611. */
  612. #define __FSMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) CLEAR_BIT((__INSTANCE__)->BTCR[(__BANK__)], FSMC_BCRx_MBKEN)
  613. /**
  614. * @}
  615. */
  616. #if (defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG))
  617. /** @defgroup FSMC_NAND_Macros FSMC NAND Macros
  618. * @brief macros to handle NAND device enable/disable
  619. * @{
  620. */
  621. /**
  622. * @brief Enable the NAND device access.
  623. * @param __INSTANCE__ FSMC_NAND Instance
  624. * @param __BANK__ FSMC_NAND Bank
  625. * @retval None
  626. */
  627. #define __FSMC_NAND_ENABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? SET_BIT((__INSTANCE__)->PCR2, FSMC_PCRx_PBKEN): \
  628. SET_BIT((__INSTANCE__)->PCR3, FSMC_PCRx_PBKEN))
  629. /**
  630. * @brief Disable the NAND device access.
  631. * @param __INSTANCE__ FSMC_NAND Instance
  632. * @param __BANK__ FSMC_NAND Bank
  633. * @retval None
  634. */
  635. #define __FSMC_NAND_DISABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->PCR2, FSMC_PCRx_PBKEN): \
  636. CLEAR_BIT((__INSTANCE__)->PCR3, FSMC_PCRx_PBKEN))
  637. /**
  638. * @}
  639. */
  640. /** @defgroup FSMC_PCCARD_Macros FSMC PCCARD Macros
  641. * @brief macros to handle PCCARD read/write operations
  642. * @{
  643. */
  644. /**
  645. * @brief Enable the PCCARD device access.
  646. * @param __INSTANCE__ FSMC_PCCARD Instance
  647. * @retval None
  648. */
  649. #define __FSMC_PCCARD_ENABLE(__INSTANCE__) SET_BIT((__INSTANCE__)->PCR4, FSMC_PCRx_PBKEN)
  650. /**
  651. * @brief Disable the PCCARD device access.
  652. * @param __INSTANCE__ FSMC_PCCARD Instance
  653. * @retval None
  654. */
  655. #define __FSMC_PCCARD_DISABLE(__INSTANCE__) CLEAR_BIT((__INSTANCE__)->PCR4, FSMC_PCRx_PBKEN)
  656. /**
  657. * @}
  658. */
  659. /** @defgroup FSMC_Interrupt FSMC Interrupt
  660. * @brief macros to handle FSMC interrupts
  661. * @{
  662. */
  663. /**
  664. * @brief Enable the NAND device interrupt.
  665. * @param __INSTANCE__ FSMC_NAND Instance
  666. * @param __BANK__ FSMC_NAND Bank
  667. * @param __INTERRUPT__ FSMC_NAND interrupt
  668. * This parameter can be any combination of the following values:
  669. * @arg FSMC_IT_RISING_EDGE Interrupt rising edge.
  670. * @arg FSMC_IT_LEVEL Interrupt level.
  671. * @arg FSMC_IT_FALLING_EDGE Interrupt falling edge.
  672. * @retval None
  673. */
  674. #define __FSMC_NAND_ENABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) (((__BANK__) == FSMC_NAND_BANK2)? SET_BIT((__INSTANCE__)->SR2, (__INTERRUPT__)): \
  675. SET_BIT((__INSTANCE__)->SR3, (__INTERRUPT__)))
  676. /**
  677. * @brief Disable the NAND device interrupt.
  678. * @param __INSTANCE__ FSMC_NAND Instance
  679. * @param __BANK__ FSMC_NAND Bank
  680. * @param __INTERRUPT__ FSMC_NAND interrupt
  681. * This parameter can be any combination of the following values:
  682. * @arg FSMC_IT_RISING_EDGE Interrupt rising edge.
  683. * @arg FSMC_IT_LEVEL Interrupt level.
  684. * @arg FSMC_IT_FALLING_EDGE Interrupt falling edge.
  685. * @retval None
  686. */
  687. #define __FSMC_NAND_DISABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->SR2, (__INTERRUPT__)): \
  688. CLEAR_BIT((__INSTANCE__)->SR3, (__INTERRUPT__)))
  689. /**
  690. * @brief Get flag status of the NAND device.
  691. * @param __INSTANCE__ FSMC_NAND Instance
  692. * @param __BANK__ FSMC_NAND Bank
  693. * @param __FLAG__ FSMC_NAND flag
  694. * This parameter can be any combination of the following values:
  695. * @arg FSMC_FLAG_RISING_EDGE Interrupt rising edge flag.
  696. * @arg FSMC_FLAG_LEVEL Interrupt level edge flag.
  697. * @arg FSMC_FLAG_FALLING_EDGE Interrupt falling edge flag.
  698. * @arg FSMC_FLAG_FEMPT FIFO empty flag.
  699. * @retval The state of FLAG (SET or RESET).
  700. */
  701. #define __FSMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FSMC_NAND_BANK2)? (((__INSTANCE__)->SR2 &(__FLAG__)) == (__FLAG__)): \
  702. (((__INSTANCE__)->SR3 &(__FLAG__)) == (__FLAG__)))
  703. /**
  704. * @brief Clear flag status of the NAND device.
  705. * @param __INSTANCE__ FSMC_NAND Instance
  706. * @param __BANK__ FSMC_NAND Bank
  707. * @param __FLAG__ FSMC_NAND flag
  708. * This parameter can be any combination of the following values:
  709. * @arg FSMC_FLAG_RISING_EDGE Interrupt rising edge flag.
  710. * @arg FSMC_FLAG_LEVEL Interrupt level edge flag.
  711. * @arg FSMC_FLAG_FALLING_EDGE Interrupt falling edge flag.
  712. * @arg FSMC_FLAG_FEMPT FIFO empty flag.
  713. * @retval None
  714. */
  715. #define __FSMC_NAND_CLEAR_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->SR2, (__FLAG__)): \
  716. CLEAR_BIT((__INSTANCE__)->SR3, (__FLAG__)))
  717. /**
  718. * @brief Enable the PCCARD device interrupt.
  719. * @param __INSTANCE__ FSMC_PCCARD Instance
  720. * @param __INTERRUPT__ FSMC_PCCARD interrupt
  721. * This parameter can be any combination of the following values:
  722. * @arg FSMC_IT_RISING_EDGE Interrupt rising edge.
  723. * @arg FSMC_IT_LEVEL Interrupt level.
  724. * @arg FSMC_IT_FALLING_EDGE Interrupt falling edge.
  725. * @retval None
  726. */
  727. #define __FSMC_PCCARD_ENABLE_IT(__INSTANCE__, __INTERRUPT__) SET_BIT((__INSTANCE__)->SR4, (__INTERRUPT__))
  728. /**
  729. * @brief Disable the PCCARD device interrupt.
  730. * @param __INSTANCE__ FSMC_PCCARD Instance
  731. * @param __INTERRUPT__ FSMC_PCCARD interrupt
  732. * This parameter can be any combination of the following values:
  733. * @arg FSMC_IT_RISING_EDGE Interrupt rising edge.
  734. * @arg FSMC_IT_LEVEL Interrupt level.
  735. * @arg FSMC_IT_FALLING_EDGE Interrupt falling edge.
  736. * @retval None
  737. */
  738. #define __FSMC_PCCARD_DISABLE_IT(__INSTANCE__, __INTERRUPT__) CLEAR_BIT((__INSTANCE__)->SR4, (__INTERRUPT__))
  739. /**
  740. * @brief Get flag status of the PCCARD device.
  741. * @param __INSTANCE__ FSMC_PCCARD Instance
  742. * @param __FLAG__ FSMC_PCCARD flag
  743. * This parameter can be any combination of the following values:
  744. * @arg FSMC_FLAG_RISING_EDGE Interrupt rising edge flag.
  745. * @arg FSMC_FLAG_LEVEL Interrupt level edge flag.
  746. * @arg FSMC_FLAG_FALLING_EDGE Interrupt falling edge flag.
  747. * @arg FSMC_FLAG_FEMPT FIFO empty flag.
  748. * @retval The state of FLAG (SET or RESET).
  749. */
  750. #define __FSMC_PCCARD_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->SR4 &(__FLAG__)) == (__FLAG__))
  751. /**
  752. * @brief Clear flag status of the PCCARD device.
  753. * @param __INSTANCE__ FSMC_PCCARD Instance
  754. * @param __FLAG__ FSMC_PCCARD flag
  755. * This parameter can be any combination of the following values:
  756. * @arg FSMC_FLAG_RISING_EDGE Interrupt rising edge flag.
  757. * @arg FSMC_FLAG_LEVEL Interrupt level edge flag.
  758. * @arg FSMC_FLAG_FALLING_EDGE Interrupt falling edge flag.
  759. * @arg FSMC_FLAG_FEMPT FIFO empty flag.
  760. * @retval None
  761. */
  762. #define __FSMC_PCCARD_CLEAR_FLAG(__INSTANCE__, __FLAG__) CLEAR_BIT((__INSTANCE__)->SR4, (__FLAG__))
  763. /**
  764. * @}
  765. */
  766. #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
  767. /**
  768. * @}
  769. */
  770. /* Exported functions --------------------------------------------------------*/
  771. /** @addtogroup FSMC_LL_Exported_Functions
  772. * @{
  773. */
  774. /** @addtogroup FSMC_NORSRAM
  775. * @{
  776. */
  777. /** @addtogroup FSMC_NORSRAM_Group1
  778. * @{
  779. */
  780. /* FSMC_NORSRAM Controller functions ******************************************/
  781. /* Initialization/de-initialization functions */
  782. HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_InitTypeDef *Init);
  783. HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank);
  784. HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode);
  785. HAL_StatusTypeDef FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank);
  786. /**
  787. * @}
  788. */
  789. /** @addtogroup FSMC_NORSRAM_Group2
  790. * @{
  791. */
  792. /* FSMC_NORSRAM Control functions */
  793. HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank);
  794. HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank);
  795. /**
  796. * @}
  797. */
  798. /**
  799. * @}
  800. */
  801. #if (defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG))
  802. /** @addtogroup FSMC_NAND
  803. * @{
  804. */
  805. /* FSMC_NAND Controller functions **********************************************/
  806. /* Initialization/de-initialization functions */
  807. /** @addtogroup FSMC_NAND_Exported_Functions_Group1
  808. * @{
  809. */
  810. HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDef *Init);
  811. HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
  812. HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
  813. HAL_StatusTypeDef FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank);
  814. /**
  815. * @}
  816. */
  817. /* FSMC_NAND Control functions */
  818. /** @addtogroup FSMC_NAND_Exported_Functions_Group2
  819. * @{
  820. */
  821. HAL_StatusTypeDef FSMC_NAND_ECC_Enable(FSMC_NAND_TypeDef *Device, uint32_t Bank);
  822. HAL_StatusTypeDef FSMC_NAND_ECC_Disable(FSMC_NAND_TypeDef *Device, uint32_t Bank);
  823. HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout);
  824. /**
  825. * @}
  826. */
  827. /**
  828. * @}
  829. */
  830. /** @addtogroup FSMC_PCCARD
  831. * @{
  832. */
  833. /* FSMC_PCCARD Controller functions ********************************************/
  834. /* Initialization/de-initialization functions */
  835. /** @addtogroup FSMC_PCCARD_Exported_Functions_Group1
  836. * @{
  837. */
  838. HAL_StatusTypeDef FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_InitTypeDef *Init);
  839. HAL_StatusTypeDef FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
  840. HAL_StatusTypeDef FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
  841. HAL_StatusTypeDef FSMC_PCCARD_IOSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
  842. HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device);
  843. /**
  844. * @}
  845. */
  846. /**
  847. * @}
  848. */
  849. #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
  850. /**
  851. * @}
  852. */
  853. /**
  854. * @}
  855. */
  856. #endif /* FSMC_BANK1 */
  857. /**
  858. * @}
  859. */
  860. #ifdef __cplusplus
  861. }
  862. #endif
  863. #endif /* __STM32F1xx_LL_FSMC_H */
  864. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/