Merge pull request #11270 from haslinghuis/rename_attr
[betaflight.git] / lib / main / STM32F4 / Drivers / STM32F4xx_StdPeriph_Driver / inc / stm32f4xx_syscfg.h
blob62d4df1047593a1516d2cb3c600f52e6a33f6ecc
1 /**
2 ******************************************************************************
3 * @file stm32f4xx_syscfg.h
4 * @author MCD Application Team
5 * @version V1.7.1
6 * @date 20-May-2016
7 * @brief This file contains all the functions prototypes for the SYSCFG firmware
8 * library.
9 ******************************************************************************
10 * @attention
12 * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15 * You may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at:
18 * http://www.st.com/software_license_agreement_liberty_v2
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
26 ******************************************************************************
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F4xx_SYSCFG_H
31 #define __STM32F4xx_SYSCFG_H
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f4xx.h"
40 /** @addtogroup STM32F4xx_StdPeriph_Driver
41 * @{
44 /** @addtogroup SYSCFG
45 * @{
46 */
48 /* Exported types ------------------------------------------------------------*/
49 /* Exported constants --------------------------------------------------------*/
51 /** @defgroup SYSCFG_Exported_Constants
52 * @{
53 */
55 /** @defgroup SYSCFG_EXTI_Port_Sources
56 * @{
57 */
58 #define EXTI_PortSourceGPIOA ((uint8_t)0x00)
59 #define EXTI_PortSourceGPIOB ((uint8_t)0x01)
60 #define EXTI_PortSourceGPIOC ((uint8_t)0x02)
61 #define EXTI_PortSourceGPIOD ((uint8_t)0x03)
62 #define EXTI_PortSourceGPIOE ((uint8_t)0x04)
63 #define EXTI_PortSourceGPIOF ((uint8_t)0x05)
64 #define EXTI_PortSourceGPIOG ((uint8_t)0x06)
65 #define EXTI_PortSourceGPIOH ((uint8_t)0x07)
66 #define EXTI_PortSourceGPIOI ((uint8_t)0x08)
67 #define EXTI_PortSourceGPIOJ ((uint8_t)0x09)
68 #define EXTI_PortSourceGPIOK ((uint8_t)0x0A)
70 #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
71 ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
72 ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
73 ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
74 ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
75 ((PORTSOURCE) == EXTI_PortSourceGPIOF) || \
76 ((PORTSOURCE) == EXTI_PortSourceGPIOG) || \
77 ((PORTSOURCE) == EXTI_PortSourceGPIOH) || \
78 ((PORTSOURCE) == EXTI_PortSourceGPIOI) || \
79 ((PORTSOURCE) == EXTI_PortSourceGPIOJ) || \
80 ((PORTSOURCE) == EXTI_PortSourceGPIOK))
82 /**
83 * @}
84 */
87 /** @defgroup SYSCFG_EXTI_Pin_Sources
88 * @{
89 */
90 #define EXTI_PinSource0 ((uint8_t)0x00)
91 #define EXTI_PinSource1 ((uint8_t)0x01)
92 #define EXTI_PinSource2 ((uint8_t)0x02)
93 #define EXTI_PinSource3 ((uint8_t)0x03)
94 #define EXTI_PinSource4 ((uint8_t)0x04)
95 #define EXTI_PinSource5 ((uint8_t)0x05)
96 #define EXTI_PinSource6 ((uint8_t)0x06)
97 #define EXTI_PinSource7 ((uint8_t)0x07)
98 #define EXTI_PinSource8 ((uint8_t)0x08)
99 #define EXTI_PinSource9 ((uint8_t)0x09)
100 #define EXTI_PinSource10 ((uint8_t)0x0A)
101 #define EXTI_PinSource11 ((uint8_t)0x0B)
102 #define EXTI_PinSource12 ((uint8_t)0x0C)
103 #define EXTI_PinSource13 ((uint8_t)0x0D)
104 #define EXTI_PinSource14 ((uint8_t)0x0E)
105 #define EXTI_PinSource15 ((uint8_t)0x0F)
106 #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
107 ((PINSOURCE) == EXTI_PinSource1) || \
108 ((PINSOURCE) == EXTI_PinSource2) || \
109 ((PINSOURCE) == EXTI_PinSource3) || \
110 ((PINSOURCE) == EXTI_PinSource4) || \
111 ((PINSOURCE) == EXTI_PinSource5) || \
112 ((PINSOURCE) == EXTI_PinSource6) || \
113 ((PINSOURCE) == EXTI_PinSource7) || \
114 ((PINSOURCE) == EXTI_PinSource8) || \
115 ((PINSOURCE) == EXTI_PinSource9) || \
116 ((PINSOURCE) == EXTI_PinSource10) || \
117 ((PINSOURCE) == EXTI_PinSource11) || \
118 ((PINSOURCE) == EXTI_PinSource12) || \
119 ((PINSOURCE) == EXTI_PinSource13) || \
120 ((PINSOURCE) == EXTI_PinSource14) || \
121 ((PINSOURCE) == EXTI_PinSource15))
123 * @}
127 /** @defgroup SYSCFG_Memory_Remap_Config
128 * @{
130 #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
131 #define SYSCFG_MemoryRemap_SystemFlash ((uint8_t)0x01)
132 #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
133 #define SYSCFG_MemoryRemap_SDRAM ((uint8_t)0x04)
135 #if defined (STM32F40_41xxx) || defined(STM32F412xG)
136 #define SYSCFG_MemoryRemap_FSMC ((uint8_t)0x02)
137 #endif /* STM32F40_41xxx || STM32F412xG */
139 #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
140 #define SYSCFG_MemoryRemap_FMC ((uint8_t)0x02)
141 #endif /* STM32F427_437xx || STM32F429_439xx */
143 #if defined (STM32F446xx) || defined (STM32F469_479xx)
144 #define SYSCFG_MemoryRemap_ExtMEM ((uint8_t)0x02)
145 #endif /* STM32F446xx || STM32F469_479xx */
147 #if defined (STM32F40_41xxx) || defined(STM32F412xG)
148 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
149 ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
150 ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
151 ((REMAP) == SYSCFG_MemoryRemap_FSMC))
152 #endif /* STM32F40_41xxx || defined(STM32F412xG */
154 #if defined (STM32F401xx) || defined (STM32F410xx) || defined (STM32F411xE)
155 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
156 ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
157 ((REMAP) == SYSCFG_MemoryRemap_SRAM))
158 #endif /* STM32F401xx || STM32F410xx || STM32F411xE */
160 #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
161 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
162 ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
163 ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
164 ((REMAP) == SYSCFG_MemoryRemap_SDRAM) || \
165 ((REMAP) == SYSCFG_MemoryRemap_FMC))
166 #endif /* STM32F427_437xx || STM32F429_439xx */
168 #if defined (STM32F446xx) || defined (STM32F469_479xx)
169 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
170 ((REMAP) == SYSCFG_MemoryRemap_ExtMEM) || \
171 ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
172 ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
173 ((REMAP) == SYSCFG_MemoryRemap_SDRAM))
174 #endif /* STM32F446xx || STM32F469_479xx */
176 #if defined(STM32F410xx) || defined(STM32F412xG)
177 #define SYSCFG_Break_PVD SYSCFG_CFGR2_PVDL
178 #define SYSCFG_Break_HardFault SYSCFG_CFGR2_CLL
180 #define IS_SYSCFG_LOCK_CONFIG(BREAK) (((BREAK) == SYSCFG_Break_PVD) || \
181 ((BREAK) == SYSCFG_Break_HardFault))
182 #endif /* STM32F410xx || STM32F412xG */
184 * @}
188 /** @defgroup SYSCFG_ETHERNET_Media_Interface
189 * @{
191 #define SYSCFG_ETH_MediaInterface_MII ((uint32_t)0x00000000)
192 #define SYSCFG_ETH_MediaInterface_RMII ((uint32_t)0x00000001)
194 #define IS_SYSCFG_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == SYSCFG_ETH_MediaInterface_MII) || \
195 ((INTERFACE) == SYSCFG_ETH_MediaInterface_RMII))
197 * @}
201 * @}
204 /* Exported macro ------------------------------------------------------------*/
205 /* Exported functions --------------------------------------------------------*/
207 void SYSCFG_DeInit(void);
208 void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap);
209 void SYSCFG_MemorySwappingBank(FunctionalState NewState);
210 void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
211 void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface);
212 void SYSCFG_CompensationCellCmd(FunctionalState NewState);
213 FlagStatus SYSCFG_GetCompensationCellStatus(void);
214 #if defined(STM32F410xx) || defined(STM32F412xG)
215 void SYSCFG_BreakConfig(uint32_t SYSCFG_Break);
216 #endif /* STM32F410xx || STM32F412xG */
217 #ifdef __cplusplus
219 #endif
221 #endif /*__STM32F4xx_SYSCFG_H */
224 * @}
228 * @}
231 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/