Subversion Repositories dashGPS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /**
  2.   ******************************************************************************
  3.   * @file    stm32f1xx_ll_fsmc.h
  4.   * @author  MCD Application Team
  5.   * @brief   Header file of FSMC HAL module.
  6.   ******************************************************************************
  7.   * @attention
  8.   *
  9.   * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  10.   * All rights reserved.</center></h2>
  11.   *
  12.   * This software component is licensed by ST under BSD 3-Clause license,
  13.   * the "License"; You may not use this file except in compliance with the
  14.   * License. You may obtain a copy of the License at:
  15.   *                       opensource.org/licenses/BSD-3-Clause
  16.   *
  17.   ******************************************************************************
  18.   */
  19.  
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef STM32F1xx_LL_FSMC_H
  22. #define STM32F1xx_LL_FSMC_H
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f1xx_hal_def.h"
  30.  
  31. /** @addtogroup STM32F1xx_HAL_Driver
  32.   * @{
  33.   */
  34.  
  35. /** @addtogroup FSMC_LL
  36.   * @{
  37.   */
  38.  
  39. /** @addtogroup FSMC_LL_Private_Macros
  40.   * @{
  41.   */
  42. #if defined FSMC_BANK1
  43.  
  44. #define IS_FSMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FSMC_NORSRAM_BANK1) || \
  45.                                        ((__BANK__) == FSMC_NORSRAM_BANK2) || \
  46.                                        ((__BANK__) == FSMC_NORSRAM_BANK3) || \
  47.                                        ((__BANK__) == FSMC_NORSRAM_BANK4))
  48. #define IS_FSMC_MUX(__MUX__) (((__MUX__) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \
  49.                              ((__MUX__) == FSMC_DATA_ADDRESS_MUX_ENABLE))
  50. #define IS_FSMC_MEMORY(__MEMORY__) (((__MEMORY__) == FSMC_MEMORY_TYPE_SRAM) || \
  51.                                    ((__MEMORY__) == FSMC_MEMORY_TYPE_PSRAM)|| \
  52.                                    ((__MEMORY__) == FSMC_MEMORY_TYPE_NOR))
  53. #define IS_FSMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_8)  || \
  54.                                                 ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \
  55.                                                 ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_32))
  56. #define IS_FSMC_PAGESIZE(__SIZE__) (((__SIZE__) == FSMC_PAGE_SIZE_NONE) || \
  57.                                    ((__SIZE__) == FSMC_PAGE_SIZE_128) || \
  58.                                    ((__SIZE__) == FSMC_PAGE_SIZE_256) || \
  59.                                    ((__SIZE__) == FSMC_PAGE_SIZE_512) || \
  60.                                    ((__SIZE__) == FSMC_PAGE_SIZE_1024))
  61. #define IS_FSMC_ACCESS_MODE(__MODE__) (((__MODE__) == FSMC_ACCESS_MODE_A) || \
  62.                                       ((__MODE__) == FSMC_ACCESS_MODE_B) || \
  63.                                       ((__MODE__) == FSMC_ACCESS_MODE_C) || \
  64.                                       ((__MODE__) == FSMC_ACCESS_MODE_D))
  65. #define IS_FSMC_BURSTMODE(__STATE__) (((__STATE__) == FSMC_BURST_ACCESS_MODE_DISABLE) || \
  66.                                      ((__STATE__) == FSMC_BURST_ACCESS_MODE_ENABLE))
  67. #define IS_FSMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \
  68.                                             ((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_HIGH))
  69. #define IS_FSMC_WRAP_MODE(__MODE__) (((__MODE__) == FSMC_WRAP_MODE_DISABLE) || \
  70.                                      ((__MODE__) == FSMC_WRAP_MODE_ENABLE))    
  71. #define IS_FSMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FSMC_WAIT_TIMING_BEFORE_WS) || \
  72.                                                ((__ACTIVE__) == FSMC_WAIT_TIMING_DURING_WS))
  73. #define IS_FSMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FSMC_WRITE_OPERATION_DISABLE) || \
  74.                                                ((__OPERATION__) == FSMC_WRITE_OPERATION_ENABLE))
  75. #define IS_FSMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FSMC_WAIT_SIGNAL_DISABLE) || \
  76.                                          ((__SIGNAL__) == FSMC_WAIT_SIGNAL_ENABLE))
  77. #define IS_FSMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FSMC_EXTENDED_MODE_DISABLE) || \
  78.                                         ((__MODE__) == FSMC_EXTENDED_MODE_ENABLE))
  79. #define IS_FSMC_ASYNWAIT(__STATE__) (((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \
  80.                                     ((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_ENABLE))
  81. #define IS_FSMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1U) && ((__LATENCY__) <= 17U))
  82. #define IS_FSMC_WRITE_BURST(__BURST__) (((__BURST__) == FSMC_WRITE_BURST_DISABLE) || \
  83.                                        ((__BURST__) == FSMC_WRITE_BURST_ENABLE))
  84. #define IS_FSMC_CONTINOUS_CLOCK(__CCLOCK__) (((__CCLOCK__) == FSMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \
  85.                                             ((__CCLOCK__) == FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC))
  86. #define IS_FSMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15U)
  87. #define IS_FSMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 15U))
  88. #define IS_FSMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 255U))
  89. #define IS_FSMC_DATAHOLD_DURATION(__DATAHOLD__) ((__DATAHOLD__) <= 3U)
  90. #define IS_FSMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15U)
  91. #define IS_FSMC_CLK_DIV(__DIV__) (((__DIV__) > 1U) && ((__DIV__) <= 16U))
  92. #define IS_FSMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_DEVICE)
  93. #define IS_FSMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_EXTENDED_DEVICE)
  94.  
  95. #endif /* FSMC_BANK1 */
  96. #if defined(FSMC_BANK3)
  97.  
  98. #define IS_FSMC_NAND_BANK(__BANK__) ((__BANK__) == FSMC_NAND_BANK3)
  99. #define IS_FSMC_WAIT_FEATURE(__FEATURE__) (((__FEATURE__) == FSMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \
  100.                                           ((__FEATURE__) == FSMC_NAND_PCC_WAIT_FEATURE_ENABLE))
  101. #define IS_FSMC_NAND_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NAND_PCC_MEM_BUS_WIDTH_8) || \
  102.                                              ((__WIDTH__) == FSMC_NAND_PCC_MEM_BUS_WIDTH_16))
  103. #define IS_FSMC_ECC_STATE(__STATE__) (((__STATE__) == FSMC_NAND_ECC_DISABLE) || \
  104.                                      ((__STATE__) == FSMC_NAND_ECC_ENABLE))
  105.  
  106. #define IS_FSMC_ECCPAGE_SIZE(__SIZE__) (((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_256BYTE)  || \
  107.                                        ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_512BYTE)  || \
  108.                                        ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \
  109.                                        ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \
  110.                                        ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \
  111.                                        ((__SIZE__) == FSMC_NAND_ECC_PAGE_SIZE_8192BYTE))
  112. #define IS_FSMC_TCLR_TIME(__TIME__) ((__TIME__) <= 255U)
  113. #define IS_FSMC_TAR_TIME(__TIME__) ((__TIME__) <= 255U)
  114. #define IS_FSMC_SETUP_TIME(__TIME__) ((__TIME__) <= 254U)
  115. #define IS_FSMC_WAIT_TIME(__TIME__) ((__TIME__) <= 254U)
  116. #define IS_FSMC_HOLD_TIME(__TIME__) ((__TIME__) <= 254U)
  117. #define IS_FSMC_HIZ_TIME(__TIME__) ((__TIME__) <= 254U)
  118. #define IS_FSMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NAND_DEVICE)
  119.  
  120. #endif /* FSMC_BANK3 */
  121. #if defined(FSMC_BANK4)
  122. #define IS_FSMC_PCCARD_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_PCCARD_DEVICE)
  123.  
  124. #endif /* FSMC_BANK4 */
  125.  
  126. /**
  127.   * @}
  128.   */
  129.  
  130. /* Exported typedef ----------------------------------------------------------*/
  131.  
  132. /** @defgroup FSMC_LL_Exported_typedef FSMC Low Layer Exported Types
  133.   * @{
  134.   */
  135.  
  136. #if defined FSMC_BANK1
  137. #define FSMC_NORSRAM_TypeDef            FSMC_Bank1_TypeDef
  138. #define FSMC_NORSRAM_EXTENDED_TypeDef   FSMC_Bank1E_TypeDef
  139. #endif /* FSMC_BANK1 */
  140. #if defined(FSMC_BANK3)
  141. #define FSMC_NAND_TypeDef               FSMC_Bank2_3_TypeDef
  142. #endif /* FSMC_BANK3 */
  143. #if defined(FSMC_BANK4)
  144. #define FSMC_PCCARD_TypeDef             FSMC_Bank4_TypeDef
  145. #endif /* FSMC_BANK4 */
  146.  
  147. #if defined FSMC_BANK1
  148. #define FSMC_NORSRAM_DEVICE             FSMC_Bank1
  149. #define FSMC_NORSRAM_EXTENDED_DEVICE    FSMC_Bank1E
  150. #endif /* FSMC_BANK1 */
  151. #if defined(FSMC_BANK3)
  152. #define FSMC_NAND_DEVICE                FSMC_Bank2_3
  153. #endif /* FSMC_BANK3 */
  154. #if defined(FSMC_BANK4)
  155. #define FSMC_PCCARD_DEVICE              FSMC_Bank4
  156. #endif /* FSMC_BANK4 */
  157.  
  158. #if defined FSMC_BANK1
  159. /**
  160.   * @brief  FSMC NORSRAM Configuration Structure definition
  161.   */
  162. typedef struct
  163. {
  164.   uint32_t NSBank;                       /*!< Specifies the NORSRAM memory device that will be used.
  165.                                               This parameter can be a value of @ref FSMC_NORSRAM_Bank                     */
  166.  
  167.   uint32_t DataAddressMux;               /*!< Specifies whether the address and data values are
  168.                                               multiplexed on the data bus or not.
  169.                                               This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing    */
  170.  
  171.   uint32_t MemoryType;                   /*!< Specifies the type of external memory attached to
  172.                                               the corresponding memory device.
  173.                                               This parameter can be a value of @ref FSMC_Memory_Type                      */
  174.  
  175.   uint32_t MemoryDataWidth;              /*!< Specifies the external memory device width.
  176.                                               This parameter can be a value of @ref FSMC_NORSRAM_Data_Width               */
  177.  
  178.   uint32_t BurstAccessMode;              /*!< Enables or disables the burst access mode for Flash memory,
  179.                                               valid only with synchronous burst Flash memories.
  180.                                               This parameter can be a value of @ref FSMC_Burst_Access_Mode                */
  181.  
  182.   uint32_t WaitSignalPolarity;           /*!< Specifies the wait signal polarity, valid only when accessing
  183.                                               the Flash memory in burst mode.
  184.                                               This parameter can be a value of @ref FSMC_Wait_Signal_Polarity             */
  185.  
  186.   uint32_t WrapMode;                     /*!< Enables or disables the Wrapped burst access mode for Flash
  187.                                               memory, valid only when accessing Flash memories in burst mode.
  188.                                               This parameter can be a value of @ref FSMC_Wrap_Mode                        */
  189.  
  190.   uint32_t WaitSignalActive;             /*!< Specifies if the wait signal is asserted by the memory one
  191.                                               clock cycle before the wait state or during the wait state,
  192.                                               valid only when accessing memories in burst mode.
  193.                                               This parameter can be a value of @ref FSMC_Wait_Timing                      */
  194.  
  195.   uint32_t WriteOperation;               /*!< Enables or disables the write operation in the selected device by the FSMC.
  196.                                               This parameter can be a value of @ref FSMC_Write_Operation                  */
  197.  
  198.   uint32_t WaitSignal;                   /*!< Enables or disables the wait state insertion via wait
  199.                                               signal, valid for Flash memory access in burst mode.
  200.                                               This parameter can be a value of @ref FSMC_Wait_Signal                      */
  201.  
  202.   uint32_t ExtendedMode;                 /*!< Enables or disables the extended mode.
  203.                                               This parameter can be a value of @ref FSMC_Extended_Mode                    */
  204.  
  205.   uint32_t AsynchronousWait;             /*!< Enables or disables wait signal during asynchronous transfers,
  206.                                               valid only with asynchronous Flash memories.
  207.                                               This parameter can be a value of @ref FSMC_AsynchronousWait                 */
  208.  
  209.   uint32_t WriteBurst;                   /*!< Enables or disables the write burst operation.
  210.                                               This parameter can be a value of @ref FSMC_Write_Burst                      */
  211.  
  212.  
  213.   uint32_t PageSize;                     /*!< Specifies the memory page size.
  214.                                               This parameter can be a value of @ref FSMC_Page_Size                        */
  215. }FSMC_NORSRAM_InitTypeDef;
  216.  
  217. /**
  218.   * @brief  FSMC NORSRAM Timing parameters structure definition
  219.   */
  220. typedef struct
  221. {
  222.   uint32_t AddressSetupTime;             /*!< Defines the number of HCLK cycles to configure
  223.                                               the duration of the address setup time.
  224.                                               This parameter can be a value between Min_Data = 0 and Max_Data = 15.
  225.                                               @note This parameter is not used with synchronous NOR Flash memories.      */
  226.  
  227.   uint32_t AddressHoldTime;              /*!< Defines the number of HCLK cycles to configure
  228.                                               the duration of the address hold time.
  229.                                               This parameter can be a value between Min_Data = 1 and Max_Data = 15.
  230.                                               @note This parameter is not used with synchronous NOR Flash memories.      */
  231.  
  232.   uint32_t DataSetupTime;                /*!< Defines the number of HCLK cycles to configure
  233.                                               the duration of the data setup time.
  234.                                               This parameter can be a value between Min_Data = 1 and Max_Data = 255.
  235.                                               @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed
  236.                                               NOR Flash memories.                                                        */
  237.  
  238.   uint32_t BusTurnAroundDuration;        /*!< Defines the number of HCLK cycles to configure
  239.                                               the duration of the bus turnaround.
  240.                                               This parameter can be a value between Min_Data = 0 and Max_Data = 15.
  241.                                               @note This parameter is only used for multiplexed NOR Flash memories.      */
  242.  
  243.   uint32_t CLKDivision;                  /*!< Defines the period of CLK clock output signal, expressed in number of
  244.                                               HCLK cycles. This parameter can be a value between Min_Data = 2 and Max_Data = 16.
  245.                                               @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM
  246.                                               accesses.                                                                  */
  247.  
  248.   uint32_t DataLatency;                  /*!< Defines the number of memory clock cycles to issue
  249.                                               to the memory before getting the first data.
  250.                                               The parameter value depends on the memory type as shown below:
  251.                                               - It must be set to 0 in case of a CRAM
  252.                                               - It is don't care in asynchronous NOR, SRAM or ROM accesses
  253.                                               - It may assume a value between Min_Data = 2 and Max_Data = 17 in NOR Flash memories
  254.                                                 with synchronous burst mode enable                                       */
  255.  
  256.   uint32_t AccessMode;                   /*!< Specifies the asynchronous access mode.
  257.                                               This parameter can be a value of @ref FSMC_Access_Mode                      */
  258. }FSMC_NORSRAM_TimingTypeDef;
  259. #endif /* FSMC_BANK1 */
  260.  
  261. #if defined(FSMC_BANK3)
  262. /**
  263.   * @brief  FSMC NAND Configuration Structure definition
  264.   */
  265. typedef struct
  266. {
  267.   uint32_t NandBank;               /*!< Specifies the NAND memory device that will be used.
  268.                                         This parameter can be a value of @ref FSMC_NAND_Bank                    */
  269.  
  270.   uint32_t Waitfeature;            /*!< Enables or disables the Wait feature for the NAND Memory device.
  271.                                         This parameter can be any value of @ref FSMC_Wait_feature               */
  272.  
  273.   uint32_t MemoryDataWidth;        /*!< Specifies the external memory device width.
  274.                                         This parameter can be any value of @ref FSMC_NAND_Data_Width            */
  275.  
  276.   uint32_t EccComputation;         /*!< Enables or disables the ECC computation.
  277.                                         This parameter can be any value of @ref FSMC_ECC                        */
  278.  
  279.   uint32_t ECCPageSize;            /*!< Defines the page size for the extended ECC.
  280.                                         This parameter can be any value of @ref FSMC_ECC_Page_Size              */
  281.  
  282.   uint32_t TCLRSetupTime;          /*!< Defines the number of HCLK cycles to configure the
  283.                                         delay between CLE low and RE low.
  284.                                         This parameter can be a value between Min_Data = 0 and Max_Data = 255  */
  285.  
  286.   uint32_t TARSetupTime;           /*!< Defines the number of HCLK cycles to configure the
  287.                                         delay between ALE low and RE low.
  288.                                         This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  289. }FSMC_NAND_InitTypeDef;
  290. #endif
  291.  
  292. #if defined(FSMC_BANK3)||defined(FSMC_BANK4)
  293. /**
  294.   * @brief  FSMC NAND Timing parameters structure definition
  295.   */
  296. typedef struct
  297. {
  298.   uint32_t SetupTime;            /*!< Defines the number of HCLK cycles to setup address before
  299.                                       the command assertion for NAND-Flash read or write access
  300.                                       to common/Attribute or I/O memory space (depending on
  301.                                       the memory space timing to be configured).
  302.                                       This parameter can be a value between Min_Data = 0 and Max_Data = 254    */
  303.  
  304.   uint32_t WaitSetupTime;        /*!< Defines the minimum number of HCLK cycles to assert the
  305.                                       command for NAND-Flash read or write access to
  306.                                       common/Attribute or I/O memory space (depending on the
  307.                                       memory space timing to be configured).
  308.                                       This parameter can be a number between Min_Data = 0 and Max_Data = 254   */
  309.  
  310.   uint32_t HoldSetupTime;        /*!< Defines the number of HCLK clock cycles to hold address
  311.                                       (and data for write access) after the command de-assertion
  312.                                       for NAND-Flash read or write access to common/Attribute
  313.                                       or I/O memory space (depending on the memory space timing
  314.                                       to be configured).
  315.                                       This parameter can be a number between Min_Data = 0 and Max_Data = 254   */
  316.  
  317.   uint32_t HiZSetupTime;         /*!< Defines the number of HCLK clock cycles during which the
  318.                                       data bus is kept in HiZ after the start of a NAND-Flash
  319.                                       write access to common/Attribute or I/O memory space (depending
  320.                                       on the memory space timing to be configured).
  321.                                       This parameter can be a number between Min_Data = 0 and Max_Data = 254   */
  322. }FSMC_NAND_PCC_TimingTypeDef;
  323. #endif /* FSMC_BANK3 */
  324.  
  325. #if defined(FSMC_BANK4)
  326. /**
  327.   * @brief FSMC PCCARD Configuration Structure definition
  328.   */
  329. typedef struct
  330. {
  331.   uint32_t Waitfeature;            /*!< Enables or disables the Wait feature for the PCCARD Memory device.
  332.                                         This parameter can be any value of @ref FSMC_Wait_feature      */
  333.  
  334.   uint32_t TCLRSetupTime;          /*!< Defines the number of HCLK cycles to configure the
  335.                                         delay between CLE low and RE low.
  336.                                         This parameter can be a value between Min_Data = 0 and Max_Data = 255  */
  337.  
  338.   uint32_t TARSetupTime;           /*!< Defines the number of HCLK cycles to configure the
  339.                                         delay between ALE low and RE low.
  340.                                         This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
  341. }FSMC_PCCARD_InitTypeDef;
  342. #endif
  343.  
  344. /**
  345.   * @}
  346.   */
  347.  
  348. /* Exported constants --------------------------------------------------------*/
  349. /** @addtogroup FSMC_LL_Exported_Constants FSMC Low Layer Exported Constants
  350.   * @{
  351.   */
  352. #if defined FSMC_BANK1
  353.  
  354. /** @defgroup FSMC_LL_NOR_SRAM_Controller FSMC NOR/SRAM Controller
  355.   * @{
  356.   */
  357.  
  358. /** @defgroup FSMC_NORSRAM_Bank FSMC NOR/SRAM Bank
  359.   * @{
  360.   */
  361. #define FSMC_NORSRAM_BANK1                       ((uint32_t)0x00000000U)
  362. #define FSMC_NORSRAM_BANK2                       ((uint32_t)0x00000002U)
  363. #define FSMC_NORSRAM_BANK3                       ((uint32_t)0x00000004U)
  364. #define FSMC_NORSRAM_BANK4                       ((uint32_t)0x00000006U)
  365. /**
  366.   * @}
  367.   */
  368.  
  369. /** @defgroup FSMC_Data_Address_Bus_Multiplexing FSMC Data Address Bus Multiplexing
  370.   * @{
  371.   */
  372. #define FSMC_DATA_ADDRESS_MUX_DISABLE            ((uint32_t)0x00000000U)
  373. #define FSMC_DATA_ADDRESS_MUX_ENABLE             ((uint32_t)0x00000002U)
  374. /**
  375.   * @}
  376.   */
  377.  
  378. /** @defgroup FSMC_Memory_Type FSMC Memory Type
  379.   * @{
  380.   */
  381. #define FSMC_MEMORY_TYPE_SRAM                    ((uint32_t)0x00000000U)
  382. #define FSMC_MEMORY_TYPE_PSRAM                   ((uint32_t)0x00000004U)
  383. #define FSMC_MEMORY_TYPE_NOR                     ((uint32_t)0x00000008U)
  384. /**
  385.   * @}
  386.   */
  387.  
  388. /** @defgroup FSMC_NORSRAM_Data_Width FSMC NORSRAM Data Width
  389.   * @{
  390.   */
  391. #define FSMC_NORSRAM_MEM_BUS_WIDTH_8             ((uint32_t)0x00000000U)
  392. #define FSMC_NORSRAM_MEM_BUS_WIDTH_16            ((uint32_t)0x00000010U)
  393. #define FSMC_NORSRAM_MEM_BUS_WIDTH_32            ((uint32_t)0x00000020U)
  394. /**
  395.   * @}
  396.   */
  397.  
  398. /** @defgroup FSMC_NORSRAM_Flash_Access FSMC NOR/SRAM Flash Access
  399.   * @{
  400.   */
  401. #define FSMC_NORSRAM_FLASH_ACCESS_ENABLE         ((uint32_t)0x00000040U)
  402. #define FSMC_NORSRAM_FLASH_ACCESS_DISABLE        ((uint32_t)0x00000000U)
  403. /**
  404.   * @}
  405.   */
  406.  
  407. /** @defgroup FSMC_Burst_Access_Mode FSMC Burst Access Mode
  408.   * @{
  409.   */
  410. #define FSMC_BURST_ACCESS_MODE_DISABLE           ((uint32_t)0x00000000U)
  411. #define FSMC_BURST_ACCESS_MODE_ENABLE            ((uint32_t)0x00000100U)
  412. /**
  413.   * @}
  414.   */
  415.  
  416. /** @defgroup FSMC_Wait_Signal_Polarity FSMC Wait Signal Polarity
  417.   * @{
  418.   */
  419. #define FSMC_WAIT_SIGNAL_POLARITY_LOW            ((uint32_t)0x00000000U)
  420. #define FSMC_WAIT_SIGNAL_POLARITY_HIGH           ((uint32_t)0x00000200U)
  421. /**
  422.   * @}
  423.   */
  424.  
  425. /** @defgroup FSMC_Wrap_Mode FSMC Wrap Mode
  426.   * @{
  427.   */
  428. #define FSMC_WRAP_MODE_DISABLE                   ((uint32_t)0x00000000U)
  429. #define FSMC_WRAP_MODE_ENABLE                    ((uint32_t)0x00000400U)
  430. /**
  431.   * @}
  432.   */
  433.  
  434. /** @defgroup FSMC_Wait_Timing FSMC Wait Timing
  435.   * @{
  436.   */
  437. #define FSMC_WAIT_TIMING_BEFORE_WS               ((uint32_t)0x00000000U)
  438. #define FSMC_WAIT_TIMING_DURING_WS               ((uint32_t)0x00000800U)
  439. /**
  440.   * @}
  441.   */
  442.  
  443. /** @defgroup FSMC_Write_Operation FSMC Write Operation
  444.   * @{
  445.   */
  446. #define FSMC_WRITE_OPERATION_DISABLE             ((uint32_t)0x00000000U)
  447. #define FSMC_WRITE_OPERATION_ENABLE              ((uint32_t)0x00001000U)
  448. /**
  449.   * @}
  450.   */
  451.  
  452. /** @defgroup FSMC_Wait_Signal FSMC Wait Signal
  453.   * @{
  454.   */
  455. #define FSMC_WAIT_SIGNAL_DISABLE                 ((uint32_t)0x00000000U)
  456. #define FSMC_WAIT_SIGNAL_ENABLE                  ((uint32_t)0x00002000U)
  457. /**
  458.   * @}
  459.   */
  460.  
  461. /** @defgroup FSMC_Extended_Mode FSMC Extended Mode
  462.   * @{
  463.   */
  464. #define FSMC_EXTENDED_MODE_DISABLE               ((uint32_t)0x00000000U)
  465. #define FSMC_EXTENDED_MODE_ENABLE                ((uint32_t)0x00004000U)
  466. /**
  467.   * @}
  468.   */
  469.  
  470. /** @defgroup FSMC_AsynchronousWait FSMC Asynchronous Wait
  471.   * @{
  472.   */
  473. #define FSMC_ASYNCHRONOUS_WAIT_DISABLE           ((uint32_t)0x00000000U)
  474. #define FSMC_ASYNCHRONOUS_WAIT_ENABLE            ((uint32_t)0x00008000U)
  475. /**
  476.   * @}
  477.   */
  478.  
  479. /** @defgroup FSMC_Page_Size FSMC Page Size
  480.   * @{
  481.   */
  482. #define FSMC_PAGE_SIZE_NONE                      ((uint32_t)0x00000000U)
  483. #define FSMC_PAGE_SIZE_128                       ((uint32_t)0x00010000U)
  484. #define FSMC_PAGE_SIZE_256                       ((uint32_t)0x00020000U)
  485. #define FSMC_PAGE_SIZE_512                       ((uint32_t)0x00030000U)
  486. #define FSMC_PAGE_SIZE_1024                      ((uint32_t)0x00040000U)
  487. /**
  488.   * @}
  489.   */
  490.  
  491. /** @defgroup FSMC_Write_Burst FSMC Write Burst
  492.   * @{
  493.   */
  494. #define FSMC_WRITE_BURST_DISABLE                 ((uint32_t)0x00000000U)
  495. #define FSMC_WRITE_BURST_ENABLE                  ((uint32_t)0x00080000U)
  496. /**
  497.   * @}
  498.   */
  499.  
  500. /** @defgroup FSMC_Continous_Clock FSMC Continuous Clock
  501.   * @{
  502.   */
  503. #define FSMC_CONTINUOUS_CLOCK_SYNC_ONLY          ((uint32_t)0x00000000U)
  504. #define FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC         ((uint32_t)0x00100000U)
  505. /**
  506.   * @}
  507.   */
  508.  
  509.   /** @defgroup FSMC_Access_Mode FSMC Access Mode
  510.   * @{
  511.   */
  512. #define FSMC_ACCESS_MODE_A                       ((uint32_t)0x00000000U)
  513. #define FSMC_ACCESS_MODE_B                       ((uint32_t)0x10000000U)
  514. #define FSMC_ACCESS_MODE_C                       ((uint32_t)0x20000000U)
  515. #define FSMC_ACCESS_MODE_D                       ((uint32_t)0x30000000U)
  516. /**
  517.   * @}
  518.   */
  519.  
  520. /**
  521.   * @}
  522.   */
  523. #endif /* FSMC_BANK1 */
  524.  
  525. #if defined(FSMC_BANK3)||defined(FSMC_BANK4)
  526.  
  527. /** @defgroup FSMC_LL_NAND_Controller FSMC NAND Controller
  528.   * @{
  529.   */
  530. /** @defgroup FSMC_NAND_Bank FSMC NAND Bank
  531.   * @{
  532.   */
  533. #define FSMC_NAND_BANK2                          ((uint32_t)0x00000010U)
  534. #define FSMC_NAND_BANK3                          ((uint32_t)0x00000100U)
  535. /**
  536.   * @}
  537.   */
  538.  
  539. /** @defgroup FSMC_Wait_feature FSMC Wait feature
  540.   * @{
  541.   */
  542. #define FSMC_NAND_PCC_WAIT_FEATURE_DISABLE       ((uint32_t)0x00000000U)
  543. #define FSMC_NAND_PCC_WAIT_FEATURE_ENABLE        ((uint32_t)0x00000002U)
  544. /**
  545.   * @}
  546.   */
  547.  
  548. /** @defgroup FSMC_PCR_Memory_Type FSMC PCR Memory Type
  549.   * @{
  550.   */
  551. #if defined(FSMC_BANK4)
  552. #define FSMC_PCR_MEMORY_TYPE_PCCARD              ((uint32_t)0x00000000U)
  553. #endif
  554. #define FSMC_PCR_MEMORY_TYPE_NAND                ((uint32_t)0x00000008U)
  555. /**
  556.   * @}
  557.   */
  558.  
  559. /** @defgroup FSMC_NAND_Data_Width FSMC NAND Data Width
  560.   * @{
  561.   */
  562. #define FSMC_NAND_PCC_MEM_BUS_WIDTH_8                ((uint32_t)0x00000000U)
  563. #define FSMC_NAND_PCC_MEM_BUS_WIDTH_16               ((uint32_t)0x00000010U)
  564. /**
  565.   * @}
  566.   */
  567.  
  568. /** @defgroup FSMC_ECC FSMC ECC
  569.   * @{
  570.   */
  571. #define FSMC_NAND_ECC_DISABLE                    ((uint32_t)0x00000000U)
  572. #define FSMC_NAND_ECC_ENABLE                     ((uint32_t)0x00000040U)
  573. /**
  574.   * @}
  575.   */
  576.  
  577. /** @defgroup FSMC_ECC_Page_Size FSMC ECC Page Size
  578.   * @{
  579.   */
  580. #define FSMC_NAND_ECC_PAGE_SIZE_256BYTE          ((uint32_t)0x00000000U)
  581. #define FSMC_NAND_ECC_PAGE_SIZE_512BYTE          ((uint32_t)0x00020000U)
  582. #define FSMC_NAND_ECC_PAGE_SIZE_1024BYTE         ((uint32_t)0x00040000U)
  583. #define FSMC_NAND_ECC_PAGE_SIZE_2048BYTE         ((uint32_t)0x00060000U)
  584. #define FSMC_NAND_ECC_PAGE_SIZE_4096BYTE         ((uint32_t)0x00080000U)
  585. #define FSMC_NAND_ECC_PAGE_SIZE_8192BYTE         ((uint32_t)0x000A0000U)
  586. /**
  587.   * @}
  588.   */
  589.  
  590. /**
  591.   * @}
  592.   */
  593. #endif /* FSMC_BANK3 */
  594.  
  595.  
  596. /** @defgroup FSMC_LL_Interrupt_definition FSMC Low Layer Interrupt definition
  597.   * @{
  598.   */
  599. #if defined(FSMC_BANK3)||defined(FSMC_BANK4)
  600. #define FSMC_IT_RISING_EDGE                      ((uint32_t)0x00000008U)
  601. #define FSMC_IT_LEVEL                            ((uint32_t)0x00000010U)
  602. #define FSMC_IT_FALLING_EDGE                     ((uint32_t)0x00000020U)
  603. #endif /* FSMC_BANK3 */
  604. /**
  605.   * @}
  606.   */
  607.  
  608. /** @defgroup FSMC_LL_Flag_definition FSMC Low Layer Flag definition
  609.   * @{
  610.   */
  611. #if defined(FSMC_BANK3)||defined(FSMC_BANK4)
  612. #define FSMC_FLAG_RISING_EDGE                    ((uint32_t)0x00000001U)
  613. #define FSMC_FLAG_LEVEL                          ((uint32_t)0x00000002U)
  614. #define FSMC_FLAG_FALLING_EDGE                   ((uint32_t)0x00000004U)
  615. #define FSMC_FLAG_FEMPT                          ((uint32_t)0x00000040U)
  616. #endif /* FSMC_BANK3 */
  617. /**
  618.   * @}
  619.   */
  620.  
  621. /**
  622.   * @}
  623.   */
  624.  
  625. /**
  626.   * @}
  627.   */
  628.  
  629. /* Private macro -------------------------------------------------------------*/
  630. /** @defgroup FSMC_LL_Private_Macros FSMC_LL  Private Macros
  631.   * @{
  632.   */
  633. #if defined FSMC_BANK1
  634. /** @defgroup FSMC_LL_NOR_Macros FSMC NOR/SRAM Macros
  635.   * @brief macros to handle NOR device enable/disable and read/write operations
  636.   * @{
  637.   */
  638.  
  639. /**
  640.   * @brief  Enable the NORSRAM device access.
  641.   * @param  __INSTANCE__ FSMC_NORSRAM Instance
  642.   * @param  __BANK__ FSMC_NORSRAM Bank
  643.   * @retval None
  644.   */
  645. #define __FSMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__)  ((__INSTANCE__)->BTCR[(__BANK__)] |= FSMC_BCRx_MBKEN)
  646.  
  647. /**
  648.   * @brief  Disable the NORSRAM device access.
  649.   * @param  __INSTANCE__ FSMC_NORSRAM Instance
  650.   * @param  __BANK__ FSMC_NORSRAM Bank
  651.   * @retval None
  652.   */
  653. #define __FSMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)] &= ~FSMC_BCRx_MBKEN)
  654.  
  655. /**
  656.   * @}
  657.   */
  658. #endif /* FSMC_BANK1 */
  659.  
  660. #if defined(FSMC_BANK3)
  661. /** @defgroup FSMC_LL_NAND_Macros FSMC NAND Macros
  662.  *  @brief macros to handle NAND device enable/disable
  663.  *  @{
  664.  */
  665.  
  666. /**
  667.   * @brief  Enable the NAND device access.
  668.   * @param  __INSTANCE__ FSMC_NAND Instance
  669.   * @param  __BANK__     FSMC_NAND Bank
  670.   * @retval None
  671.   */
  672. #define __FSMC_NAND_ENABLE(__INSTANCE__, __BANK__)  (((__BANK__) == FSMC_NAND_BANK2)? ((__INSTANCE__)->PCR2 |= FSMC_PCRx_PBKEN): \
  673.                                                              ((__INSTANCE__)->PCR3 |= FSMC_PCRx_PBKEN))
  674.  
  675. /**
  676.   * @brief  Disable the NAND device access.
  677.   * @param  __INSTANCE__ FSMC_NAND Instance
  678.   * @param  __BANK__     FSMC_NAND Bank
  679.   * @retval None
  680.   */
  681. #define __FSMC_NAND_DISABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->PCR2, FSMC_PCRx_PBKEN): \
  682.                                                              CLEAR_BIT((__INSTANCE__)->PCR3, FSMC_PCRx_PBKEN))
  683.  
  684. /**
  685.   * @}
  686.   */
  687. #endif
  688.  
  689. #if defined(FSMC_BANK4)
  690. /** @defgroup FSMC_LL_PCCARD_Macros FMC PCCARD Macros
  691.  *  @brief macros to handle PCCARD read/write operations
  692.  *  @{
  693.  */
  694. /**
  695.   * @brief  Enable the PCCARD device access.
  696.   * @param  __INSTANCE__ FSMC_PCCARD Instance  
  697.   * @retval None
  698.   */
  699. #define __FSMC_PCCARD_ENABLE(__INSTANCE__)  ((__INSTANCE__)->PCR4 |= FSMC_PCRx_PBKEN)
  700.  
  701. /**
  702.   * @brief  Disable the PCCARD device access.
  703.   * @param  __INSTANCE__ FSMC_PCCARD Instance    
  704.   * @retval None
  705.   */
  706. #define __FSMC_PCCARD_DISABLE(__INSTANCE__) ((__INSTANCE__)->PCR4 &= ~FSMC_PCRx_PBKEN)
  707. /**
  708.   * @}
  709.   */
  710.  
  711. #endif
  712. #if defined(FSMC_BANK3)
  713. /** @defgroup FSMC_LL_NAND_Interrupt FSMC NAND Interrupt
  714.   * @brief macros to handle NAND interrupts
  715.   * @{
  716.   */
  717.  
  718. /**
  719.   * @brief  Enable the NAND device interrupt.
  720.   * @param  __INSTANCE__  FSMC_NAND instance
  721.   * @param  __BANK__     FSMC_NAND Bank
  722.   * @param  __INTERRUPT__ FSMC_NAND interrupt
  723.   *         This parameter can be any combination of the following values:
  724.   *            @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
  725.   *            @arg FSMC_IT_LEVEL: Interrupt level.
  726.   *            @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.
  727.   * @retval None
  728.   */
  729. #define __FSMC_NAND_ENABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__)  (((__BANK__) == FSMC_NAND_BANK2)? ((__INSTANCE__)->SR2 |= (__INTERRUPT__)): \
  730.                                                                                ((__INSTANCE__)->SR3 |= (__INTERRUPT__)))
  731.  
  732. /**
  733.   * @brief  Disable the NAND device interrupt.
  734.   * @param  __INSTANCE__  FSMC_NAND Instance
  735.   * @param  __BANK__     FSMC_NAND Bank
  736.   * @param  __INTERRUPT__ FSMC_NAND interrupt
  737.   *         This parameter can be any combination of the following values:
  738.   *            @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
  739.   *            @arg FSMC_IT_LEVEL: Interrupt level.
  740.   *            @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.
  741.   * @retval None
  742.   */
  743. #define __FSMC_NAND_DISABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__)  (((__BANK__) == FSMC_NAND_BANK2)? ((__INSTANCE__)->SR2 &= ~(__INTERRUPT__)): \
  744.                                                                                 ((__INSTANCE__)->SR3 &= ~(__INTERRUPT__)))
  745.  
  746. /**
  747.   * @brief  Get flag status of the NAND device.
  748.   * @param  __INSTANCE__ FSMC_NAND Instance
  749.   * @param  __BANK__     FSMC_NAND Bank
  750.   * @param  __FLAG__     FSMC_NAND flag
  751.   *         This parameter can be any combination of the following values:
  752.   *            @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  753.   *            @arg FSMC_FLAG_LEVEL: Interrupt level edge flag.
  754.   *            @arg FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  755.   *            @arg FSMC_FLAG_FEMPT: FIFO empty flag.
  756.   * @retval The state of FLAG (SET or RESET).
  757.   */
  758. #define __FSMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__)  (((__BANK__) == FSMC_NAND_BANK2)? (((__INSTANCE__)->SR2 &(__FLAG__)) == (__FLAG__)): \
  759.                                                                          (((__INSTANCE__)->SR3 &(__FLAG__)) == (__FLAG__)))
  760.  
  761. /**
  762.   * @brief  Clear flag status of the NAND device.
  763.   * @param  __INSTANCE__ FSMC_NAND Instance
  764.   * @param  __BANK__     FSMC_NAND Bank
  765.   * @param  __FLAG__     FSMC_NAND flag
  766.   *         This parameter can be any combination of the following values:
  767.   *            @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  768.   *            @arg FSMC_FLAG_LEVEL: Interrupt level edge flag.
  769.   *            @arg FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  770.   *            @arg FSMC_FLAG_FEMPT: FIFO empty flag.
  771.   * @retval None
  772.   */
  773. #define __FSMC_NAND_CLEAR_FLAG(__INSTANCE__, __BANK__, __FLAG__)  (((__BANK__) == FSMC_NAND_BANK2)? ((__INSTANCE__)->SR2 &= ~(__FLAG__)): \
  774.                                                                            ((__INSTANCE__)->SR3 &= ~(__FLAG__)))
  775.  
  776. /**
  777.   * @}
  778.   */
  779. #endif /* FSMC_BANK3 */
  780.  
  781. #if defined(FSMC_BANK4)
  782. /** @defgroup FSMC_LL_PCCARD_Interrupt FSMC PCCARD Interrupt
  783.   * @brief macros to handle PCCARD interrupts
  784.   * @{
  785.   */
  786.  
  787. /**
  788.   * @brief  Enable the PCCARD device interrupt.
  789.   * @param  __INSTANCE__ FSMC_PCCARD instance  
  790.   * @param  __INTERRUPT__ FSMC_PCCARD interrupt
  791.   *         This parameter can be any combination of the following values:
  792.   *            @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
  793.   *            @arg FSMC_IT_LEVEL: Interrupt level.
  794.   *            @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.      
  795.   * @retval None
  796.   */
  797. #define __FSMC_PCCARD_ENABLE_IT(__INSTANCE__, __INTERRUPT__)  ((__INSTANCE__)->SR4 |= (__INTERRUPT__))
  798.  
  799. /**
  800.   * @brief  Disable the PCCARD device interrupt.
  801.   * @param  __INSTANCE__ FSMC_PCCARD instance  
  802.   * @param  __INTERRUPT__ FSMC_PCCARD interrupt
  803.   *         This parameter can be any combination of the following values:
  804.   *            @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
  805.   *            @arg FSMC_IT_LEVEL: Interrupt level.
  806.   *            @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.      
  807.   * @retval None
  808.   */
  809. #define __FSMC_PCCARD_DISABLE_IT(__INSTANCE__, __INTERRUPT__)  ((__INSTANCE__)->SR4 &= ~(__INTERRUPT__))
  810.  
  811. /**
  812.   * @brief  Get flag status of the PCCARD device.
  813.   * @param  __INSTANCE__ FSMC_PCCARD instance  
  814.   * @param  __FLAG__ FSMC_PCCARD flag
  815.   *         This parameter can be any combination of the following values:
  816.   *            @arg  FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  817.   *            @arg  FSMC_FLAG_LEVEL: Interrupt level edge flag.
  818.   *            @arg  FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  819.   *            @arg  FSMC_FLAG_FEMPT: FIFO empty flag.  
  820.   * @retval The state of FLAG (SET or RESET).
  821.   */
  822. #define __FSMC_PCCARD_GET_FLAG(__INSTANCE__, __FLAG__)  (((__INSTANCE__)->SR4 &(__FLAG__)) == (__FLAG__))
  823.  
  824. /**
  825.   * @brief  Clear flag status of the PCCARD device.
  826.   * @param  __INSTANCE__ FSMC_PCCARD instance  
  827.   * @param  __FLAG__ FSMC_PCCARD flag
  828.   *         This parameter can be any combination of the following values:
  829.   *            @arg  FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
  830.   *            @arg  FSMC_FLAG_LEVEL: Interrupt level edge flag.
  831.   *            @arg  FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
  832.   *            @arg  FSMC_FLAG_FEMPT: FIFO empty flag.  
  833.   * @retval None
  834.   */
  835. #define __FSMC_PCCARD_CLEAR_FLAG(__INSTANCE__, __FLAG__)  ((__INSTANCE__)->SR4 &= ~(__FLAG__))
  836.  
  837. /**
  838.   * @}
  839.   */
  840. #endif
  841.  
  842. /**
  843.   * @}
  844.   */
  845.  
  846. /**
  847.   * @}
  848.   */
  849.  
  850. /* Private functions ---------------------------------------------------------*/
  851. /** @defgroup FSMC_LL_Private_Functions FSMC LL Private Functions
  852.   *  @{
  853.   */
  854.  
  855. #if defined FSMC_BANK1
  856. /** @defgroup FSMC_LL_NORSRAM  NOR SRAM
  857.   *  @{
  858.   */
  859. /** @defgroup FSMC_LL_NORSRAM_Private_Functions_Group1 NOR SRAM Initialization/de-initialization functions
  860.   *  @{
  861.   */
  862. HAL_StatusTypeDef  FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_InitTypeDef *Init);
  863. HAL_StatusTypeDef  FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank);
  864. HAL_StatusTypeDef  FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode);
  865. HAL_StatusTypeDef  FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank);
  866. /**
  867.   * @}
  868.   */
  869.  
  870. /** @defgroup FSMC_LL_NORSRAM_Private_Functions_Group2 NOR SRAM Control functions
  871.   *  @{
  872.   */
  873. HAL_StatusTypeDef  FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank);
  874. HAL_StatusTypeDef  FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank);
  875. /**
  876.   * @}
  877.   */
  878. /**
  879.   * @}
  880.   */
  881. #endif /* FSMC_BANK1 */
  882.  
  883. #if defined(FSMC_BANK3)
  884. /** @defgroup FSMC_LL_NAND NAND
  885.   *  @{
  886.   */
  887. /** @defgroup FSMC_LL_NAND_Private_Functions_Group1 NAND Initialization/de-initialization functions
  888.   *  @{
  889.   */
  890. HAL_StatusTypeDef  FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDef *Init);
  891. HAL_StatusTypeDef  FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
  892. HAL_StatusTypeDef  FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
  893. HAL_StatusTypeDef  FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank);
  894. /**
  895.   * @}
  896.   */
  897.  
  898. /** @defgroup FSMC_LL_NAND_Private_Functions_Group2 NAND Control functions
  899.   *  @{
  900.   */
  901. HAL_StatusTypeDef  FSMC_NAND_ECC_Enable(FSMC_NAND_TypeDef *Device, uint32_t Bank);
  902. HAL_StatusTypeDef  FSMC_NAND_ECC_Disable(FSMC_NAND_TypeDef *Device, uint32_t Bank);
  903. HAL_StatusTypeDef  FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout);
  904. /**
  905.   * @}
  906.   */
  907. /**
  908.   * @}
  909.   */
  910. #endif /* FSMC_BANK3 */
  911.  
  912. #if defined(FSMC_BANK4)
  913. /** @defgroup FSMC_LL_PCCARD PCCARD
  914.   *  @{
  915.   */
  916. /** @defgroup FSMC_LL_PCCARD_Private_Functions_Group1 PCCARD Initialization/de-initialization functions
  917.   *  @{
  918.   */
  919. HAL_StatusTypeDef  FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_InitTypeDef *Init);
  920. HAL_StatusTypeDef  FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
  921. HAL_StatusTypeDef  FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
  922. HAL_StatusTypeDef  FSMC_PCCARD_IOSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
  923. HAL_StatusTypeDef  FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device);
  924. /**
  925.   * @}
  926.   */
  927. /**
  928.   * @}
  929.   */
  930. #endif /* FSMC_BANK4 */
  931.  
  932.  
  933. /**
  934.   * @}
  935.   */
  936.  
  937. /**
  938.   * @}
  939.   */
  940.  
  941. /**
  942.   * @}
  943.   */
  944.  
  945. #ifdef __cplusplus
  946. }
  947. #endif
  948.  
  949. #endif /* STM32F1xx_LL_FSMC_H */
  950.  
  951. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  952.