Rev 56 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 56 | Rev 61 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
| 5 | * @brief Header file of FSMC HAL module. |
5 | * @brief Header file of FSMC HAL module. |
| 6 | ****************************************************************************** |
6 | ****************************************************************************** |
| 7 | * @attention |
7 | * @attention |
| 8 | * |
8 | * |
| 9 | * <h2><center>© Copyright (c) 2017 STMicroelectronics. |
9 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
| 10 | * All rights reserved.</center></h2> |
10 | * All rights reserved.</center></h2> |
| 11 | * |
11 | * |
| 12 | * This software component is licensed by ST under BSD 3-Clause license, |
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 |
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: |
14 | * License. You may obtain a copy of the License at: |
| 15 | * opensource.org/licenses/BSD-3-Clause |
15 | * opensource.org/licenses/BSD-3-Clause |
| 16 | * |
16 | * |
| 17 | ****************************************************************************** |
17 | ****************************************************************************** |
| 18 | */ |
18 | */ |
| 19 | 19 | ||
| 20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| 21 | #ifndef __STM32L1xx_LL_FSMC_H |
21 | #ifndef STM32L1xx_LL_FSMC_H |
| 22 | #define __STM32L1xx_LL_FSMC_H |
22 | #define STM32L1xx_LL_FSMC_H |
| 23 | 23 | ||
| 24 | #ifdef __cplusplus |
24 | #ifdef __cplusplus |
| 25 | extern "C" { |
25 | extern "C" { |
| 26 | #endif |
26 | #endif |
| 27 | 27 | ||
| Line 30... | Line 30... | ||
| 30 | 30 | ||
| 31 | /** @addtogroup STM32L1xx_HAL_Driver |
31 | /** @addtogroup STM32L1xx_HAL_Driver |
| 32 | * @{ |
32 | * @{ |
| 33 | */ |
33 | */ |
| 34 | 34 | ||
| 35 | #if defined(FSMC_BANK1) |
- | |
| 36 | - | ||
| 37 | /** @addtogroup FSMC_LL |
35 | /** @addtogroup FSMC_LL |
| 38 | * @{ |
36 | * @{ |
| 39 | */ |
37 | */ |
| 40 | 38 | ||
| 41 | /** @addtogroup FSMC_LL_Private_Macros |
39 | /** @addtogroup FSMC_LL_Private_Macros |
| 42 | * @{ |
40 | * @{ |
| 43 | */ |
41 | */ |
| - | 42 | #if defined(FSMC_BANK1) |
|
| 44 | 43 | ||
| 45 | #define IS_FSMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FSMC_NORSRAM_BANK1) || \ |
44 | #define IS_FSMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FSMC_NORSRAM_BANK1) || \ |
| 46 | ((__BANK__) == FSMC_NORSRAM_BANK2) || \ |
45 | ((__BANK__) == FSMC_NORSRAM_BANK2) || \ |
| 47 | ((__BANK__) == FSMC_NORSRAM_BANK3) || \ |
46 | ((__BANK__) == FSMC_NORSRAM_BANK3) || \ |
| 48 | ((__BANK__) == FSMC_NORSRAM_BANK4)) |
47 | ((__BANK__) == FSMC_NORSRAM_BANK4)) |
| 49 | - | ||
| 50 | #define IS_FSMC_MUX(__MUX__) (((__MUX__) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \ |
48 | #define IS_FSMC_MUX(__MUX__) (((__MUX__) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \ |
| 51 | ((__MUX__) == FSMC_DATA_ADDRESS_MUX_ENABLE)) |
49 | ((__MUX__) == FSMC_DATA_ADDRESS_MUX_ENABLE)) |
| 52 | - | ||
| 53 | #define IS_FSMC_MEMORY(__MEMORY__) (((__MEMORY__) == FSMC_MEMORY_TYPE_SRAM) || \ |
50 | #define IS_FSMC_MEMORY(__MEMORY__) (((__MEMORY__) == FSMC_MEMORY_TYPE_SRAM) || \ |
| 54 | ((__MEMORY__) == FSMC_MEMORY_TYPE_PSRAM)|| \ |
51 | ((__MEMORY__) == FSMC_MEMORY_TYPE_PSRAM)|| \ |
| 55 | ((__MEMORY__) == FSMC_MEMORY_TYPE_NOR)) |
52 | ((__MEMORY__) == FSMC_MEMORY_TYPE_NOR)) |
| 56 | - | ||
| 57 | #define IS_FSMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_8) || \ |
53 | #define IS_FSMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_8) || \ |
| 58 | ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \ |
54 | ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \ |
| 59 | ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_32)) |
55 | ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_32)) |
| 60 | - | ||
| 61 | #define IS_FSMC_WRITE_BURST(__BURST__) (((__BURST__) == FSMC_WRITE_BURST_DISABLE) || \ |
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) || \ |
|
| 62 | ((__BURST__) == FSMC_WRITE_BURST_ENABLE)) |
60 | ((__SIZE__) == FSMC_PAGE_SIZE_1024)) |
| 63 | - | ||
| 64 | #define IS_FSMC_ACCESS_MODE(__MODE__) (((__MODE__) == FSMC_ACCESS_MODE_A) || \ |
61 | #define IS_FSMC_ACCESS_MODE(__MODE__) (((__MODE__) == FSMC_ACCESS_MODE_A) || \ |
| 65 | ((__MODE__) == FSMC_ACCESS_MODE_B) || \ |
62 | ((__MODE__) == FSMC_ACCESS_MODE_B) || \ |
| 66 | ((__MODE__) == FSMC_ACCESS_MODE_C) || \ |
63 | ((__MODE__) == FSMC_ACCESS_MODE_C) || \ |
| 67 | ((__MODE__) == FSMC_ACCESS_MODE_D)) |
64 | ((__MODE__) == FSMC_ACCESS_MODE_D)) |
| 68 | - | ||
| 69 | - | ||
| 70 | /** @defgroup FSMC_NORSRAM_Device_Instance FSMC NOR/SRAM Device Instance |
- | |
| 71 | * @{ |
- | |
| 72 | */ |
- | |
| 73 | - | ||
| 74 | #define IS_FSMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_DEVICE) |
- | |
| 75 | - | ||
| 76 | /** |
- | |
| 77 | * @} |
- | |
| 78 | */ |
- | |
| 79 | - | ||
| 80 | /** @defgroup FSMC_NORSRAM_EXTENDED_Device_Instance FSMC NOR/SRAM EXTENDED Device Instance |
- | |
| 81 | * @{ |
- | |
| 82 | */ |
- | |
| 83 | - | ||
| 84 | #define IS_FSMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_EXTENDED_DEVICE) |
- | |
| 85 | - | ||
| 86 | /** |
- | |
| 87 | * @} |
- | |
| 88 | */ |
- | |
| 89 | - | ||
| 90 | #define IS_FSMC_BURSTMODE(__STATE__) (((__STATE__) == FSMC_BURST_ACCESS_MODE_DISABLE) || \ |
65 | #define IS_FSMC_BURSTMODE(__STATE__) (((__STATE__) == FSMC_BURST_ACCESS_MODE_DISABLE) || \ |
| 91 | ((__STATE__) == FSMC_BURST_ACCESS_MODE_ENABLE)) |
66 | ((__STATE__) == FSMC_BURST_ACCESS_MODE_ENABLE)) |
| 92 | - | ||
| 93 | #define IS_FSMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \ |
67 | #define IS_FSMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \ |
| 94 | ((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_HIGH)) |
68 | ((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_HIGH)) |
| 95 | - | ||
| 96 | #define IS_FSMC_WRAP_MODE(__MODE__) (((__MODE__) == FSMC_WRAP_MODE_DISABLE) || \ |
69 | #define IS_FSMC_WRAP_MODE(__MODE__) (((__MODE__) == FSMC_WRAP_MODE_DISABLE) || \ |
| 97 | ((__MODE__) == FSMC_WRAP_MODE_ENABLE)) |
70 | ((__MODE__) == FSMC_WRAP_MODE_ENABLE)) |
| 98 | - | ||
| 99 | #define IS_FSMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FSMC_WAIT_TIMING_BEFORE_WS) || \ |
71 | #define IS_FSMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FSMC_WAIT_TIMING_BEFORE_WS) || \ |
| 100 | ((__ACTIVE__) == FSMC_WAIT_TIMING_DURING_WS)) |
72 | ((__ACTIVE__) == FSMC_WAIT_TIMING_DURING_WS)) |
| 101 | - | ||
| 102 | #define IS_FSMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FSMC_WRITE_OPERATION_DISABLE) || \ |
73 | #define IS_FSMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FSMC_WRITE_OPERATION_DISABLE) || \ |
| 103 | ((__OPERATION__) == FSMC_WRITE_OPERATION_ENABLE)) |
74 | ((__OPERATION__) == FSMC_WRITE_OPERATION_ENABLE)) |
| 104 | - | ||
| 105 | #define IS_FSMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FSMC_WAIT_SIGNAL_DISABLE) || \ |
75 | #define IS_FSMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FSMC_WAIT_SIGNAL_DISABLE) || \ |
| 106 | ((__SIGNAL__) == FSMC_WAIT_SIGNAL_ENABLE)) |
76 | ((__SIGNAL__) == FSMC_WAIT_SIGNAL_ENABLE)) |
| 107 | - | ||
| 108 | #define IS_FSMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FSMC_EXTENDED_MODE_DISABLE) || \ |
77 | #define IS_FSMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FSMC_EXTENDED_MODE_DISABLE) || \ |
| 109 | ((__MODE__) == FSMC_EXTENDED_MODE_ENABLE)) |
78 | ((__MODE__) == FSMC_EXTENDED_MODE_ENABLE)) |
| 110 | - | ||
| 111 | #define IS_FSMC_ASYNWAIT(__STATE__) (((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \ |
79 | #define IS_FSMC_ASYNWAIT(__STATE__) (((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \ |
| 112 | ((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_ENABLE)) |
80 | ((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_ENABLE)) |
| 113 | - | ||
| 114 | #define IS_FSMC_CLK_DIV(__DIV__) (((__DIV__) > 1) && ((__DIV__) <= 16)) |
81 | #define IS_FSMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1U) && ((__LATENCY__) <= 17U)) |
| 115 | - | ||
| 116 | /** @defgroup FSMC_Data_Latency FSMC Data Latency |
82 | #define IS_FSMC_WRITE_BURST(__BURST__) (((__BURST__) == FSMC_WRITE_BURST_DISABLE) || \ |
| 117 | * @{ |
- | |
| 118 | */ |
- | |
| - | 83 | ((__BURST__) == FSMC_WRITE_BURST_ENABLE)) |
|
| 119 | #define IS_FSMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1) && ((__LATENCY__) <= 17)) |
84 | #define IS_FSMC_CONTINOUS_CLOCK(__CCLOCK__) (((__CCLOCK__) == FSMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \ |
| 120 | /** |
- | |
| 121 | * @} |
- | |
| 122 | */ |
- | |
| 123 | - | ||
| 124 | /** @defgroup FSMC_Address_Setup_Time FSMC Address Setup Time |
85 | ((__CCLOCK__) == FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC)) |
| 125 | * @{ |
- | |
| 126 | */ |
- | |
| 127 | #define IS_FSMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15) |
86 | #define IS_FSMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15U) |
| 128 | /** |
- | |
| 129 | * @} |
- | |
| 130 | */ |
- | |
| 131 | - | ||
| 132 | /** @defgroup FSMC_Address_Hold_Time FSMC Address Hold Time |
87 | #define IS_FSMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 15U)) |
| 133 | * @{ |
- | |
| 134 | */ |
- | |
| 135 | #define IS_FSMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 15)) |
88 | #define IS_FSMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0U) && ((__TIME__) <= 255U)) |
| 136 | /** |
- | |
| 137 | * @} |
- | |
| 138 | */ |
- | |
| 139 | - | ||
| - | 89 | #define IS_FSMC_DATAHOLD_DURATION(__DATAHOLD__) ((__DATAHOLD__) <= 3U) |
|
| 140 | /** @defgroup FSMC_Data_Setup_Time FSMC Data Setup Time |
90 | #define IS_FSMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15U) |
| 141 | * @{ |
- | |
| 142 | */ |
- | |
| 143 | #define IS_FSMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 255)) |
91 | #define IS_FSMC_CLK_DIV(__DIV__) (((__DIV__) > 1U) && ((__DIV__) <= 16U)) |
| 144 | /** |
- | |
| 145 | * @} |
- | |
| 146 | */ |
- | |
| - | 92 | #define IS_FSMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_DEVICE) |
|
| - | 93 | #define IS_FSMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_EXTENDED_DEVICE) |
|
| 147 | 94 | ||
| 148 | /** @defgroup FSMC_Bus_Turn_around_Duration FSMC Bus Turn around Duration |
- | |
| 149 | * @{ |
- | |
| 150 | */ |
- | |
| 151 | #define IS_FSMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15) |
95 | #endif /* FSMC_BANK1 */ |
| 152 | /** |
- | |
| 153 | * @} |
- | |
| 154 | */ |
- | |
| 155 | 96 | ||
| 156 | /** |
97 | /** |
| 157 | * @} |
98 | * @} |
| 158 | */ |
99 | */ |
| 159 | 100 | ||
| 160 | /* Exported typedef ----------------------------------------------------------*/ |
101 | /* Exported typedef ----------------------------------------------------------*/ |
| 161 | 102 | ||
| 162 | /** @defgroup FSMC_NORSRAM_Exported_typedef FSMC Low Layer Exported Types |
103 | /** @defgroup FSMC_LL_Exported_typedef FSMC Low Layer Exported Types |
| 163 | * @{ |
104 | * @{ |
| 164 | */ |
105 | */ |
| 165 | 106 | ||
| - | 107 | #if defined(FSMC_BANK1) |
|
| 166 | #define FSMC_NORSRAM_TypeDef FSMC_Bank1_TypeDef |
108 | #define FSMC_NORSRAM_TypeDef FSMC_Bank1_TypeDef |
| 167 | #define FSMC_NORSRAM_EXTENDED_TypeDef FSMC_Bank1E_TypeDef |
109 | #define FSMC_NORSRAM_EXTENDED_TypeDef FSMC_Bank1E_TypeDef |
| - | 110 | #endif /* FSMC_BANK1 */ |
|
| 168 | 111 | ||
| - | 112 | #if defined(FSMC_BANK1) |
|
| 169 | #define FSMC_NORSRAM_DEVICE FSMC_Bank1 |
113 | #define FSMC_NORSRAM_DEVICE FSMC_Bank1 |
| 170 | #define FSMC_NORSRAM_EXTENDED_DEVICE FSMC_Bank1E |
114 | #define FSMC_NORSRAM_EXTENDED_DEVICE FSMC_Bank1E |
| - | 115 | #endif /* FSMC_BANK1 */ |
|
| 171 | 116 | ||
| - | 117 | #if defined(FSMC_BANK1) |
|
| 172 | /** |
118 | /** |
| 173 | * @brief FSMC_NORSRAM Configuration Structure definition |
119 | * @brief FSMC NORSRAM Configuration Structure definition |
| 174 | */ |
120 | */ |
| 175 | typedef struct |
121 | typedef struct |
| 176 | { |
122 | { |
| 177 | uint32_t NSBank; /*!< Specifies the NORSRAM memory device that will be used. |
123 | uint32_t NSBank; /*!< Specifies the NORSRAM memory device that will be used. |
| 178 | This parameter can be a value of @ref FSMC_NORSRAM_Bank */ |
124 | This parameter can be a value of @ref FSMC_NORSRAM_Bank */ |
| 179 | 125 | ||
| 180 | uint32_t DataAddressMux; /*!< Specifies whether the address and data values are |
126 | uint32_t DataAddressMux; /*!< Specifies whether the address and data values are |
| 181 | multiplexed on the data bus or not. |
127 | multiplexed on the data bus or not. |
| 182 | This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing */ |
128 | This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing */ |
| 183 | 129 | ||
| 184 | uint32_t MemoryType; /*!< Specifies the type of external memory attached to |
130 | uint32_t MemoryType; /*!< Specifies the type of external memory attached to |
| 185 | the corresponding memory device. |
131 | the corresponding memory device. |
| 186 | This parameter can be a value of @ref FSMC_Memory_Type */ |
132 | This parameter can be a value of @ref FSMC_Memory_Type */ |
| 187 | 133 | ||
| 188 | uint32_t MemoryDataWidth; /*!< Specifies the external memory device width. |
134 | uint32_t MemoryDataWidth; /*!< Specifies the external memory device width. |
| 189 | This parameter can be a value of @ref FSMC_NORSRAM_Data_Width */ |
135 | This parameter can be a value of @ref FSMC_NORSRAM_Data_Width */ |
| 190 | 136 | ||
| 191 | uint32_t BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory, |
137 | uint32_t BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory, |
| 192 | valid only with synchronous burst Flash memories. |
138 | valid only with synchronous burst Flash memories. |
| 193 | This parameter can be a value of @ref FSMC_Burst_Access_Mode */ |
139 | This parameter can be a value of @ref FSMC_Burst_Access_Mode */ |
| 194 | 140 | ||
| 195 | uint32_t WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing |
141 | uint32_t WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing |
| 196 | the Flash memory in burst mode. |
142 | the Flash memory in burst mode. |
| 197 | This parameter can be a value of @ref FSMC_Wait_Signal_Polarity */ |
143 | This parameter can be a value of @ref FSMC_Wait_Signal_Polarity */ |
| 198 | 144 | ||
| 199 | uint32_t WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash |
145 | uint32_t WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash |
| 200 | memory, valid only when accessing Flash memories in burst mode. |
146 | memory, valid only when accessing Flash memories in burst mode. |
| 201 | This parameter can be a value of @ref FSMC_Wrap_Mode */ |
147 | This parameter can be a value of @ref FSMC_Wrap_Mode */ |
| 202 | 148 | ||
| 203 | uint32_t WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one |
149 | uint32_t WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one |
| 204 | clock cycle before the wait state or during the wait state, |
150 | clock cycle before the wait state or during the wait state, |
| 205 | valid only when accessing memories in burst mode. |
151 | valid only when accessing memories in burst mode. |
| 206 | This parameter can be a value of @ref FSMC_Wait_Timing */ |
152 | This parameter can be a value of @ref FSMC_Wait_Timing */ |
| 207 | 153 | ||
| 208 | uint32_t WriteOperation; /*!< Enables or disables the write operation in the selected device by the FSMC. |
154 | uint32_t WriteOperation; /*!< Enables or disables the write operation in the selected device by the FSMC. |
| 209 | This parameter can be a value of @ref FSMC_Write_Operation */ |
155 | This parameter can be a value of @ref FSMC_Write_Operation */ |
| 210 | 156 | ||
| 211 | uint32_t WaitSignal; /*!< Enables or disables the wait state insertion via wait |
157 | uint32_t WaitSignal; /*!< Enables or disables the wait state insertion via wait |
| 212 | signal, valid for Flash memory access in burst mode. |
158 | signal, valid for Flash memory access in burst mode. |
| 213 | This parameter can be a value of @ref FSMC_Wait_Signal */ |
159 | This parameter can be a value of @ref FSMC_Wait_Signal */ |
| 214 | 160 | ||
| 215 | uint32_t ExtendedMode; /*!< Enables or disables the extended mode. |
161 | uint32_t ExtendedMode; /*!< Enables or disables the extended mode. |
| 216 | This parameter can be a value of @ref FSMC_Extended_Mode */ |
162 | This parameter can be a value of @ref FSMC_Extended_Mode */ |
| 217 | 163 | ||
| 218 | uint32_t AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers, |
164 | uint32_t AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers, |
| 219 | valid only with asynchronous Flash memories. |
165 | valid only with asynchronous Flash memories. |
| 220 | This parameter can be a value of @ref FSMC_AsynchronousWait */ |
166 | This parameter can be a value of @ref FSMC_AsynchronousWait */ |
| 221 | 167 | ||
| 222 | uint32_t WriteBurst; /*!< Enables or disables the write burst operation. |
168 | uint32_t WriteBurst; /*!< Enables or disables the write burst operation. |
| 223 | This parameter can be a value of @ref FSMC_Write_Burst */ |
169 | This parameter can be a value of @ref FSMC_Write_Burst */ |
| 224 | 170 | ||
| - | 171 | ||
| - | 172 | uint32_t PageSize; /*!< Specifies the memory page size. |
|
| - | 173 | This parameter can be a value of @ref FSMC_Page_Size */ |
|
| 225 | }FSMC_NORSRAM_InitTypeDef; |
174 | } FSMC_NORSRAM_InitTypeDef; |
| 226 | 175 | ||
| 227 | /** |
176 | /** |
| 228 | * @brief FSMC_NORSRAM Timing parameters structure definition |
177 | * @brief FSMC NORSRAM Timing parameters structure definition |
| 229 | */ |
178 | */ |
| 230 | typedef struct |
179 | typedef struct |
| 231 | { |
180 | { |
| 232 | uint32_t AddressSetupTime; /*!< Defines the number of HCLK cycles to configure |
181 | uint32_t AddressSetupTime; /*!< Defines the number of HCLK cycles to configure |
| 233 | the duration of the address setup time. |
182 | the duration of the address setup time. |
| 234 | This parameter can be a value between Min_Data = 0 and Max_Data = 15. |
183 | This parameter can be a value between Min_Data = 0 and Max_Data = 15. |
| 235 | @note This parameter is not used with synchronous NOR Flash memories. */ |
184 | @note This parameter is not used with synchronous NOR Flash memories. */ |
| 236 | 185 | ||
| 237 | uint32_t AddressHoldTime; /*!< Defines the number of HCLK cycles to configure |
186 | uint32_t AddressHoldTime; /*!< Defines the number of HCLK cycles to configure |
| 238 | the duration of the address hold time. |
187 | the duration of the address hold time. |
| 239 | This parameter can be a value between Min_Data = 1 and Max_Data = 15. |
188 | This parameter can be a value between Min_Data = 1 and Max_Data = 15. |
| 240 | @note This parameter is not used with synchronous NOR Flash memories. */ |
189 | @note This parameter is not used with synchronous NOR Flash memories. */ |
| 241 | 190 | ||
| 242 | uint32_t DataSetupTime; /*!< Defines the number of HCLK cycles to configure |
191 | uint32_t DataSetupTime; /*!< Defines the number of HCLK cycles to configure |
| 243 | the duration of the data setup time. |
192 | the duration of the data setup time. |
| 244 | This parameter can be a value between Min_Data = 1 and Max_Data = 255. |
193 | This parameter can be a value between Min_Data = 1 and Max_Data = 255. |
| 245 | @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed |
194 | @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed |
| 246 | NOR Flash memories. */ |
195 | NOR Flash memories. */ |
| 247 | 196 | ||
| 248 | uint32_t BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure |
197 | uint32_t BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure |
| 249 | the duration of the bus turnaround. |
198 | the duration of the bus turnaround. |
| 250 | This parameter can be a value between Min_Data = 0 and Max_Data = 15. |
199 | This parameter can be a value between Min_Data = 0 and Max_Data = 15. |
| 251 | @note This parameter is only used for multiplexed NOR Flash memories. */ |
200 | @note This parameter is only used for multiplexed NOR Flash memories. */ |
| 252 | 201 | ||
| 253 | uint32_t CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of |
202 | uint32_t CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of |
| 254 | HCLK cycles. This parameter can be a value between Min_Data = 2 and Max_Data = 16. |
203 | HCLK cycles. This parameter can be a value between Min_Data = 2 and |
| - | 204 | Max_Data = 16. |
|
| 255 | @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM |
205 | @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM |
| 256 | accesses. */ |
206 | accesses. */ |
| 257 | 207 | ||
| 258 | uint32_t DataLatency; /*!< Defines the number of memory clock cycles to issue |
208 | uint32_t DataLatency; /*!< Defines the number of memory clock cycles to issue |
| 259 | to the memory before getting the first data. |
209 | to the memory before getting the first data. |
| 260 | The parameter value depends on the memory type as shown below: |
210 | The parameter value depends on the memory type as shown below: |
| 261 | - It must be set to 0 in case of a CRAM |
211 | - It must be set to 0 in case of a CRAM |
| 262 | - It is don't care in asynchronous NOR, SRAM or ROM accesses |
212 | - It is don't care in asynchronous NOR, SRAM or ROM accesses |
| 263 | - It may assume a value between Min_Data = 2 and Max_Data = 17 in NOR Flash memories |
213 | - It may assume a value between Min_Data = 2 and Max_Data = 17 |
| 264 | with synchronous burst mode enable */ |
214 | in NOR Flash memories with synchronous burst mode enable */ |
| 265 | 215 | ||
| 266 | uint32_t AccessMode; /*!< Specifies the asynchronous access mode. |
216 | uint32_t AccessMode; /*!< Specifies the asynchronous access mode. |
| 267 | This parameter can be a value of @ref FSMC_Access_Mode */ |
217 | This parameter can be a value of @ref FSMC_Access_Mode */ |
| - | 218 | } FSMC_NORSRAM_TimingTypeDef; |
|
| - | 219 | #endif /* FSMC_BANK1 */ |
|
| - | 220 | ||
| - | 221 | ||
| 268 | 222 | ||
| 269 | }FSMC_NORSRAM_TimingTypeDef; |
- | |
| 270 | 223 | ||
| 271 | /** |
224 | /** |
| 272 | * @} |
225 | * @} |
| 273 | */ |
226 | */ |
| 274 | 227 | ||
| 275 | /* Exported constants --------------------------------------------------------*/ |
228 | /* Exported constants --------------------------------------------------------*/ |
| 276 | - | ||
| 277 | /** @defgroup FSMC_Exported_Constants FSMC Low Layer Exported Constants |
229 | /** @addtogroup FSMC_LL_Exported_Constants FSMC Low Layer Exported Constants |
| 278 | * @{ |
230 | * @{ |
| 279 | */ |
231 | */ |
| - | 232 | #if defined(FSMC_BANK1) |
|
| 280 | 233 | ||
| 281 | /** @defgroup FSMC_NORSRAM_Exported_constants FSMC NOR/SRAM Exported constants |
234 | /** @defgroup FSMC_LL_NOR_SRAM_Controller FSMC NOR/SRAM Controller |
| 282 | * @{ |
235 | * @{ |
| 283 | */ |
236 | */ |
| 284 | 237 | ||
| 285 | /** @defgroup FSMC_NORSRAM_Bank FSMC NOR/SRAM Bank |
238 | /** @defgroup FSMC_NORSRAM_Bank FSMC NOR/SRAM Bank |
| 286 | * @{ |
239 | * @{ |
| 287 | */ |
240 | */ |
| 288 | #define FSMC_NORSRAM_BANK1 (0x00000000U) |
241 | #define FSMC_NORSRAM_BANK1 (0x00000000U) |
| 289 | #define FSMC_NORSRAM_BANK2 (0x00000002U) |
242 | #define FSMC_NORSRAM_BANK2 (0x00000002U) |
| 290 | #define FSMC_NORSRAM_BANK3 (0x00000004U) |
243 | #define FSMC_NORSRAM_BANK3 (0x00000004U) |
| 291 | #define FSMC_NORSRAM_BANK4 (0x00000006U) |
244 | #define FSMC_NORSRAM_BANK4 (0x00000006U) |
| 292 | - | ||
| 293 | /** |
245 | /** |
| 294 | * @} |
246 | * @} |
| 295 | */ |
247 | */ |
| 296 | 248 | ||
| 297 | /** @defgroup FSMC_Data_Address_Bus_Multiplexing FSMC Data Address Bus Multiplexing |
249 | /** @defgroup FSMC_Data_Address_Bus_Multiplexing FSMC Data Address Bus Multiplexing |
| 298 | * @{ |
250 | * @{ |
| 299 | */ |
251 | */ |
| 300 | - | ||
| 301 | #define FSMC_DATA_ADDRESS_MUX_DISABLE (0x00000000U) |
252 | #define FSMC_DATA_ADDRESS_MUX_DISABLE (0x00000000U) |
| 302 | #define FSMC_DATA_ADDRESS_MUX_ENABLE ((uint32_t)FSMC_BCRx_MUXEN) |
253 | #define FSMC_DATA_ADDRESS_MUX_ENABLE (0x00000002U) |
| 303 | - | ||
| 304 | /** |
254 | /** |
| 305 | * @} |
255 | * @} |
| 306 | */ |
256 | */ |
| 307 | 257 | ||
| 308 | /** @defgroup FSMC_Memory_Type FSMC Memory Type |
258 | /** @defgroup FSMC_Memory_Type FSMC Memory Type |
| 309 | * @{ |
259 | * @{ |
| 310 | */ |
260 | */ |
| 311 | - | ||
| 312 | #define FSMC_MEMORY_TYPE_SRAM (0x00000000U) |
261 | #define FSMC_MEMORY_TYPE_SRAM (0x00000000U) |
| 313 | #define FSMC_MEMORY_TYPE_PSRAM ((uint32_t)FSMC_BCRx_MTYP_0) |
262 | #define FSMC_MEMORY_TYPE_PSRAM (0x00000004U) |
| 314 | #define FSMC_MEMORY_TYPE_NOR ((uint32_t)FSMC_BCRx_MTYP_1) |
263 | #define FSMC_MEMORY_TYPE_NOR (0x00000008U) |
| 315 | - | ||
| 316 | /** |
264 | /** |
| 317 | * @} |
265 | * @} |
| 318 | */ |
266 | */ |
| 319 | 267 | ||
| 320 | /** @defgroup FSMC_NORSRAM_Data_Width FSMC NOR/SRAM Data Width |
268 | /** @defgroup FSMC_NORSRAM_Data_Width FSMC NORSRAM Data Width |
| 321 | * @{ |
269 | * @{ |
| 322 | */ |
270 | */ |
| 323 | - | ||
| 324 | #define FSMC_NORSRAM_MEM_BUS_WIDTH_8 (0x00000000U) |
271 | #define FSMC_NORSRAM_MEM_BUS_WIDTH_8 (0x00000000U) |
| 325 | #define FSMC_NORSRAM_MEM_BUS_WIDTH_16 ((uint32_t)FSMC_BCRx_MWID_0) |
272 | #define FSMC_NORSRAM_MEM_BUS_WIDTH_16 (0x00000010U) |
| 326 | #define FSMC_NORSRAM_MEM_BUS_WIDTH_32 ((uint32_t)FSMC_BCRx_MWID_1) |
273 | #define FSMC_NORSRAM_MEM_BUS_WIDTH_32 (0x00000020U) |
| 327 | - | ||
| 328 | /** |
274 | /** |
| 329 | * @} |
275 | * @} |
| 330 | */ |
276 | */ |
| 331 | 277 | ||
| 332 | /** @defgroup FSMC_NORSRAM_Flash_Access FSMC NOR/SRAM Flash Access |
278 | /** @defgroup FSMC_NORSRAM_Flash_Access FSMC NOR/SRAM Flash Access |
| 333 | * @{ |
279 | * @{ |
| 334 | */ |
280 | */ |
| 335 | - | ||
| 336 | #define FSMC_NORSRAM_FLASH_ACCESS_ENABLE ((uint32_t)FSMC_BCRx_FACCEN) |
281 | #define FSMC_NORSRAM_FLASH_ACCESS_ENABLE (0x00000040U) |
| 337 | #define FSMC_NORSRAM_FLASH_ACCESS_DISABLE (0x00000000U) |
282 | #define FSMC_NORSRAM_FLASH_ACCESS_DISABLE (0x00000000U) |
| 338 | /** |
283 | /** |
| 339 | * @} |
284 | * @} |
| 340 | */ |
285 | */ |
| 341 | 286 | ||
| 342 | /** @defgroup FSMC_Burst_Access_Mode FSMC Burst Access Mode |
287 | /** @defgroup FSMC_Burst_Access_Mode FSMC Burst Access Mode |
| 343 | * @{ |
288 | * @{ |
| 344 | */ |
289 | */ |
| 345 | - | ||
| 346 | #define FSMC_BURST_ACCESS_MODE_DISABLE (0x00000000U) |
290 | #define FSMC_BURST_ACCESS_MODE_DISABLE (0x00000000U) |
| 347 | #define FSMC_BURST_ACCESS_MODE_ENABLE ((uint32_t)FSMC_BCRx_BURSTEN) |
291 | #define FSMC_BURST_ACCESS_MODE_ENABLE (0x00000100U) |
| 348 | - | ||
| 349 | /** |
292 | /** |
| 350 | * @} |
293 | * @} |
| 351 | */ |
294 | */ |
| 352 | 295 | ||
| 353 | - | ||
| 354 | /** @defgroup FSMC_Wait_Signal_Polarity FSMC Wait Signal Polarity |
296 | /** @defgroup FSMC_Wait_Signal_Polarity FSMC Wait Signal Polarity |
| 355 | * @{ |
297 | * @{ |
| 356 | */ |
298 | */ |
| 357 | - | ||
| 358 | #define FSMC_WAIT_SIGNAL_POLARITY_LOW (0x00000000U) |
299 | #define FSMC_WAIT_SIGNAL_POLARITY_LOW (0x00000000U) |
| 359 | #define FSMC_WAIT_SIGNAL_POLARITY_HIGH ((uint32_t)FSMC_BCRx_WAITPOL) |
300 | #define FSMC_WAIT_SIGNAL_POLARITY_HIGH (0x00000200U) |
| 360 | - | ||
| 361 | /** |
301 | /** |
| 362 | * @} |
302 | * @} |
| 363 | */ |
303 | */ |
| 364 | 304 | ||
| 365 | /** @defgroup FSMC_Wrap_Mode FSMC Wrap Mode |
305 | /** @defgroup FSMC_Wrap_Mode FSMC Wrap Mode |
| 366 | * @{ |
306 | * @{ |
| 367 | */ |
307 | */ |
| 368 | - | ||
| 369 | #define FSMC_WRAP_MODE_DISABLE (0x00000000U) |
308 | #define FSMC_WRAP_MODE_DISABLE (0x00000000U) |
| 370 | #define FSMC_WRAP_MODE_ENABLE ((uint32_t)FSMC_BCRx_WRAPMOD) |
309 | #define FSMC_WRAP_MODE_ENABLE (0x00000400U) |
| 371 | - | ||
| 372 | /** |
310 | /** |
| 373 | * @} |
311 | * @} |
| 374 | */ |
312 | */ |
| 375 | 313 | ||
| 376 | /** @defgroup FSMC_Wait_Timing FSMC Wait Timing |
314 | /** @defgroup FSMC_Wait_Timing FSMC Wait Timing |
| 377 | * @{ |
315 | * @{ |
| 378 | */ |
316 | */ |
| 379 | - | ||
| 380 | #define FSMC_WAIT_TIMING_BEFORE_WS (0x00000000U) |
317 | #define FSMC_WAIT_TIMING_BEFORE_WS (0x00000000U) |
| 381 | #define FSMC_WAIT_TIMING_DURING_WS ((uint32_t)FSMC_BCRx_WAITCFG) |
318 | #define FSMC_WAIT_TIMING_DURING_WS (0x00000800U) |
| 382 | - | ||
| 383 | /** |
319 | /** |
| 384 | * @} |
320 | * @} |
| 385 | */ |
321 | */ |
| 386 | 322 | ||
| 387 | /** @defgroup FSMC_Write_Operation FSMC Write Operation |
323 | /** @defgroup FSMC_Write_Operation FSMC Write Operation |
| 388 | * @{ |
324 | * @{ |
| 389 | */ |
325 | */ |
| 390 | - | ||
| 391 | #define FSMC_WRITE_OPERATION_DISABLE (0x00000000U) |
326 | #define FSMC_WRITE_OPERATION_DISABLE (0x00000000U) |
| 392 | #define FSMC_WRITE_OPERATION_ENABLE ((uint32_t)FSMC_BCRx_WREN) |
327 | #define FSMC_WRITE_OPERATION_ENABLE (0x00001000U) |
| 393 | - | ||
| 394 | /** |
328 | /** |
| 395 | * @} |
329 | * @} |
| 396 | */ |
330 | */ |
| 397 | 331 | ||
| 398 | /** @defgroup FSMC_Wait_Signal FSMC Wait Signal |
332 | /** @defgroup FSMC_Wait_Signal FSMC Wait Signal |
| 399 | * @{ |
333 | * @{ |
| 400 | */ |
334 | */ |
| 401 | - | ||
| 402 | #define FSMC_WAIT_SIGNAL_DISABLE (0x00000000U) |
335 | #define FSMC_WAIT_SIGNAL_DISABLE (0x00000000U) |
| 403 | #define FSMC_WAIT_SIGNAL_ENABLE ((uint32_t)FSMC_BCRx_WAITEN) |
336 | #define FSMC_WAIT_SIGNAL_ENABLE (0x00002000U) |
| 404 | - | ||
| 405 | /** |
337 | /** |
| 406 | * @} |
338 | * @} |
| 407 | */ |
339 | */ |
| 408 | 340 | ||
| 409 | /** @defgroup FSMC_Extended_Mode FSMC Extended Mode |
341 | /** @defgroup FSMC_Extended_Mode FSMC Extended Mode |
| 410 | * @{ |
342 | * @{ |
| 411 | */ |
343 | */ |
| 412 | - | ||
| 413 | #define FSMC_EXTENDED_MODE_DISABLE (0x00000000U) |
344 | #define FSMC_EXTENDED_MODE_DISABLE (0x00000000U) |
| 414 | #define FSMC_EXTENDED_MODE_ENABLE ((uint32_t)FSMC_BCRx_EXTMOD) |
345 | #define FSMC_EXTENDED_MODE_ENABLE (0x00004000U) |
| 415 | - | ||
| 416 | /** |
346 | /** |
| 417 | * @} |
347 | * @} |
| 418 | */ |
348 | */ |
| 419 | 349 | ||
| 420 | /** @defgroup FSMC_AsynchronousWait FSMC Asynchronous Wait |
350 | /** @defgroup FSMC_AsynchronousWait FSMC Asynchronous Wait |
| 421 | * @{ |
351 | * @{ |
| 422 | */ |
352 | */ |
| 423 | - | ||
| 424 | #define FSMC_ASYNCHRONOUS_WAIT_DISABLE (0x00000000U) |
353 | #define FSMC_ASYNCHRONOUS_WAIT_DISABLE (0x00000000U) |
| 425 | #define FSMC_ASYNCHRONOUS_WAIT_ENABLE ((uint32_t)FSMC_BCRx_ASYNCWAIT) |
354 | #define FSMC_ASYNCHRONOUS_WAIT_ENABLE (0x00008000U) |
| - | 355 | /** |
|
| - | 356 | * @} |
|
| - | 357 | */ |
|
| 426 | 358 | ||
| - | 359 | /** @defgroup FSMC_Page_Size FSMC Page Size |
|
| - | 360 | * @{ |
|
| - | 361 | */ |
|
| - | 362 | #define FSMC_PAGE_SIZE_NONE (0x00000000U) |
|
| - | 363 | #define FSMC_PAGE_SIZE_128 FSMC_BCRx_CPSIZE_0 |
|
| - | 364 | #define FSMC_PAGE_SIZE_256 FSMC_BCRx_CPSIZE_1 |
|
| - | 365 | #define FSMC_PAGE_SIZE_512 (FSMC_BCRx_CPSIZE_0\ |
|
| - | 366 | | FSMC_BCRx_CPSIZE_1) |
|
| - | 367 | #define FSMC_PAGE_SIZE_1024 FSMC_BCRx_CPSIZE_2 |
|
| 427 | /** |
368 | /** |
| 428 | * @} |
369 | * @} |
| 429 | */ |
370 | */ |
| 430 | 371 | ||
| 431 | /** @defgroup FSMC_Write_Burst FSMC Write Burst |
372 | /** @defgroup FSMC_Write_Burst FSMC Write Burst |
| 432 | * @{ |
373 | * @{ |
| 433 | */ |
374 | */ |
| 434 | - | ||
| 435 | #define FSMC_WRITE_BURST_DISABLE (0x00000000U) |
375 | #define FSMC_WRITE_BURST_DISABLE (0x00000000U) |
| 436 | #define FSMC_WRITE_BURST_ENABLE ((uint32_t)FSMC_BCRx_CBURSTRW) |
376 | #define FSMC_WRITE_BURST_ENABLE (0x00080000U) |
| - | 377 | /** |
|
| - | 378 | * @} |
|
| - | 379 | */ |
|
| 437 | 380 | ||
| - | 381 | /** @defgroup FSMC_Continous_Clock FSMC Continuous Clock |
|
| - | 382 | * @{ |
|
| - | 383 | */ |
|
| - | 384 | #define FSMC_CONTINUOUS_CLOCK_SYNC_ONLY (0x00000000U) |
|
| - | 385 | #define FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC (0x00100000U) |
|
| 438 | /** |
386 | /** |
| 439 | * @} |
387 | * @} |
| 440 | */ |
388 | */ |
| 441 | 389 | ||
| 442 | /** @defgroup FSMC_Access_Mode FSMC Access Mode |
390 | /** @defgroup FSMC_Access_Mode FSMC Access Mode |
| 443 | * @{ |
391 | * @{ |
| 444 | */ |
392 | */ |
| 445 | - | ||
| 446 | #define FSMC_ACCESS_MODE_A (0x00000000U) |
393 | #define FSMC_ACCESS_MODE_A (0x00000000U) |
| 447 | #define FSMC_ACCESS_MODE_B ((uint32_t)FSMC_BTRx_ACCMOD_0) |
394 | #define FSMC_ACCESS_MODE_B (0x10000000U) |
| 448 | #define FSMC_ACCESS_MODE_C ((uint32_t)FSMC_BTRx_ACCMOD_1) |
395 | #define FSMC_ACCESS_MODE_C (0x20000000U) |
| 449 | #define FSMC_ACCESS_MODE_D ((uint32_t)(FSMC_BTRx_ACCMOD_0 | FSMC_BTRx_ACCMOD_1)) |
396 | #define FSMC_ACCESS_MODE_D (0x30000000U) |
| - | 397 | /** |
|
| - | 398 | * @} |
|
| - | 399 | */ |
|
| 450 | 400 | ||
| 451 | /** |
401 | /** |
| 452 | * @} |
402 | * @} |
| 453 | */ |
403 | */ |
| - | 404 | #endif /* FSMC_BANK1 */ |
|
| - | 405 | ||
| 454 | 406 | ||
| - | 407 | ||
| - | 408 | /** @defgroup FSMC_LL_Interrupt_definition FSMC Low Layer Interrupt definition |
|
| - | 409 | * @{ |
|
| - | 410 | */ |
|
| 455 | /** |
411 | /** |
| 456 | * @} |
412 | * @} |
| 457 | */ |
413 | */ |
| 458 | 414 | ||
| - | 415 | /** @defgroup FSMC_LL_Flag_definition FSMC Low Layer Flag definition |
|
| - | 416 | * @{ |
|
| - | 417 | */ |
|
| - | 418 | /** |
|
| - | 419 | * @} |
|
| - | 420 | */ |
|
| 459 | 421 | ||
| 460 | /** |
422 | /** |
| 461 | * @} |
423 | * @} |
| 462 | */ |
424 | */ |
| 463 | 425 | ||
| 464 | /* Exported macro ------------------------------------------------------------*/ |
- | |
| - | 426 | /** |
|
| - | 427 | * @} |
|
| - | 428 | */ |
|
| 465 | 429 | ||
| - | 430 | /* Private macro -------------------------------------------------------------*/ |
|
| 466 | /** @defgroup FSMC_Exported_Macros FSMC Low Layer Exported Macros |
431 | /** @defgroup FSMC_LL_Private_Macros FSMC_LL Private Macros |
| - | 432 | * @{ |
|
| - | 433 | */ |
|
| - | 434 | #if defined(FSMC_BANK1) |
|
| - | 435 | /** @defgroup FSMC_LL_NOR_Macros FSMC NOR/SRAM Macros |
|
| - | 436 | * @brief macros to handle NOR device enable/disable and read/write operations |
|
| 467 | * @{ |
437 | * @{ |
| 468 | */ |
438 | */ |
| 469 | - | ||
| 470 | /** @defgroup FSMC_NOR_Macros FSMC NOR/SRAM Exported Macros |
- | |
| 471 | * @brief macros to handle NOR device enable/disable and read/write operations |
- | |
| 472 | * @{ |
- | |
| 473 | */ |
- | |
| 474 | 439 | ||
| 475 | /** |
440 | /** |
| 476 | * @brief Enable the NORSRAM device access. |
441 | * @brief Enable the NORSRAM device access. |
| 477 | * @param __INSTANCE__ FSMC_NORSRAM Instance |
442 | * @param __INSTANCE__ FSMC_NORSRAM Instance |
| 478 | * @param __BANK__ FSMC_NORSRAM Bank |
443 | * @param __BANK__ FSMC_NORSRAM Bank |
| 479 | * @retval none |
444 | * @retval None |
| 480 | */ |
445 | */ |
| 481 | #define __FSMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__) SET_BIT((__INSTANCE__)->BTCR[(__BANK__)], FSMC_BCRx_MBKEN) |
446 | #define __FSMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)]\ |
| - | 447 | |= FSMC_BCRx_MBKEN) |
|
| 482 | 448 | ||
| 483 | /** |
449 | /** |
| 484 | * @brief Disable the NORSRAM device access. |
450 | * @brief Disable the NORSRAM device access. |
| 485 | * @param __INSTANCE__ FSMC_NORSRAM Instance |
451 | * @param __INSTANCE__ FSMC_NORSRAM Instance |
| 486 | * @param __BANK__ FSMC_NORSRAM Bank |
452 | * @param __BANK__ FSMC_NORSRAM Bank |
| 487 | * @retval none |
453 | * @retval None |
| 488 | */ |
454 | */ |
| 489 | #define __FSMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) CLEAR_BIT((__INSTANCE__)->BTCR[(__BANK__)], FSMC_BCRx_MBKEN) |
455 | #define __FSMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)]\ |
| - | 456 | &= ~FSMC_BCRx_MBKEN) |
|
| 490 | 457 | ||
| 491 | /** |
458 | /** |
| 492 | * @} |
459 | * @} |
| 493 | */ |
460 | */ |
| - | 461 | #endif /* FSMC_BANK1 */ |
|
| - | 462 | ||
| - | 463 | ||
| 494 | 464 | ||
| 495 | 465 | ||
| 496 | /** |
466 | /** |
| 497 | * @} |
467 | * @} |
| 498 | */ |
468 | */ |
| 499 | 469 | ||
| 500 | /* Exported functions --------------------------------------------------------*/ |
- | |
| 501 | - | ||
| 502 | /** @addtogroup FSMC_LL_Exported_Functions |
- | |
| 503 | * @{ |
- | |
| 504 | */ |
470 | /** |
| 505 | - | ||
| 506 | /** @addtogroup FSMC_NORSRAM |
- | |
| 507 | * @{ |
- | |
| 508 | */ |
- | |
| 509 | - | ||
| 510 | /** @addtogroup FSMC_NORSRAM_Group1 |
- | |
| 511 | * @{ |
471 | * @} |
| 512 | */ |
472 | */ |
| 513 | 473 | ||
| 514 | /* FSMC_NORSRAM Controller functions ******************************************/ |
474 | /* Private functions ---------------------------------------------------------*/ |
| 515 | /* Initialization/de-initialization functions */ |
475 | /** @defgroup FSMC_LL_Private_Functions FSMC LL Private Functions |
| 516 | HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_InitTypeDef *Init); |
- | |
| 517 | HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank); |
- | |
| 518 | HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode); |
- | |
| 519 | HAL_StatusTypeDef FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank); |
- | |
| - | 476 | * @{ |
|
| - | 477 | */ |
|
| 520 | 478 | ||
| - | 479 | #if defined(FSMC_BANK1) |
|
| - | 480 | /** @defgroup FSMC_LL_NORSRAM NOR SRAM |
|
| - | 481 | * @{ |
|
| - | 482 | */ |
|
| - | 483 | /** @defgroup FSMC_LL_NORSRAM_Private_Functions_Group1 NOR SRAM Initialization/de-initialization functions |
|
| - | 484 | * @{ |
|
| - | 485 | */ |
|
| - | 486 | HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, |
|
| - | 487 | FSMC_NORSRAM_InitTypeDef *Init); |
|
| - | 488 | HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, |
|
| - | 489 | FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank); |
|
| - | 490 | HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, |
|
| - | 491 | FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, |
|
| - | 492 | uint32_t ExtendedMode); |
|
| - | 493 | HAL_StatusTypeDef FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, |
|
| - | 494 | FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank); |
|
| 521 | /** |
495 | /** |
| 522 | * @} |
496 | * @} |
| 523 | */ |
497 | */ |
| 524 | 498 | ||
| 525 | /** @addtogroup FSMC_NORSRAM_Group2 |
499 | /** @defgroup FSMC_LL_NORSRAM_Private_Functions_Group2 NOR SRAM Control functions |
| 526 | * @{ |
500 | * @{ |
| 527 | */ |
501 | */ |
| 528 | - | ||
| 529 | /* FSMC_NORSRAM Control functions */ |
- | |
| 530 | HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank); |
502 | HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank); |
| 531 | HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank); |
503 | HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank); |
| 532 | - | ||
| 533 | /** |
504 | /** |
| 534 | * @} |
505 | * @} |
| 535 | */ |
506 | */ |
| 536 | - | ||
| 537 | /** |
507 | /** |
| 538 | * @} |
508 | * @} |
| 539 | */ |
509 | */ |
| - | 510 | #endif /* FSMC_BANK1 */ |
|
| - | 511 | ||
| - | 512 | ||
| - | 513 | ||
| 540 | 514 | ||
| 541 | /** |
515 | /** |
| 542 | * @} |
516 | * @} |
| 543 | */ |
517 | */ |
| 544 | 518 | ||
| 545 | /** |
519 | /** |
| 546 | * @} |
520 | * @} |
| 547 | */ |
521 | */ |
| 548 | 522 | ||
| 549 | #endif /* FSMC_BANK1 */ |
- | |
| 550 | - | ||
| 551 | /** |
523 | /** |
| 552 | * @} |
524 | * @} |
| 553 | */ |
525 | */ |
| 554 | 526 | ||
| 555 | #ifdef __cplusplus |
527 | #ifdef __cplusplus |
| 556 | } |
528 | } |
| 557 | #endif |
529 | #endif |
| 558 | 530 | ||
| 559 | #endif /* __STM32L1xx_LL_FSMC_H */ |
531 | #endif /* STM32L1xx_LL_FSMC_H */ |
| 560 | 532 | ||
| 561 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
533 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| 562 | - | ||