Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:37

0001 /**
0002   ******************************************************************************
0003   * @file    stm32h7xx_ll_fmc.h
0004   * @author  MCD Application Team
0005   * @brief   Header file of FMC HAL module.
0006   ******************************************************************************
0007   * @attention
0008   *
0009   * Copyright (c) 2017 STMicroelectronics.
0010   * All rights reserved.
0011   *
0012   * This software is licensed under terms that can be found in the LICENSE file
0013   * in the root directory of this software component.
0014   * If no LICENSE file comes with this software, it is provided AS-IS.
0015   *
0016   ******************************************************************************
0017   */
0018 
0019 /* Define to prevent recursive inclusion -------------------------------------*/
0020 #ifndef STM32H7xx_LL_FMC_H
0021 #define STM32H7xx_LL_FMC_H
0022 
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026 
0027 /* Includes ------------------------------------------------------------------*/
0028 #include "stm32h7xx_hal_def.h"
0029 
0030 /** @addtogroup STM32H7xx_HAL_Driver
0031   * @{
0032   */
0033 
0034 /** @addtogroup FMC_LL
0035   * @{
0036   */
0037 
0038 /** @addtogroup FMC_LL_Private_Macros
0039   * @{
0040   */
0041 
0042 #define IS_FMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FMC_NORSRAM_BANK1) || \
0043                                        ((__BANK__) == FMC_NORSRAM_BANK2) || \
0044                                        ((__BANK__) == FMC_NORSRAM_BANK3) || \
0045                                        ((__BANK__) == FMC_NORSRAM_BANK4))
0046 #define IS_FMC_MUX(__MUX__) (((__MUX__) == FMC_DATA_ADDRESS_MUX_DISABLE) || \
0047                              ((__MUX__) == FMC_DATA_ADDRESS_MUX_ENABLE))
0048 #define IS_FMC_MEMORY(__MEMORY__) (((__MEMORY__) == FMC_MEMORY_TYPE_SRAM) || \
0049                                    ((__MEMORY__) == FMC_MEMORY_TYPE_PSRAM)|| \
0050                                    ((__MEMORY__) == FMC_MEMORY_TYPE_NOR))
0051 #define IS_FMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_8)  || \
0052                                                 ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_16) || \
0053                                                 ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_32))
0054 #define IS_FMC_PAGESIZE(__SIZE__) (((__SIZE__) == FMC_PAGE_SIZE_NONE) || \
0055                                    ((__SIZE__) == FMC_PAGE_SIZE_128) || \
0056                                    ((__SIZE__) == FMC_PAGE_SIZE_256) || \
0057                                    ((__SIZE__) == FMC_PAGE_SIZE_512) || \
0058                                    ((__SIZE__) == FMC_PAGE_SIZE_1024))
0059 #define IS_FMC_WRITE_FIFO(__FIFO__) (((__FIFO__) == FMC_WRITE_FIFO_DISABLE) || \
0060                                      ((__FIFO__) == FMC_WRITE_FIFO_ENABLE))
0061 #define IS_FMC_ACCESS_MODE(__MODE__) (((__MODE__) == FMC_ACCESS_MODE_A) || \
0062                                       ((__MODE__) == FMC_ACCESS_MODE_B) || \
0063                                       ((__MODE__) == FMC_ACCESS_MODE_C) || \
0064                                       ((__MODE__) == FMC_ACCESS_MODE_D))
0065 #define IS_FMC_BURSTMODE(__STATE__) (((__STATE__) == FMC_BURST_ACCESS_MODE_DISABLE) || \
0066                                      ((__STATE__) == FMC_BURST_ACCESS_MODE_ENABLE))
0067 #define IS_FMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_LOW) || \
0068                                             ((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_HIGH))
0069 #define IS_FMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FMC_WAIT_TIMING_BEFORE_WS) || \
0070                                                ((__ACTIVE__) == FMC_WAIT_TIMING_DURING_WS))
0071 #define IS_FMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FMC_WRITE_OPERATION_DISABLE) || \
0072                                                ((__OPERATION__) == FMC_WRITE_OPERATION_ENABLE))
0073 #define IS_FMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FMC_WAIT_SIGNAL_DISABLE) || \
0074                                          ((__SIGNAL__) == FMC_WAIT_SIGNAL_ENABLE))
0075 #define IS_FMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FMC_EXTENDED_MODE_DISABLE) || \
0076                                         ((__MODE__) == FMC_EXTENDED_MODE_ENABLE))
0077 #define IS_FMC_ASYNWAIT(__STATE__) (((__STATE__) == FMC_ASYNCHRONOUS_WAIT_DISABLE) || \
0078                                     ((__STATE__) == FMC_ASYNCHRONOUS_WAIT_ENABLE))
0079 #define IS_FMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1U) && ((__LATENCY__) <= 17U))
0080 #define IS_FMC_WRITE_BURST(__BURST__) (((__BURST__) == FMC_WRITE_BURST_DISABLE) || \
0081                                        ((__BURST__) == FMC_WRITE_BURST_ENABLE))
0082 #define IS_FMC_CONTINOUS_CLOCK(__CCLOCK__) (((__CCLOCK__) == FMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \
0083                                             ((__CCLOCK__) == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC))
0084 #define IS_FMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15U)
0085 #define IS_FMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 15U))
0086 #define IS_FMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 255U))
0087 #define IS_FMC_DATAHOLD_DURATION(__DATAHOLD__) ((__DATAHOLD__) <= 3U)
0088 #define IS_FMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15U)
0089 #define IS_FMC_CLK_DIV(__DIV__) (((__DIV__) > 1U) && ((__DIV__) <= 16U))
0090 #define IS_FMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_DEVICE)
0091 #define IS_FMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_EXTENDED_DEVICE)
0092 
0093 
0094 #define IS_FMC_NAND_BANK(__BANK__) ((__BANK__) == FMC_NAND_BANK3)
0095 #define IS_FMC_WAIT_FEATURE(__FEATURE__) (((__FEATURE__) == FMC_NAND_WAIT_FEATURE_DISABLE) || \
0096                                           ((__FEATURE__) == FMC_NAND_WAIT_FEATURE_ENABLE))
0097 #define IS_FMC_NAND_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NAND_MEM_BUS_WIDTH_8) || \
0098                                              ((__WIDTH__) == FMC_NAND_MEM_BUS_WIDTH_16))
0099 #define IS_FMC_ECC_STATE(__STATE__) (((__STATE__) == FMC_NAND_ECC_DISABLE) || \
0100                                      ((__STATE__) == FMC_NAND_ECC_ENABLE))
0101 
0102 #define IS_FMC_ECCPAGE_SIZE(__SIZE__) (((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_256BYTE)  || \
0103                                        ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_512BYTE)  || \
0104                                        ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \
0105                                        ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \
0106                                        ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \
0107                                        ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_8192BYTE))
0108 #define IS_FMC_TCLR_TIME(__TIME__) ((__TIME__) <= 255U)
0109 #define IS_FMC_TAR_TIME(__TIME__) ((__TIME__) <= 255U)
0110 #define IS_FMC_SETUP_TIME(__TIME__) ((__TIME__) <= 254U)
0111 #define IS_FMC_WAIT_TIME(__TIME__) ((__TIME__) <= 254U)
0112 #define IS_FMC_HOLD_TIME(__TIME__) ((__TIME__) <= 254U)
0113 #define IS_FMC_HIZ_TIME(__TIME__) ((__TIME__) <= 254U)
0114 #define IS_FMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NAND_DEVICE)
0115 
0116 
0117 #define IS_FMC_SDMEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_SDRAM_MEM_BUS_WIDTH_8)  || \
0118                                           ((__WIDTH__) == FMC_SDRAM_MEM_BUS_WIDTH_16) || \
0119                                           ((__WIDTH__) == FMC_SDRAM_MEM_BUS_WIDTH_32))
0120 #define IS_FMC_WRITE_PROTECTION(__WRITE__) (((__WRITE__) == FMC_SDRAM_WRITE_PROTECTION_DISABLE) || \
0121                                             ((__WRITE__) == FMC_SDRAM_WRITE_PROTECTION_ENABLE))
0122 #define IS_FMC_SDCLOCK_PERIOD(__PERIOD__) (((__PERIOD__) == FMC_SDRAM_CLOCK_DISABLE)  || \
0123                                            ((__PERIOD__) == FMC_SDRAM_CLOCK_PERIOD_2) || \
0124                                            ((__PERIOD__) == FMC_SDRAM_CLOCK_PERIOD_3))
0125 #define IS_FMC_READ_BURST(__RBURST__) (((__RBURST__) == FMC_SDRAM_RBURST_DISABLE) || \
0126                                        ((__RBURST__) == FMC_SDRAM_RBURST_ENABLE))
0127 #define IS_FMC_READPIPE_DELAY(__DELAY__) (((__DELAY__) == FMC_SDRAM_RPIPE_DELAY_0) || \
0128                                           ((__DELAY__) == FMC_SDRAM_RPIPE_DELAY_1) || \
0129                                           ((__DELAY__) == FMC_SDRAM_RPIPE_DELAY_2))
0130 #define IS_FMC_COMMAND_MODE(__COMMAND__) (((__COMMAND__) == FMC_SDRAM_CMD_NORMAL_MODE)      || \
0131                                           ((__COMMAND__) == FMC_SDRAM_CMD_CLK_ENABLE)       || \
0132                                           ((__COMMAND__) == FMC_SDRAM_CMD_PALL)             || \
0133                                           ((__COMMAND__) == FMC_SDRAM_CMD_AUTOREFRESH_MODE) || \
0134                                           ((__COMMAND__) == FMC_SDRAM_CMD_LOAD_MODE)        || \
0135                                           ((__COMMAND__) == FMC_SDRAM_CMD_SELFREFRESH_MODE) || \
0136                                           ((__COMMAND__) == FMC_SDRAM_CMD_POWERDOWN_MODE))
0137 #define IS_FMC_COMMAND_TARGET(__TARGET__) (((__TARGET__) == FMC_SDRAM_CMD_TARGET_BANK1) || \
0138                                            ((__TARGET__) == FMC_SDRAM_CMD_TARGET_BANK2) || \
0139                                            ((__TARGET__) == FMC_SDRAM_CMD_TARGET_BANK1_2))
0140 #define IS_FMC_LOADTOACTIVE_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
0141 #define IS_FMC_EXITSELFREFRESH_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
0142 #define IS_FMC_SELFREFRESH_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 16U))
0143 #define IS_FMC_ROWCYCLE_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
0144 #define IS_FMC_WRITE_RECOVERY_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 16U))
0145 #define IS_FMC_RP_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
0146 #define IS_FMC_RCD_DELAY(__DELAY__) (((__DELAY__) > 0U) && ((__DELAY__) <= 16U))
0147 #define IS_FMC_AUTOREFRESH_NUMBER(__NUMBER__) (((__NUMBER__) > 0U) && ((__NUMBER__) <= 15U))
0148 #define IS_FMC_MODE_REGISTER(__CONTENT__) ((__CONTENT__) <= 8191U)
0149 #define IS_FMC_REFRESH_RATE(__RATE__) ((__RATE__) <= 8191U)
0150 #define IS_FMC_SDRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_SDRAM_DEVICE)
0151 #define IS_FMC_SDRAM_BANK(__BANK__) (((__BANK__) == FMC_SDRAM_BANK1) || \
0152                                      ((__BANK__) == FMC_SDRAM_BANK2))
0153 #define IS_FMC_COLUMNBITS_NUMBER(__COLUMN__) (((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_8)  || \
0154                                               ((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_9)  || \
0155                                               ((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_10) || \
0156                                               ((__COLUMN__) == FMC_SDRAM_COLUMN_BITS_NUM_11))
0157 #define IS_FMC_ROWBITS_NUMBER(__ROW__) (((__ROW__) == FMC_SDRAM_ROW_BITS_NUM_11) || \
0158                                         ((__ROW__) == FMC_SDRAM_ROW_BITS_NUM_12) || \
0159                                         ((__ROW__) == FMC_SDRAM_ROW_BITS_NUM_13))
0160 #define IS_FMC_INTERNALBANK_NUMBER(__NUMBER__) (((__NUMBER__) == FMC_SDRAM_INTERN_BANKS_NUM_2) || \
0161                                                 ((__NUMBER__) == FMC_SDRAM_INTERN_BANKS_NUM_4))
0162 #define IS_FMC_CAS_LATENCY(__LATENCY__) (((__LATENCY__) == FMC_SDRAM_CAS_LATENCY_1) || \
0163                                          ((__LATENCY__) == FMC_SDRAM_CAS_LATENCY_2) || \
0164                                          ((__LATENCY__) == FMC_SDRAM_CAS_LATENCY_3))
0165 
0166 
0167 /**
0168   * @}
0169   */
0170 
0171 /* Exported typedef ----------------------------------------------------------*/
0172 
0173 /** @defgroup FMC_LL_Exported_typedef FMC Low Layer Exported Types
0174   * @ingroup RTEMSBSPsARMSTM32H7
0175   * @{
0176   */
0177 
0178 #define FMC_NORSRAM_TypeDef            FMC_Bank1_TypeDef
0179 #define FMC_NORSRAM_EXTENDED_TypeDef   FMC_Bank1E_TypeDef
0180 #define FMC_NAND_TypeDef               FMC_Bank3_TypeDef
0181 #define FMC_SDRAM_TypeDef              FMC_Bank5_6_TypeDef
0182 
0183 #define FMC_NORSRAM_DEVICE             FMC_Bank1_R
0184 #define FMC_NORSRAM_EXTENDED_DEVICE    FMC_Bank1E_R
0185 #define FMC_NAND_DEVICE                FMC_Bank3_R
0186 #define FMC_SDRAM_DEVICE               FMC_Bank5_6_R
0187 
0188 /**
0189   * @brief  FMC NORSRAM Configuration Structure definition
0190   */
0191 typedef struct
0192 {
0193   uint32_t NSBank;                       /*!< Specifies the NORSRAM memory device that will be used.
0194                                               This parameter can be a value of @ref FMC_NORSRAM_Bank                  */
0195 
0196   uint32_t DataAddressMux;               /*!< Specifies whether the address and data values are
0197                                               multiplexed on the data bus or not.
0198                                               This parameter can be a value of @ref FMC_Data_Address_Bus_Multiplexing */
0199 
0200   uint32_t MemoryType;                   /*!< Specifies the type of external memory attached to
0201                                               the corresponding memory device.
0202                                               This parameter can be a value of @ref FMC_Memory_Type                   */
0203 
0204   uint32_t MemoryDataWidth;              /*!< Specifies the external memory device width.
0205                                               This parameter can be a value of @ref FMC_NORSRAM_Data_Width            */
0206 
0207   uint32_t BurstAccessMode;              /*!< Enables or disables the burst access mode for Flash memory,
0208                                               valid only with synchronous burst Flash memories.
0209                                               This parameter can be a value of @ref FMC_Burst_Access_Mode             */
0210 
0211   uint32_t WaitSignalPolarity;           /*!< Specifies the wait signal polarity, valid only when accessing
0212                                               the Flash memory in burst mode.
0213                                               This parameter can be a value of @ref FMC_Wait_Signal_Polarity          */
0214 
0215   uint32_t WaitSignalActive;             /*!< Specifies if the wait signal is asserted by the memory one
0216                                               clock cycle before the wait state or during the wait state,
0217                                               valid only when accessing memories in burst mode.
0218                                               This parameter can be a value of @ref FMC_Wait_Timing                   */
0219 
0220   uint32_t WriteOperation;               /*!< Enables or disables the write operation in the selected device by the FMC.
0221                                               This parameter can be a value of @ref FMC_Write_Operation               */
0222 
0223   uint32_t WaitSignal;                   /*!< Enables or disables the wait state insertion via wait
0224                                               signal, valid for Flash memory access in burst mode.
0225                                               This parameter can be a value of @ref FMC_Wait_Signal                   */
0226 
0227   uint32_t ExtendedMode;                 /*!< Enables or disables the extended mode.
0228                                               This parameter can be a value of @ref FMC_Extended_Mode                 */
0229 
0230   uint32_t AsynchronousWait;             /*!< Enables or disables wait signal during asynchronous transfers,
0231                                               valid only with asynchronous Flash memories.
0232                                               This parameter can be a value of @ref FMC_AsynchronousWait              */
0233 
0234   uint32_t WriteBurst;                   /*!< Enables or disables the write burst operation.
0235                                               This parameter can be a value of @ref FMC_Write_Burst                   */
0236 
0237   uint32_t ContinuousClock;              /*!< Enables or disables the FMC clock output to external memory devices.
0238                                               This parameter is only enabled through the FMC_BCR1 register,
0239                                               and don't care through FMC_BCR2..4 registers.
0240                                               This parameter can be a value of @ref FMC_Continous_Clock               */
0241 
0242   uint32_t WriteFifo;                    /*!< Enables or disables the write FIFO used by the FMC controller.
0243                                               This parameter is only enabled through the FMC_BCR1 register,
0244                                               and don't care through FMC_BCR2..4 registers.
0245                                               This parameter can be a value of @ref FMC_Write_FIFO                    */
0246 
0247   uint32_t PageSize;                     /*!< Specifies the memory page size.
0248                                               This parameter can be a value of @ref FMC_Page_Size                     */
0249 } FMC_NORSRAM_InitTypeDef;
0250 
0251 /**
0252   * @brief  FMC NORSRAM Timing parameters structure definition
0253   */
0254 typedef struct
0255 {
0256   uint32_t AddressSetupTime;             /*!< Defines the number of HCLK cycles to configure
0257                                               the duration of the address setup time.
0258                                               This parameter can be a value between Min_Data = 0 and Max_Data = 15.
0259                                               @note This parameter is not used with synchronous NOR Flash memories.   */
0260 
0261   uint32_t AddressHoldTime;              /*!< Defines the number of HCLK cycles to configure
0262                                               the duration of the address hold time.
0263                                               This parameter can be a value between Min_Data = 1 and Max_Data = 15.
0264                                               @note This parameter is not used with synchronous NOR Flash memories.   */
0265 
0266   uint32_t DataSetupTime;                /*!< Defines the number of HCLK cycles to configure
0267                                               the duration of the data setup time.
0268                                               This parameter can be a value between Min_Data = 1 and Max_Data = 255.
0269                                               @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed
0270                                               NOR Flash memories.                                                     */
0271 
0272   uint32_t BusTurnAroundDuration;        /*!< Defines the number of HCLK cycles to configure
0273                                               the duration of the bus turnaround.
0274                                               This parameter can be a value between Min_Data = 0 and Max_Data = 15.
0275                                               @note This parameter is only used for multiplexed NOR Flash memories.   */
0276 
0277   uint32_t CLKDivision;                  /*!< Defines the period of CLK clock output signal, expressed in number of
0278                                               HCLK cycles. This parameter can be a value between Min_Data = 2 and
0279                                               Max_Data = 16.
0280                                               @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM
0281                                               accesses.                                                               */
0282 
0283   uint32_t DataLatency;                  /*!< Defines the number of memory clock cycles to issue
0284                                               to the memory before getting the first data.
0285                                               The parameter value depends on the memory type as shown below:
0286                                               - It must be set to 0 in case of a CRAM
0287                                               - It is don't care in asynchronous NOR, SRAM or ROM accesses
0288                                               - It may assume a value between Min_Data = 2 and Max_Data = 17
0289                                                 in NOR Flash memories with synchronous burst mode enable              */
0290 
0291   uint32_t AccessMode;                   /*!< Specifies the asynchronous access mode.
0292                                               This parameter can be a value of @ref FMC_Access_Mode                   */
0293 } FMC_NORSRAM_TimingTypeDef;
0294 
0295 /**
0296   * @brief  FMC NAND Configuration Structure definition
0297   */
0298 typedef struct
0299 {
0300   uint32_t NandBank;               /*!< Specifies the NAND memory device that will be used.
0301                                         This parameter can be a value of @ref FMC_NAND_Bank                  */
0302 
0303   uint32_t Waitfeature;            /*!< Enables or disables the Wait feature for the NAND Memory device.
0304                                         This parameter can be any value of @ref FMC_Wait_feature             */
0305 
0306   uint32_t MemoryDataWidth;        /*!< Specifies the external memory device width.
0307                                         This parameter can be any value of @ref FMC_NAND_Data_Width          */
0308 
0309   uint32_t EccComputation;         /*!< Enables or disables the ECC computation.
0310                                         This parameter can be any value of @ref FMC_ECC                      */
0311 
0312   uint32_t ECCPageSize;            /*!< Defines the page size for the extended ECC.
0313                                         This parameter can be any value of @ref FMC_ECC_Page_Size            */
0314 
0315   uint32_t TCLRSetupTime;          /*!< Defines the number of HCLK cycles to configure the
0316                                         delay between CLE low and RE low.
0317                                         This parameter can be a value between Min_Data = 0 and Max_Data = 255  */
0318 
0319   uint32_t TARSetupTime;           /*!< Defines the number of HCLK cycles to configure the
0320                                         delay between ALE low and RE low.
0321                                         This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
0322 } FMC_NAND_InitTypeDef;
0323 
0324 /**
0325   * @brief  FMC NAND Timing parameters structure definition
0326   */
0327 typedef struct
0328 {
0329   uint32_t SetupTime;            /*!< Defines the number of HCLK cycles to setup address before
0330                                       the command assertion for NAND-Flash read or write access
0331                                       to common/Attribute or I/O memory space (depending on
0332                                       the memory space timing to be configured).
0333                                       This parameter can be a value between Min_Data = 0 and Max_Data = 254    */
0334 
0335   uint32_t WaitSetupTime;        /*!< Defines the minimum number of HCLK cycles to assert the
0336                                       command for NAND-Flash read or write access to
0337                                       common/Attribute or I/O memory space (depending on the
0338                                       memory space timing to be configured).
0339                                       This parameter can be a number between Min_Data = 0 and Max_Data = 254   */
0340 
0341   uint32_t HoldSetupTime;        /*!< Defines the number of HCLK clock cycles to hold address
0342                                       (and data for write access) after the command de-assertion
0343                                       for NAND-Flash read or write access to common/Attribute
0344                                       or I/O memory space (depending on the memory space timing
0345                                       to be configured).
0346                                       This parameter can be a number between Min_Data = 0 and Max_Data = 254   */
0347 
0348   uint32_t HiZSetupTime;         /*!< Defines the number of HCLK clock cycles during which the
0349                                       data bus is kept in HiZ after the start of a NAND-Flash
0350                                       write access to common/Attribute or I/O memory space (depending
0351                                       on the memory space timing to be configured).
0352                                       This parameter can be a number between Min_Data = 0 and Max_Data = 254   */
0353 } FMC_NAND_PCC_TimingTypeDef;
0354 
0355 
0356 /**
0357   * @brief  FMC SDRAM Configuration Structure definition
0358   */
0359 typedef struct
0360 {
0361   uint32_t SDBank;                      /*!< Specifies the SDRAM memory device that will be used.
0362                                              This parameter can be a value of @ref FMC_SDRAM_Bank                */
0363 
0364   uint32_t ColumnBitsNumber;            /*!< Defines the number of bits of column address.
0365                                              This parameter can be a value of @ref FMC_SDRAM_Column_Bits_number. */
0366 
0367   uint32_t RowBitsNumber;               /*!< Defines the number of bits of column address.
0368                                              This parameter can be a value of @ref FMC_SDRAM_Row_Bits_number.    */
0369 
0370   uint32_t MemoryDataWidth;             /*!< Defines the memory device width.
0371                                              This parameter can be a value of @ref FMC_SDRAM_Memory_Bus_Width.   */
0372 
0373   uint32_t InternalBankNumber;          /*!< Defines the number of the device's internal banks.
0374                                              This parameter can be of @ref FMC_SDRAM_Internal_Banks_Number.      */
0375 
0376   uint32_t CASLatency;                  /*!< Defines the SDRAM CAS latency in number of memory clock cycles.
0377                                              This parameter can be a value of @ref FMC_SDRAM_CAS_Latency.        */
0378 
0379   uint32_t WriteProtection;             /*!< Enables the SDRAM device to be accessed in write mode.
0380                                              This parameter can be a value of @ref FMC_SDRAM_Write_Protection.   */
0381 
0382   uint32_t SDClockPeriod;               /*!< Define the SDRAM Clock Period for both SDRAM devices and they allow
0383                                              to disable the clock before changing frequency.
0384                                              This parameter can be a value of @ref FMC_SDRAM_Clock_Period.       */
0385 
0386   uint32_t ReadBurst;                   /*!< This bit enable the SDRAM controller to anticipate the next read
0387                                              commands during the CAS latency and stores data in the Read FIFO.
0388                                              This parameter can be a value of @ref FMC_SDRAM_Read_Burst.         */
0389 
0390   uint32_t ReadPipeDelay;               /*!< Define the delay in system clock cycles on read data path.
0391                                              This parameter can be a value of @ref FMC_SDRAM_Read_Pipe_Delay.    */
0392 } FMC_SDRAM_InitTypeDef;
0393 
0394 /**
0395   * @brief FMC SDRAM Timing parameters structure definition
0396   */
0397 typedef struct
0398 {
0399   uint32_t LoadToActiveDelay;            /*!< Defines the delay between a Load Mode Register command and
0400                                               an active or Refresh command in number of memory clock cycles.
0401                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0402 
0403   uint32_t ExitSelfRefreshDelay;         /*!< Defines the delay from releasing the self refresh command to
0404                                               issuing the Activate command in number of memory clock cycles.
0405                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0406 
0407   uint32_t SelfRefreshTime;              /*!< Defines the minimum Self Refresh period in number of memory clock
0408                                               cycles.
0409                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0410 
0411   uint32_t RowCycleDelay;                /*!< Defines the delay between the Refresh command and the Activate command
0412                                               and the delay between two consecutive Refresh commands in number of
0413                                               memory clock cycles.
0414                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0415 
0416   uint32_t WriteRecoveryTime;            /*!< Defines the Write recovery Time in number of memory clock cycles.
0417                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0418 
0419   uint32_t RPDelay;                      /*!< Defines the delay between a Precharge Command and an other command
0420                                               in number of memory clock cycles.
0421                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0422 
0423   uint32_t RCDDelay;                     /*!< Defines the delay between the Activate Command and a Read/Write
0424                                               command in number of memory clock cycles.
0425                                               This parameter can be a value between Min_Data = 1 and Max_Data = 16  */
0426 } FMC_SDRAM_TimingTypeDef;
0427 
0428 /**
0429   * @brief SDRAM command parameters structure definition
0430   */
0431 typedef struct
0432 {
0433   uint32_t CommandMode;                  /*!< Defines the command issued to the SDRAM device.
0434                                               This parameter can be a value of @ref FMC_SDRAM_Command_Mode.          */
0435 
0436   uint32_t CommandTarget;                /*!< Defines which device (1 or 2) the command will be issued to.
0437                                               This parameter can be a value of @ref FMC_SDRAM_Command_Target.        */
0438 
0439   uint32_t AutoRefreshNumber;            /*!< Defines the number of consecutive auto refresh command issued
0440                                               in auto refresh mode.
0441                                               This parameter can be a value between Min_Data = 1 and Max_Data = 15   */
0442 
0443   uint32_t ModeRegisterDefinition;       /*!< Defines the SDRAM Mode register content                                */
0444 } FMC_SDRAM_CommandTypeDef;
0445 /**
0446   * @}
0447   */
0448 
0449 /* Exported constants --------------------------------------------------------*/
0450 /** @addtogroup FMC_LL_Exported_Constants FMC Low Layer Exported Constants
0451   * @{
0452   */
0453 
0454 /** @defgroup FMC_LL_NOR_SRAM_Controller FMC NOR/SRAM Controller
0455   * @ingroup RTEMSBSPsARMSTM32H7
0456   * @{
0457   */
0458 
0459 /** @defgroup FMC_NORSRAM_Bank FMC NOR/SRAM Bank
0460   * @ingroup RTEMSBSPsARMSTM32H7
0461   * @{
0462   */
0463 #define FMC_NORSRAM_BANK1                       (0x00000000U)
0464 #define FMC_NORSRAM_BANK2                       (0x00000002U)
0465 #define FMC_NORSRAM_BANK3                       (0x00000004U)
0466 #define FMC_NORSRAM_BANK4                       (0x00000006U)
0467 /**
0468   * @}
0469   */
0470 
0471 /** @defgroup FMC_Data_Address_Bus_Multiplexing FMC Data Address Bus Multiplexing
0472   * @ingroup RTEMSBSPsARMSTM32H7
0473   * @{
0474   */
0475 #define FMC_DATA_ADDRESS_MUX_DISABLE            (0x00000000U)
0476 #define FMC_DATA_ADDRESS_MUX_ENABLE             (0x00000002U)
0477 /**
0478   * @}
0479   */
0480 
0481 /** @defgroup FMC_Memory_Type FMC Memory Type
0482   * @ingroup RTEMSBSPsARMSTM32H7
0483   * @{
0484   */
0485 #define FMC_MEMORY_TYPE_SRAM                    (0x00000000U)
0486 #define FMC_MEMORY_TYPE_PSRAM                   (0x00000004U)
0487 #define FMC_MEMORY_TYPE_NOR                     (0x00000008U)
0488 /**
0489   * @}
0490   */
0491 
0492 /** @defgroup FMC_NORSRAM_Data_Width FMC NORSRAM Data Width
0493   * @ingroup RTEMSBSPsARMSTM32H7
0494   * @{
0495   */
0496 #define FMC_NORSRAM_MEM_BUS_WIDTH_8             (0x00000000U)
0497 #define FMC_NORSRAM_MEM_BUS_WIDTH_16            (0x00000010U)
0498 #define FMC_NORSRAM_MEM_BUS_WIDTH_32            (0x00000020U)
0499 /**
0500   * @}
0501   */
0502 
0503 /** @defgroup FMC_NORSRAM_Flash_Access FMC NOR/SRAM Flash Access
0504   * @ingroup RTEMSBSPsARMSTM32H7
0505   * @{
0506   */
0507 #define FMC_NORSRAM_FLASH_ACCESS_ENABLE         (0x00000040U)
0508 #define FMC_NORSRAM_FLASH_ACCESS_DISABLE        (0x00000000U)
0509 /**
0510   * @}
0511   */
0512 
0513 /** @defgroup FMC_Burst_Access_Mode FMC Burst Access Mode
0514   * @ingroup RTEMSBSPsARMSTM32H7
0515   * @{
0516   */
0517 #define FMC_BURST_ACCESS_MODE_DISABLE           (0x00000000U)
0518 #define FMC_BURST_ACCESS_MODE_ENABLE            (0x00000100U)
0519 /**
0520   * @}
0521   */
0522 
0523 /** @defgroup FMC_Wait_Signal_Polarity FMC Wait Signal Polarity
0524   * @ingroup RTEMSBSPsARMSTM32H7
0525   * @{
0526   */
0527 #define FMC_WAIT_SIGNAL_POLARITY_LOW            (0x00000000U)
0528 #define FMC_WAIT_SIGNAL_POLARITY_HIGH           (0x00000200U)
0529 /**
0530   * @}
0531   */
0532 
0533 /** @defgroup FMC_Wait_Timing FMC Wait Timing
0534   * @ingroup RTEMSBSPsARMSTM32H7
0535   * @{
0536   */
0537 #define FMC_WAIT_TIMING_BEFORE_WS               (0x00000000U)
0538 #define FMC_WAIT_TIMING_DURING_WS               (0x00000800U)
0539 /**
0540   * @}
0541   */
0542 
0543 /** @defgroup FMC_Write_Operation FMC Write Operation
0544   * @ingroup RTEMSBSPsARMSTM32H7
0545   * @{
0546   */
0547 #define FMC_WRITE_OPERATION_DISABLE             (0x00000000U)
0548 #define FMC_WRITE_OPERATION_ENABLE              (0x00001000U)
0549 /**
0550   * @}
0551   */
0552 
0553 /** @defgroup FMC_Wait_Signal FMC Wait Signal
0554   * @ingroup RTEMSBSPsARMSTM32H7
0555   * @{
0556   */
0557 #define FMC_WAIT_SIGNAL_DISABLE                 (0x00000000U)
0558 #define FMC_WAIT_SIGNAL_ENABLE                  (0x00002000U)
0559 /**
0560   * @}
0561   */
0562 
0563 /** @defgroup FMC_Extended_Mode FMC Extended Mode
0564   * @ingroup RTEMSBSPsARMSTM32H7
0565   * @{
0566   */
0567 #define FMC_EXTENDED_MODE_DISABLE               (0x00000000U)
0568 #define FMC_EXTENDED_MODE_ENABLE                (0x00004000U)
0569 /**
0570   * @}
0571   */
0572 
0573 /** @defgroup FMC_AsynchronousWait FMC Asynchronous Wait
0574   * @ingroup RTEMSBSPsARMSTM32H7
0575   * @{
0576   */
0577 #define FMC_ASYNCHRONOUS_WAIT_DISABLE           (0x00000000U)
0578 #define FMC_ASYNCHRONOUS_WAIT_ENABLE            (0x00008000U)
0579 /**
0580   * @}
0581   */
0582 
0583 /** @defgroup FMC_Page_Size FMC Page Size
0584   * @ingroup RTEMSBSPsARMSTM32H7
0585   * @{
0586   */
0587 #define FMC_PAGE_SIZE_NONE                      (0x00000000U)
0588 #define FMC_PAGE_SIZE_128                       FMC_BCRx_CPSIZE_0
0589 #define FMC_PAGE_SIZE_256                       FMC_BCRx_CPSIZE_1
0590 #define FMC_PAGE_SIZE_512                       (FMC_BCRx_CPSIZE_0\
0591                                                  | FMC_BCRx_CPSIZE_1)
0592 #define FMC_PAGE_SIZE_1024                      FMC_BCRx_CPSIZE_2
0593 /**
0594   * @}
0595   */
0596 
0597 /** @defgroup FMC_Write_Burst FMC Write Burst
0598   * @ingroup RTEMSBSPsARMSTM32H7
0599   * @{
0600   */
0601 #define FMC_WRITE_BURST_DISABLE                 (0x00000000U)
0602 #define FMC_WRITE_BURST_ENABLE                  (0x00080000U)
0603 /**
0604   * @}
0605   */
0606 
0607 /** @defgroup FMC_Continous_Clock FMC Continuous Clock
0608   * @ingroup RTEMSBSPsARMSTM32H7
0609   * @{
0610   */
0611 #define FMC_CONTINUOUS_CLOCK_SYNC_ONLY          (0x00000000U)
0612 #define FMC_CONTINUOUS_CLOCK_SYNC_ASYNC         (0x00100000U)
0613 /**
0614   * @}
0615   */
0616 
0617 #if defined(FMC_BCR1_WFDIS)
0618 /** @defgroup FMC_Write_FIFO FMC Write FIFO
0619   * @ingroup RTEMSBSPsARMSTM32H7
0620   * @{
0621   */
0622 #define FMC_WRITE_FIFO_DISABLE                  FMC_BCR1_WFDIS
0623 #define FMC_WRITE_FIFO_ENABLE                   (0x00000000U)
0624 #endif /* FMC_BCR1_WFDIS */
0625 /**
0626   * @}
0627   */
0628 
0629 /** @defgroup FMC_Access_Mode FMC Access Mode
0630   * @ingroup RTEMSBSPsARMSTM32H7
0631   * @{
0632   */
0633 #define FMC_ACCESS_MODE_A                       (0x00000000U)
0634 #define FMC_ACCESS_MODE_B                       (0x10000000U)
0635 #define FMC_ACCESS_MODE_C                       (0x20000000U)
0636 #define FMC_ACCESS_MODE_D                       (0x30000000U)
0637 /**
0638   * @}
0639   */
0640 
0641 /**
0642   * @}
0643   */
0644 
0645 
0646 /** @defgroup FMC_LL_NAND_Controller FMC NAND Controller
0647   * @ingroup RTEMSBSPsARMSTM32H7
0648   * @{
0649   */
0650 /** @defgroup FMC_NAND_Bank FMC NAND Bank
0651   * @ingroup RTEMSBSPsARMSTM32H7
0652   * @{
0653   */
0654 #define FMC_NAND_BANK3                          (0x00000100U)
0655 /**
0656   * @}
0657   */
0658 
0659 /** @defgroup FMC_Wait_feature FMC Wait feature
0660   * @ingroup RTEMSBSPsARMSTM32H7
0661   * @{
0662   */
0663 #define FMC_NAND_WAIT_FEATURE_DISABLE           (0x00000000U)
0664 #define FMC_NAND_WAIT_FEATURE_ENABLE            (0x00000002U)
0665 /**
0666   * @}
0667   */
0668 
0669 /** @defgroup FMC_PCR_Memory_Type FMC PCR Memory Type
0670   * @ingroup RTEMSBSPsARMSTM32H7
0671   * @{
0672   */
0673 #define FMC_PCR_MEMORY_TYPE_NAND                (0x00000008U)
0674 /**
0675   * @}
0676   */
0677 
0678 /** @defgroup FMC_NAND_Data_Width FMC NAND Data Width
0679   * @ingroup RTEMSBSPsARMSTM32H7
0680   * @{
0681   */
0682 #define FMC_NAND_MEM_BUS_WIDTH_8                (0x00000000U)
0683 #define FMC_NAND_MEM_BUS_WIDTH_16               (0x00000010U)
0684 /**
0685   * @}
0686   */
0687 
0688 /** @defgroup FMC_ECC FMC ECC
0689   * @ingroup RTEMSBSPsARMSTM32H7
0690   * @{
0691   */
0692 #define FMC_NAND_ECC_DISABLE                    (0x00000000U)
0693 #define FMC_NAND_ECC_ENABLE                     (0x00000040U)
0694 /**
0695   * @}
0696   */
0697 
0698 /** @defgroup FMC_ECC_Page_Size FMC ECC Page Size
0699   * @ingroup RTEMSBSPsARMSTM32H7
0700   * @{
0701   */
0702 #define FMC_NAND_ECC_PAGE_SIZE_256BYTE          (0x00000000U)
0703 #define FMC_NAND_ECC_PAGE_SIZE_512BYTE          (0x00020000U)
0704 #define FMC_NAND_ECC_PAGE_SIZE_1024BYTE         (0x00040000U)
0705 #define FMC_NAND_ECC_PAGE_SIZE_2048BYTE         (0x00060000U)
0706 #define FMC_NAND_ECC_PAGE_SIZE_4096BYTE         (0x00080000U)
0707 #define FMC_NAND_ECC_PAGE_SIZE_8192BYTE         (0x000A0000U)
0708 /**
0709   * @}
0710   */
0711 
0712 /**
0713   * @}
0714   */
0715 
0716 /** @defgroup FMC_LL_SDRAM_Controller FMC SDRAM Controller
0717   * @ingroup RTEMSBSPsARMSTM32H7
0718   * @{
0719   */
0720 /** @defgroup FMC_SDRAM_Bank FMC SDRAM Bank
0721   * @ingroup RTEMSBSPsARMSTM32H7
0722   * @{
0723   */
0724 #define FMC_SDRAM_BANK1                         (0x00000000U)
0725 #define FMC_SDRAM_BANK2                         (0x00000001U)
0726 /**
0727   * @}
0728   */
0729 
0730 /** @defgroup FMC_SDRAM_Column_Bits_number FMC SDRAM Column Bits number
0731   * @ingroup RTEMSBSPsARMSTM32H7
0732   * @{
0733   */
0734 #define FMC_SDRAM_COLUMN_BITS_NUM_8             (0x00000000U)
0735 #define FMC_SDRAM_COLUMN_BITS_NUM_9             (0x00000001U)
0736 #define FMC_SDRAM_COLUMN_BITS_NUM_10            (0x00000002U)
0737 #define FMC_SDRAM_COLUMN_BITS_NUM_11            (0x00000003U)
0738 /**
0739   * @}
0740   */
0741 
0742 /** @defgroup FMC_SDRAM_Row_Bits_number FMC SDRAM Row Bits number
0743   * @ingroup RTEMSBSPsARMSTM32H7
0744   * @{
0745   */
0746 #define FMC_SDRAM_ROW_BITS_NUM_11               (0x00000000U)
0747 #define FMC_SDRAM_ROW_BITS_NUM_12               (0x00000004U)
0748 #define FMC_SDRAM_ROW_BITS_NUM_13               (0x00000008U)
0749 /**
0750   * @}
0751   */
0752 
0753 /** @defgroup FMC_SDRAM_Memory_Bus_Width FMC SDRAM Memory Bus Width
0754   * @ingroup RTEMSBSPsARMSTM32H7
0755   * @{
0756   */
0757 #define FMC_SDRAM_MEM_BUS_WIDTH_8               (0x00000000U)
0758 #define FMC_SDRAM_MEM_BUS_WIDTH_16              (0x00000010U)
0759 #define FMC_SDRAM_MEM_BUS_WIDTH_32              (0x00000020U)
0760 /**
0761   * @}
0762   */
0763 
0764 /** @defgroup FMC_SDRAM_Internal_Banks_Number FMC SDRAM Internal Banks Number
0765   * @ingroup RTEMSBSPsARMSTM32H7
0766   * @{
0767   */
0768 #define FMC_SDRAM_INTERN_BANKS_NUM_2            (0x00000000U)
0769 #define FMC_SDRAM_INTERN_BANKS_NUM_4            (0x00000040U)
0770 /**
0771   * @}
0772   */
0773 
0774 /** @defgroup FMC_SDRAM_CAS_Latency FMC SDRAM CAS Latency
0775   * @ingroup RTEMSBSPsARMSTM32H7
0776   * @{
0777   */
0778 #define FMC_SDRAM_CAS_LATENCY_1                 (0x00000080U)
0779 #define FMC_SDRAM_CAS_LATENCY_2                 (0x00000100U)
0780 #define FMC_SDRAM_CAS_LATENCY_3                 (0x00000180U)
0781 /**
0782   * @}
0783   */
0784 
0785 /** @defgroup FMC_SDRAM_Write_Protection FMC SDRAM Write Protection
0786   * @ingroup RTEMSBSPsARMSTM32H7
0787   * @{
0788   */
0789 #define FMC_SDRAM_WRITE_PROTECTION_DISABLE      (0x00000000U)
0790 #define FMC_SDRAM_WRITE_PROTECTION_ENABLE       (0x00000200U)
0791 /**
0792   * @}
0793   */
0794 
0795 /** @defgroup FMC_SDRAM_Clock_Period FMC SDRAM Clock Period
0796   * @ingroup RTEMSBSPsARMSTM32H7
0797   * @{
0798   */
0799 #define FMC_SDRAM_CLOCK_DISABLE                 (0x00000000U)
0800 #define FMC_SDRAM_CLOCK_PERIOD_2                (0x00000800U)
0801 #define FMC_SDRAM_CLOCK_PERIOD_3                (0x00000C00U)
0802 /**
0803   * @}
0804   */
0805 
0806 /** @defgroup FMC_SDRAM_Read_Burst FMC SDRAM Read Burst
0807   * @ingroup RTEMSBSPsARMSTM32H7
0808   * @{
0809   */
0810 #define FMC_SDRAM_RBURST_DISABLE                (0x00000000U)
0811 #define FMC_SDRAM_RBURST_ENABLE                 (0x00001000U)
0812 /**
0813   * @}
0814   */
0815 
0816 /** @defgroup FMC_SDRAM_Read_Pipe_Delay FMC SDRAM Read Pipe Delay
0817   * @ingroup RTEMSBSPsARMSTM32H7
0818   * @{
0819   */
0820 #define FMC_SDRAM_RPIPE_DELAY_0                 (0x00000000U)
0821 #define FMC_SDRAM_RPIPE_DELAY_1                 (0x00002000U)
0822 #define FMC_SDRAM_RPIPE_DELAY_2                 (0x00004000U)
0823 /**
0824   * @}
0825   */
0826 
0827 /** @defgroup FMC_SDRAM_Command_Mode FMC SDRAM Command Mode
0828   * @ingroup RTEMSBSPsARMSTM32H7
0829   * @{
0830   */
0831 #define FMC_SDRAM_CMD_NORMAL_MODE               (0x00000000U)
0832 #define FMC_SDRAM_CMD_CLK_ENABLE                (0x00000001U)
0833 #define FMC_SDRAM_CMD_PALL                      (0x00000002U)
0834 #define FMC_SDRAM_CMD_AUTOREFRESH_MODE          (0x00000003U)
0835 #define FMC_SDRAM_CMD_LOAD_MODE                 (0x00000004U)
0836 #define FMC_SDRAM_CMD_SELFREFRESH_MODE          (0x00000005U)
0837 #define FMC_SDRAM_CMD_POWERDOWN_MODE            (0x00000006U)
0838 /**
0839   * @}
0840   */
0841 
0842 /** @defgroup FMC_SDRAM_Command_Target FMC SDRAM Command Target
0843   * @ingroup RTEMSBSPsARMSTM32H7
0844   * @{
0845   */
0846 #define FMC_SDRAM_CMD_TARGET_BANK2              FMC_SDCMR_CTB2
0847 #define FMC_SDRAM_CMD_TARGET_BANK1              FMC_SDCMR_CTB1
0848 #define FMC_SDRAM_CMD_TARGET_BANK1_2            (0x00000018U)
0849 /**
0850   * @}
0851   */
0852 
0853 /** @defgroup FMC_SDRAM_Mode_Status FMC SDRAM Mode Status
0854   * @ingroup RTEMSBSPsARMSTM32H7
0855   * @{
0856   */
0857 #define FMC_SDRAM_NORMAL_MODE                   (0x00000000U)
0858 #define FMC_SDRAM_SELF_REFRESH_MODE             FMC_SDSR_MODES1_0
0859 #define FMC_SDRAM_POWER_DOWN_MODE               FMC_SDSR_MODES1_1
0860 /**
0861   * @}
0862   */
0863 
0864 /**
0865   * @}
0866   */
0867 
0868 
0869 /** @defgroup FMC_LL_Interrupt_definition FMC Low Layer Interrupt definition
0870   * @ingroup RTEMSBSPsARMSTM32H7
0871   * @{
0872   */
0873 #define FMC_IT_RISING_EDGE                      (0x00000008U)
0874 #define FMC_IT_LEVEL                            (0x00000010U)
0875 #define FMC_IT_FALLING_EDGE                     (0x00000020U)
0876 #define FMC_IT_REFRESH_ERROR                    (0x00004000U)
0877 /**
0878   * @}
0879   */
0880 
0881 /** @defgroup FMC_LL_Flag_definition FMC Low Layer Flag definition
0882   * @ingroup RTEMSBSPsARMSTM32H7
0883   * @{
0884   */
0885 #define FMC_FLAG_RISING_EDGE                    (0x00000001U)
0886 #define FMC_FLAG_LEVEL                          (0x00000002U)
0887 #define FMC_FLAG_FALLING_EDGE                   (0x00000004U)
0888 #define FMC_FLAG_FEMPT                          (0x00000040U)
0889 #define FMC_SDRAM_FLAG_REFRESH_IT               FMC_SDSR_RE
0890 #define FMC_SDRAM_FLAG_BUSY                     FMC_SDSR_BUSY
0891 #define FMC_SDRAM_FLAG_REFRESH_ERROR            FMC_SDRTR_CRE
0892 /**
0893   * @}
0894   */
0895 
0896 /**
0897   * @}
0898   */
0899 
0900 /**
0901   * @}
0902   */
0903 
0904 /* Private macro -------------------------------------------------------------*/
0905 /** @defgroup FMC_LL_Private_Macros FMC_LL  Private Macros
0906   * @ingroup RTEMSBSPsARMSTM32H7
0907   * @{
0908   */
0909 /**
0910   * @brief  Enable the FMC Peripheral.
0911   * @retval None
0912   */
0913 #define __FMC_ENABLE()  (FMC_Bank1_R->BTCR[0] |= FMC_BCR1_FMCEN)
0914 
0915 /**
0916   * @brief  Disable the FMC Peripheral.
0917   * @retval None
0918   */
0919 #define __FMC_DISABLE()  (FMC_Bank1_R->BTCR[0] &= ~FMC_BCR1_FMCEN)
0920 /** @defgroup FMC_LL_NOR_Macros FMC NOR/SRAM Macros
0921   * @ingroup RTEMSBSPsARMSTM32H7
0922   * @brief macros to handle NOR device enable/disable and read/write operations
0923   * @{
0924   */
0925 
0926 /**
0927   * @brief  Enable the NORSRAM device access.
0928   * @param  __INSTANCE__ FMC_NORSRAM Instance
0929   * @param  __BANK__ FMC_NORSRAM Bank
0930   * @retval None
0931   */
0932 #define __FMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__)  ((__INSTANCE__)->BTCR[(__BANK__)]\
0933                                                        |= FMC_BCRx_MBKEN)
0934 
0935 /**
0936   * @brief  Disable the NORSRAM device access.
0937   * @param  __INSTANCE__ FMC_NORSRAM Instance
0938   * @param  __BANK__ FMC_NORSRAM Bank
0939   * @retval None
0940   */
0941 #define __FMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)]\
0942                                                        &= ~FMC_BCRx_MBKEN)
0943 
0944 /**
0945   * @}
0946   */
0947 
0948 /** @defgroup FMC_LL_NAND_Macros FMC NAND Macros
0949   * @ingroup RTEMSBSPsARMSTM32H7
0950   *  @brief macros to handle NAND device enable/disable
0951   *  @{
0952   */
0953 
0954 /**
0955   * @brief  Enable the NAND device access.
0956   * @param  __INSTANCE__ FMC_NAND Instance
0957   * @retval None
0958   */
0959 #define __FMC_NAND_ENABLE(__INSTANCE__)  ((__INSTANCE__)->PCR |= FMC_PCR_PBKEN)
0960 
0961 /**
0962   * @brief  Disable the NAND device access.
0963   * @param  __INSTANCE__ FMC_NAND Instance
0964   * @param  __BANK__     FMC_NAND Bank
0965   * @retval None
0966   */
0967 #define __FMC_NAND_DISABLE(__INSTANCE__, __BANK__) CLEAR_BIT((__INSTANCE__)->PCR, FMC_PCR_PBKEN)
0968 
0969 /**
0970   * @}
0971   */
0972 
0973 /** @defgroup FMC_LL_NAND_Interrupt FMC NAND Interrupt
0974   * @ingroup RTEMSBSPsARMSTM32H7
0975   * @brief macros to handle NAND interrupts
0976   * @{
0977   */
0978 
0979 /**
0980   * @brief  Enable the NAND device interrupt.
0981   * @param  __INSTANCE__  FMC_NAND instance
0982   * @param  __INTERRUPT__ FMC_NAND interrupt
0983   *         This parameter can be any combination of the following values:
0984   *            @arg FMC_IT_RISING_EDGE: Interrupt rising edge.
0985   *            @arg FMC_IT_LEVEL: Interrupt level.
0986   *            @arg FMC_IT_FALLING_EDGE: Interrupt falling edge.
0987   * @retval None
0988   */
0989 #define __FMC_NAND_ENABLE_IT(__INSTANCE__, __INTERRUPT__)  ((__INSTANCE__)->SR |= (__INTERRUPT__))
0990 
0991 /**
0992   * @brief  Disable the NAND device interrupt.
0993   * @param  __INSTANCE__  FMC_NAND Instance
0994   * @param  __INTERRUPT__ FMC_NAND interrupt
0995   *         This parameter can be any combination of the following values:
0996   *            @arg FMC_IT_RISING_EDGE: Interrupt rising edge.
0997   *            @arg FMC_IT_LEVEL: Interrupt level.
0998   *            @arg FMC_IT_FALLING_EDGE: Interrupt falling edge.
0999   * @retval None
1000   */
1001 #define __FMC_NAND_DISABLE_IT(__INSTANCE__, __INTERRUPT__)  ((__INSTANCE__)->SR &= ~(__INTERRUPT__))
1002 
1003 /**
1004   * @brief  Get flag status of the NAND device.
1005   * @param  __INSTANCE__ FMC_NAND Instance
1006   * @param  __BANK__     FMC_NAND Bank
1007   * @param  __FLAG__     FMC_NAND flag
1008   *         This parameter can be any combination of the following values:
1009   *            @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
1010   *            @arg FMC_FLAG_LEVEL: Interrupt level edge flag.
1011   *            @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
1012   *            @arg FMC_FLAG_FEMPT: FIFO empty flag.
1013   * @retval The state of FLAG (SET or RESET).
1014   */
1015 #define __FMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__)  (((__INSTANCE__)->SR &(__FLAG__)) == (__FLAG__))
1016 
1017 /**
1018   * @brief  Clear flag status of the NAND device.
1019   * @param  __INSTANCE__ FMC_NAND Instance
1020   * @param  __FLAG__     FMC_NAND flag
1021   *         This parameter can be any combination of the following values:
1022   *            @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
1023   *            @arg FMC_FLAG_LEVEL: Interrupt level edge flag.
1024   *            @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
1025   *            @arg FMC_FLAG_FEMPT: FIFO empty flag.
1026   * @retval None
1027   */
1028 #define __FMC_NAND_CLEAR_FLAG(__INSTANCE__, __FLAG__)  ((__INSTANCE__)->SR &= ~(__FLAG__))
1029 
1030 /**
1031   * @}
1032   */
1033 
1034 
1035 /** @defgroup FMC_LL_SDRAM_Interrupt FMC SDRAM Interrupt
1036   * @ingroup RTEMSBSPsARMSTM32H7
1037   * @brief macros to handle SDRAM interrupts
1038   * @{
1039   */
1040 
1041 /**
1042   * @brief  Enable the SDRAM device interrupt.
1043   * @param  __INSTANCE__  FMC_SDRAM instance
1044   * @param  __INTERRUPT__ FMC_SDRAM interrupt
1045   *         This parameter can be any combination of the following values:
1046   *            @arg FMC_IT_REFRESH_ERROR: Interrupt refresh error
1047   * @retval None
1048   */
1049 #define __FMC_SDRAM_ENABLE_IT(__INSTANCE__, __INTERRUPT__)  ((__INSTANCE__)->SDRTR |= (__INTERRUPT__))
1050 
1051 /**
1052   * @brief  Disable the SDRAM device interrupt.
1053   * @param  __INSTANCE__  FMC_SDRAM instance
1054   * @param  __INTERRUPT__ FMC_SDRAM interrupt
1055   *         This parameter can be any combination of the following values:
1056   *            @arg FMC_IT_REFRESH_ERROR: Interrupt refresh error
1057   * @retval None
1058   */
1059 #define __FMC_SDRAM_DISABLE_IT(__INSTANCE__, __INTERRUPT__)  ((__INSTANCE__)->SDRTR &= ~(__INTERRUPT__))
1060 
1061 /**
1062   * @brief  Get flag status of the SDRAM device.
1063   * @param  __INSTANCE__ FMC_SDRAM instance
1064   * @param  __FLAG__     FMC_SDRAM flag
1065   *         This parameter can be any combination of the following values:
1066   *            @arg FMC_SDRAM_FLAG_REFRESH_IT: Interrupt refresh error.
1067   *            @arg FMC_SDRAM_FLAG_BUSY: SDRAM busy flag.
1068   *            @arg FMC_SDRAM_FLAG_REFRESH_ERROR: Refresh error flag.
1069   * @retval The state of FLAG (SET or RESET).
1070   */
1071 #define __FMC_SDRAM_GET_FLAG(__INSTANCE__, __FLAG__)  (((__INSTANCE__)->SDSR &(__FLAG__)) == (__FLAG__))
1072 
1073 /**
1074   * @brief  Clear flag status of the SDRAM device.
1075   * @param  __INSTANCE__ FMC_SDRAM instance
1076   * @param  __FLAG__     FMC_SDRAM flag
1077   *         This parameter can be any combination of the following values:
1078   *           @arg FMC_SDRAM_FLAG_REFRESH_ERROR
1079   * @retval None
1080   */
1081 #define __FMC_SDRAM_CLEAR_FLAG(__INSTANCE__, __FLAG__)  ((__INSTANCE__)->SDRTR |= (__FLAG__))
1082 
1083 /**
1084   * @}
1085   */
1086 /**
1087   * @}
1088   */
1089 
1090 /**
1091   * @}
1092   */
1093 
1094 /* Private functions ---------------------------------------------------------*/
1095 /** @defgroup FMC_LL_Private_Functions FMC LL Private Functions
1096   * @ingroup RTEMSBSPsARMSTM32H7
1097   *  @{
1098   */
1099 
1100 /** @defgroup FMC_LL_NORSRAM  NOR SRAM
1101   * @ingroup RTEMSBSPsARMSTM32H7
1102   *  @{
1103   */
1104 /** @defgroup FMC_LL_NORSRAM_Private_Functions_Group1 NOR SRAM Initialization/de-initialization functions
1105   * @ingroup RTEMSBSPsARMSTM32H7
1106   *  @{
1107   */
1108 HAL_StatusTypeDef  FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device,
1109                                     FMC_NORSRAM_InitTypeDef *Init);
1110 HAL_StatusTypeDef  FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device,
1111                                            FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank);
1112 HAL_StatusTypeDef  FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device,
1113                                                     FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank,
1114                                                     uint32_t ExtendedMode);
1115 HAL_StatusTypeDef  FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device,
1116                                       FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank);
1117 /**
1118   * @}
1119   */
1120 
1121 /** @defgroup FMC_LL_NORSRAM_Private_Functions_Group2 NOR SRAM Control functions
1122   * @ingroup RTEMSBSPsARMSTM32H7
1123   *  @{
1124   */
1125 HAL_StatusTypeDef  FMC_NORSRAM_WriteOperation_Enable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank);
1126 HAL_StatusTypeDef  FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank);
1127 /**
1128   * @}
1129   */
1130 /**
1131   * @}
1132   */
1133 
1134 /** @defgroup FMC_LL_NAND NAND
1135   * @ingroup RTEMSBSPsARMSTM32H7
1136   *  @{
1137   */
1138 /** @defgroup FMC_LL_NAND_Private_Functions_Group1 NAND Initialization/de-initialization functions
1139   * @ingroup RTEMSBSPsARMSTM32H7
1140   *  @{
1141   */
1142 HAL_StatusTypeDef  FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init);
1143 HAL_StatusTypeDef  FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device,
1144                                                     FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
1145 HAL_StatusTypeDef  FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device,
1146                                                        FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
1147 HAL_StatusTypeDef  FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank);
1148 /**
1149   * @}
1150   */
1151 
1152 /** @defgroup FMC_LL_NAND_Private_Functions_Group2 NAND Control functions
1153   * @ingroup RTEMSBSPsARMSTM32H7
1154   *  @{
1155   */
1156 HAL_StatusTypeDef  FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank);
1157 HAL_StatusTypeDef  FMC_NAND_ECC_Disable(FMC_NAND_TypeDef *Device, uint32_t Bank);
1158 HAL_StatusTypeDef  FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank,
1159                                    uint32_t Timeout);
1160 /**
1161   * @}
1162   */
1163 /**
1164   * @}
1165   */
1166 
1167 
1168 /** @defgroup FMC_LL_SDRAM SDRAM
1169   * @ingroup RTEMSBSPsARMSTM32H7
1170   *  @{
1171   */
1172 /** @defgroup FMC_LL_SDRAM_Private_Functions_Group1 SDRAM Initialization/de-initialization functions
1173   * @ingroup RTEMSBSPsARMSTM32H7
1174   *  @{
1175   */
1176 HAL_StatusTypeDef  FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDef *Init);
1177 HAL_StatusTypeDef  FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device,
1178                                          FMC_SDRAM_TimingTypeDef *Timing, uint32_t Bank);
1179 HAL_StatusTypeDef  FMC_SDRAM_DeInit(FMC_SDRAM_TypeDef *Device, uint32_t Bank);
1180 /**
1181   * @}
1182   */
1183 
1184 /** @defgroup FMC_LL_SDRAM_Private_Functions_Group2 SDRAM Control functions
1185   * @ingroup RTEMSBSPsARMSTM32H7
1186   *  @{
1187   */
1188 HAL_StatusTypeDef  FMC_SDRAM_WriteProtection_Enable(FMC_SDRAM_TypeDef *Device, uint32_t Bank);
1189 HAL_StatusTypeDef  FMC_SDRAM_WriteProtection_Disable(FMC_SDRAM_TypeDef *Device, uint32_t Bank);
1190 HAL_StatusTypeDef  FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device,
1191                                          FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout);
1192 HAL_StatusTypeDef  FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, uint32_t RefreshRate);
1193 HAL_StatusTypeDef  FMC_SDRAM_SetAutoRefreshNumber(FMC_SDRAM_TypeDef *Device,
1194                                                   uint32_t AutoRefreshNumber);
1195 uint32_t           FMC_SDRAM_GetModeStatus(const FMC_SDRAM_TypeDef *Device, uint32_t Bank);
1196 /**
1197   * @}
1198   */
1199 /**
1200   * @}
1201   */
1202 
1203 /**
1204   * @}
1205   */
1206 
1207 /**
1208   * @}
1209   */
1210 
1211 /**
1212   * @}
1213   */
1214 
1215 #ifdef __cplusplus
1216 }
1217 #endif
1218 
1219 #endif /* STM32H7xx_LL_FMC_H */