21 #ifndef __STM32L4xx_LL_FMC_H 22 #define __STM32L4xx_LL_FMC_H 42 #if defined(FMC_BANK1) 44 #define IS_FMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FMC_NORSRAM_BANK1) || \ 45 ((__BANK__) == FMC_NORSRAM_BANK2) || \ 46 ((__BANK__) == FMC_NORSRAM_BANK3) || \ 47 ((__BANK__) == FMC_NORSRAM_BANK4)) 48 #define IS_FMC_MUX(__MUX__) (((__MUX__) == FMC_DATA_ADDRESS_MUX_DISABLE) || \ 49 ((__MUX__) == FMC_DATA_ADDRESS_MUX_ENABLE)) 50 #define IS_FMC_MEMORY(__MEMORY__) (((__MEMORY__) == FMC_MEMORY_TYPE_SRAM) || \ 51 ((__MEMORY__) == FMC_MEMORY_TYPE_PSRAM) || \ 52 ((__MEMORY__) == FMC_MEMORY_TYPE_NOR)) 53 #define IS_FMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_8) || \ 54 ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_16) || \ 55 ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_32)) 56 #define IS_FMC_PAGESIZE(__SIZE__) (((__SIZE__) == FMC_PAGE_SIZE_NONE) || \ 57 ((__SIZE__) == FMC_PAGE_SIZE_128) || \ 58 ((__SIZE__) == FMC_PAGE_SIZE_256) || \ 59 ((__SIZE__) == FMC_PAGE_SIZE_512) || \ 60 ((__SIZE__) == FMC_PAGE_SIZE_1024)) 61 #if defined(FMC_BCR1_WFDIS) 62 #define IS_FMC_WRITE_FIFO(__FIFO__) (((__FIFO__) == FMC_WRITE_FIFO_DISABLE) || \ 63 ((__FIFO__) == FMC_WRITE_FIFO_ENABLE)) 65 #define IS_FMC_ACCESS_MODE(__MODE__) (((__MODE__) == FMC_ACCESS_MODE_A) || \ 66 ((__MODE__) == FMC_ACCESS_MODE_B) || \ 67 ((__MODE__) == FMC_ACCESS_MODE_C) || \ 68 ((__MODE__) == FMC_ACCESS_MODE_D)) 69 #if defined(FMC_BCRx_NBLSET) 70 #define IS_FMC_NBL_SETUPTIME(__NBL__) (((__NBL__) == FMC_NBL_SETUPTIME_0) || \ 71 ((__NBL__) == FMC_NBL_SETUPTIME_1) || \ 72 ((__NBL__) == FMC_NBL_SETUPTIME_2) || \ 73 ((__NBL__) == FMC_NBL_SETUPTIME_3)) 75 #define IS_FMC_BURSTMODE(__STATE__) (((__STATE__) == FMC_BURST_ACCESS_MODE_DISABLE) || \ 76 ((__STATE__) == FMC_BURST_ACCESS_MODE_ENABLE)) 77 #define IS_FMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_LOW) || \ 78 ((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_HIGH)) 79 #define IS_FMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FMC_WAIT_TIMING_BEFORE_WS) || \ 80 ((__ACTIVE__) == FMC_WAIT_TIMING_DURING_WS)) 81 #define IS_FMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FMC_WRITE_OPERATION_DISABLE) || \ 82 ((__OPERATION__) == FMC_WRITE_OPERATION_ENABLE)) 83 #define IS_FMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FMC_WAIT_SIGNAL_DISABLE) || \ 84 ((__SIGNAL__) == FMC_WAIT_SIGNAL_ENABLE)) 85 #define IS_FMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FMC_EXTENDED_MODE_DISABLE) || \ 86 ((__MODE__) == FMC_EXTENDED_MODE_ENABLE)) 87 #define IS_FMC_ASYNWAIT(__STATE__) (((__STATE__) == FMC_ASYNCHRONOUS_WAIT_DISABLE) || \ 88 ((__STATE__) == FMC_ASYNCHRONOUS_WAIT_ENABLE)) 89 #define IS_FMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1) && ((__LATENCY__) <= 17)) 90 #define IS_FMC_WRITE_BURST(__BURST__) (((__BURST__) == FMC_WRITE_BURST_DISABLE) || \ 91 ((__BURST__) == FMC_WRITE_BURST_ENABLE)) 92 #define IS_FMC_CONTINOUS_CLOCK(__CCLOCK__) (((__CCLOCK__) == FMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \ 93 ((__CCLOCK__) == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC)) 94 #define IS_FMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15) 95 #define IS_FMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 15)) 96 #define IS_FMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 255)) 97 #if defined(FMC_BTRx_DATAHLD) 98 #define IS_FMC_DATAHOLD_DURATION(__DATAHOLD__) ((__DATAHOLD__) <= 3) 100 #define IS_FMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15) 101 #define IS_FMC_CLK_DIV(__DIV__) (((__DIV__) > 1) && ((__DIV__) <= 16)) 102 #define IS_FMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_DEVICE) 103 #define IS_FMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_EXTENDED_DEVICE) 106 #if defined(FMC_BANK3) 108 #define IS_FMC_NAND_BANK(__BANK__) ((__BANK__) == FMC_NAND_BANK3) 109 #define IS_FMC_WAIT_FEATURE(__FEATURE__) (((__FEATURE__) == FMC_NAND_WAIT_FEATURE_DISABLE) || \ 110 ((__FEATURE__) == FMC_NAND_WAIT_FEATURE_ENABLE)) 111 #define IS_FMC_NAND_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NAND_MEM_BUS_WIDTH_8) || \ 112 ((__WIDTH__) == FMC_NAND_MEM_BUS_WIDTH_16)) 113 #define IS_FMC_ECC_STATE(__STATE__) (((__STATE__) == FMC_NAND_ECC_DISABLE) || \ 114 ((__STATE__) == FMC_NAND_ECC_ENABLE)) 115 #define IS_FMC_ECCPAGE_SIZE(__SIZE__) (((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_256BYTE) || \ 116 ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_512BYTE) || \ 117 ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \ 118 ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \ 119 ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \ 120 ((__SIZE__) == FMC_NAND_ECC_PAGE_SIZE_8192BYTE)) 121 #define IS_FMC_TCLR_TIME(__TIME__) ((__TIME__) <= 255) 122 #define IS_FMC_TAR_TIME(__TIME__) ((__TIME__) <= 255) 123 #define IS_FMC_SETUP_TIME(__TIME__) ((__TIME__) <= 254) 124 #define IS_FMC_WAIT_TIME(__TIME__) ((__TIME__) <= 254) 125 #define IS_FMC_HOLD_TIME(__TIME__) ((__TIME__) <= 254) 126 #define IS_FMC_HIZ_TIME(__TIME__) ((__TIME__) <= 254) 127 #define IS_FMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NAND_DEVICE) 141 #if defined(FMC_BANK1) 142 #define FMC_NORSRAM_TypeDef FMC_Bank1_TypeDef 143 #define FMC_NORSRAM_EXTENDED_TypeDef FMC_Bank1E_TypeDef 145 #if defined(FMC_BANK3) 146 #define FMC_NAND_TypeDef FMC_Bank3_TypeDef 149 #if defined(FMC_BANK1) 150 #define FMC_NORSRAM_DEVICE FMC_Bank1_R 151 #define FMC_NORSRAM_EXTENDED_DEVICE FMC_Bank1E_R 153 #if defined(FMC_BANK3) 154 #define FMC_NAND_DEVICE FMC_Bank3_R 157 #if defined(FMC_BANK1) 221 #if defined(FMC_BCRx_NBLSET) 249 #if defined(FMC_BTRx_DATAHLD) 279 #if defined(FMC_BANK3) 349 #if defined(FMC_BANK1) 358 #define FMC_NORSRAM_BANK1 ((uint32_t)0x00000000U) 359 #define FMC_NORSRAM_BANK2 ((uint32_t)0x00000002U) 360 #define FMC_NORSRAM_BANK3 ((uint32_t)0x00000004U) 361 #define FMC_NORSRAM_BANK4 ((uint32_t)0x00000006U) 369 #define FMC_DATA_ADDRESS_MUX_DISABLE ((uint32_t)0x00000000U) 370 #define FMC_DATA_ADDRESS_MUX_ENABLE ((uint32_t)FMC_BCRx_MUXEN) 378 #define FMC_MEMORY_TYPE_SRAM ((uint32_t)0x00000000U) 379 #define FMC_MEMORY_TYPE_PSRAM ((uint32_t)FMC_BCRx_MTYP_0) 380 #define FMC_MEMORY_TYPE_NOR ((uint32_t)FMC_BCRx_MTYP_1) 388 #define FMC_NORSRAM_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000U) 389 #define FMC_NORSRAM_MEM_BUS_WIDTH_16 ((uint32_t)FMC_BCRx_MWID_0) 390 #define FMC_NORSRAM_MEM_BUS_WIDTH_32 ((uint32_t)FMC_BCRx_MWID_1) 398 #define FMC_NORSRAM_FLASH_ACCESS_ENABLE ((uint32_t)FMC_BCRx_FACCEN) 399 #define FMC_NORSRAM_FLASH_ACCESS_DISABLE ((uint32_t)0x00000000U) 407 #define FMC_BURST_ACCESS_MODE_DISABLE ((uint32_t)0x00000000U) 408 #define FMC_BURST_ACCESS_MODE_ENABLE ((uint32_t)FMC_BCRx_BURSTEN) 416 #define FMC_WAIT_SIGNAL_POLARITY_LOW ((uint32_t)0x00000000U) 417 #define FMC_WAIT_SIGNAL_POLARITY_HIGH ((uint32_t)FMC_BCRx_WAITPOL) 425 #define FMC_WAIT_TIMING_BEFORE_WS ((uint32_t)0x00000000U) 426 #define FMC_WAIT_TIMING_DURING_WS ((uint32_t)FMC_BCRx_WAITCFG) 434 #define FMC_WRITE_OPERATION_DISABLE ((uint32_t)0x00000000U) 435 #define FMC_WRITE_OPERATION_ENABLE ((uint32_t)FMC_BCRx_WREN) 443 #define FMC_WAIT_SIGNAL_DISABLE ((uint32_t)0x00000000U) 444 #define FMC_WAIT_SIGNAL_ENABLE ((uint32_t)FMC_BCRx_WAITEN) 452 #define FMC_EXTENDED_MODE_DISABLE ((uint32_t)0x00000000U) 453 #define FMC_EXTENDED_MODE_ENABLE ((uint32_t)FMC_BCRx_EXTMOD) 461 #define FMC_ASYNCHRONOUS_WAIT_DISABLE ((uint32_t)0x00000000U) 462 #define FMC_ASYNCHRONOUS_WAIT_ENABLE ((uint32_t)FMC_BCRx_ASYNCWAIT) 470 #define FMC_PAGE_SIZE_NONE ((uint32_t)0x00000000U) 471 #define FMC_PAGE_SIZE_128 ((uint32_t)FMC_BCRx_CPSIZE_0) 472 #define FMC_PAGE_SIZE_256 ((uint32_t)FMC_BCRx_CPSIZE_1) 473 #define FMC_PAGE_SIZE_512 ((uint32_t)(FMC_BCRx_CPSIZE_0 | FMC_BCRx_CPSIZE_1)) 474 #define FMC_PAGE_SIZE_1024 ((uint32_t)FMC_BCRx_CPSIZE_2) 482 #define FMC_WRITE_BURST_DISABLE ((uint32_t)0x00000000U) 483 #define FMC_WRITE_BURST_ENABLE ((uint32_t)FMC_BCRx_CBURSTRW) 491 #define FMC_CONTINUOUS_CLOCK_SYNC_ONLY ((uint32_t)0x00000000U) 492 #define FMC_CONTINUOUS_CLOCK_SYNC_ASYNC ((uint32_t)FMC_BCR1_CCLKEN) 497 #if defined(FMC_BCR1_WFDIS) 501 #define FMC_WRITE_FIFO_DISABLE ((uint32_t)FMC_BCR1_WFDIS) 502 #define FMC_WRITE_FIFO_ENABLE ((uint32_t)0x00000000U) 511 #define FMC_ACCESS_MODE_A ((uint32_t)0x00000000U) 512 #define FMC_ACCESS_MODE_B ((uint32_t)FMC_BTRx_ACCMOD_0) 513 #define FMC_ACCESS_MODE_C ((uint32_t)FMC_BTRx_ACCMOD_1) 514 #define FMC_ACCESS_MODE_D ((uint32_t)(FMC_BTRx_ACCMOD_0 | FMC_BTRx_ACCMOD_1)) 519 #if defined(FMC_BCRx_NBLSET) 523 #define FMC_NBL_SETUPTIME_0 ((uint32_t)0x00000000U) 524 #define FMC_NBL_SETUPTIME_1 ((uint32_t)FMC_BCRx_NBLSET_0) 525 #define FMC_NBL_SETUPTIME_2 ((uint32_t)FMC_BCRx_NBLSET_1) 526 #define FMC_NBL_SETUPTIME_3 ((uint32_t)(FMC_BCRx_NBLSET_0 | FMC_BCRx_NBLSET_1)) 537 #if defined(FMC_BANK3) 545 #define FMC_NAND_BANK3 ((uint32_t)0x00000100U) 553 #define FMC_NAND_WAIT_FEATURE_DISABLE ((uint32_t)0x00000000U) 554 #define FMC_NAND_WAIT_FEATURE_ENABLE ((uint32_t)FMC_PCR_PWAITEN) 562 #define FMC_PCR_MEMORY_TYPE_NAND ((uint32_t)FMC_PCR_PTYP) 570 #define FMC_NAND_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000U) 571 #define FMC_NAND_MEM_BUS_WIDTH_16 ((uint32_t)FMC_PCR_PWID_0) 579 #define FMC_NAND_ECC_DISABLE ((uint32_t)0x00000000U) 580 #define FMC_NAND_ECC_ENABLE ((uint32_t)FMC_PCR_ECCEN) 588 #define FMC_NAND_ECC_PAGE_SIZE_256BYTE ((uint32_t)0x00000000U) 589 #define FMC_NAND_ECC_PAGE_SIZE_512BYTE ((uint32_t)FMC_PCR_ECCPS_0) 590 #define FMC_NAND_ECC_PAGE_SIZE_1024BYTE ((uint32_t)FMC_PCR_ECCPS_1) 591 #define FMC_NAND_ECC_PAGE_SIZE_2048BYTE ((uint32_t)FMC_PCR_ECCPS_0|FMC_PCR_ECCPS_1) 592 #define FMC_NAND_ECC_PAGE_SIZE_4096BYTE ((uint32_t)FMC_PCR_ECCPS_2) 593 #define FMC_NAND_ECC_PAGE_SIZE_8192BYTE ((uint32_t)FMC_PCR_ECCPS_0|FMC_PCR_ECCPS_2) 607 #if defined(FMC_BANK3) 608 #define FMC_IT_RISING_EDGE ((uint32_t)FMC_SR_IREN) 609 #define FMC_IT_LEVEL ((uint32_t)FMC_SR_ILEN) 610 #define FMC_IT_FALLING_EDGE ((uint32_t)FMC_SR_IFEN) 619 #if defined(FMC_BANK3) 620 #define FMC_FLAG_RISING_EDGE ((uint32_t)FMC_SR_IRS) 621 #define FMC_FLAG_LEVEL ((uint32_t)FMC_SR_ILS) 622 #define FMC_FLAG_FALLING_EDGE ((uint32_t)FMC_SR_IFS) 623 #define FMC_FLAG_FEMPT ((uint32_t)FMC_SR_FEMPT) 641 #if defined(FMC_BANK1) 653 #define __FMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)] |= FMC_BCRx_MBKEN) 661 #define __FMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)] &= ~FMC_BCRx_MBKEN) 668 #if defined(FMC_BANK3) 679 #define __FMC_NAND_ENABLE(__INSTANCE__) ((__INSTANCE__)->PCR |= FMC_PCR_PBKEN) 686 #define __FMC_NAND_DISABLE(__INSTANCE__) ((__INSTANCE__)->PCR &= ~FMC_PCR_PBKEN) 707 #define __FMC_NAND_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR |= (__INTERRUPT__)) 719 #define __FMC_NAND_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR &= ~(__INTERRUPT__)) 733 #define __FMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__INSTANCE__)->SR &(__FLAG__)) == (__FLAG__)) 746 #define __FMC_NAND_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SR &= ~(__FLAG__)) 766 #if defined(FMC_BANK1) 776 HAL_StatusTypeDef
FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank);
794 #if defined(FMC_BANK3) 804 HAL_StatusTypeDef
FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank);
814 HAL_StatusTypeDef
FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout);
HAL_StatusTypeDef FMC_NAND_ECC_Disable(FMC_NAND_TypeDef *Device, uint32_t Bank)
Disables dynamically FMC_NAND ECC feature.
FMC NAND Configuration Structure definition.
HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
Initializes the FMC_NAND Attribute space Timing according to the specified parameters in the FMC_NAND...
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank)
Initializes the FMC_NAND Common space Timing according to the specified parameters in the FMC_NAND_PC...
HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init)
Initializes the FMC_NAND device according to the specified control parameters in the FMC_NAND_HandleT...
FMC NAND Timing parameters structure definition.
HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout)
Disables dynamically FMC_NAND ECC feature.
uint32_t AddressSetupTime
HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank)
DeInitialize the FMC_NORSRAM peripheral.
FMC NORSRAM Configuration Structure definition.
uint32_t WaitSignalPolarity
HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode)
Initialize the FMC_NORSRAM Extended mode Timing according to the specified parameters in the FMC_NORS...
uint32_t WaitSignalActive
FMC NORSRAM Timing parameters structure definition.
HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_InitTypeDef *Init)
Initialize the FMC_NORSRAM device according to the specified control parameters in the FMC_NORSRAM_In...
HAL_StatusTypeDef FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank)
Enables dynamically FMC_NAND ECC feature.
uint32_t BusTurnAroundDuration
uint32_t AsynchronousWait
HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank)
Disables dynamically FMC_NORSRAM write operation.
HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank)
Initialize the FMC_NORSRAM Timing according to the specified parameters in the FMC_NORSRAM_TimingType...
HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Enable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank)
Enables dynamically FMC_NORSRAM write operation.
HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank)
DeInitializes the FMC_NAND device.