CARME-M4 BSP  V1.5
stm32f4xx_syscfg.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F4xx_SYSCFG_H
31 #define __STM32F4xx_SYSCFG_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f4xx.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 /* Exported constants --------------------------------------------------------*/
50 
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)
69 
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))
81 
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))
122 
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)
134 
135 #if defined (STM32F40_41xxx)
136 #define SYSCFG_MemoryRemap_FSMC ((uint8_t)0x02)
137 #endif /* STM32F40_41xxx */
138 
139 #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
140 #define SYSCFG_MemoryRemap_FMC ((uint8_t)0x02)
141 #endif /* STM32F427_437xx || STM32F429_439xx */
142 
143 #if defined (STM32F40_41xxx)
144 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
145  ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
146  ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
147  ((REMAP) == SYSCFG_MemoryRemap_FSMC))
148 #endif /* STM32F40_41xxx */
149 
150 #if defined (STM32F401xx)
151 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
152  ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
153  ((REMAP) == SYSCFG_MemoryRemap_SRAM))
154 #endif /* STM32F401xx */
155 
156 #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
157 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
158  ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
159  ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
160  ((REMAP) == SYSCFG_MemoryRemap_SDRAM) || \
161  ((REMAP) == SYSCFG_MemoryRemap_FMC))
162 #endif /* STM32F427_437xx || STM32F429_439xx */
163 
172 #define SYSCFG_ETH_MediaInterface_MII ((uint32_t)0x00000000)
173 #define SYSCFG_ETH_MediaInterface_RMII ((uint32_t)0x00000001)
174 
175 #define IS_SYSCFG_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == SYSCFG_ETH_MediaInterface_MII) || \
176  ((INTERFACE) == SYSCFG_ETH_MediaInterface_RMII))
177 
185 /* Exported macro ------------------------------------------------------------*/
186 /* Exported functions --------------------------------------------------------*/
187 
188 void SYSCFG_DeInit(void);
189 void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap);
190 void SYSCFG_MemorySwappingBank(FunctionalState NewState);
191 void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
192 void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface);
193 void SYSCFG_CompensationCellCmd(FunctionalState NewState);
194 FlagStatus SYSCFG_GetCompensationCellStatus(void);
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /*__STM32F4xx_SYSCFG_H */
201 
210 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex)
Selects the GPIO pin used as EXTI Line.
void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap)
Changes the mapping of the specified pin.
FlagStatus SYSCFG_GetCompensationCellStatus(void)
Checks whether the I/O Compensation Cell ready flag is set or not.
void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface)
Selects the ETHERNET media interface.
void SYSCFG_CompensationCellCmd(FunctionalState NewState)
Enables or disables the I/O Compensation Cell.
void SYSCFG_MemorySwappingBank(FunctionalState NewState)
Enables or disables the Interal FLASH Bank Swapping.
void SYSCFG_DeInit(void)
Deinitializes the Alternate Functions (remap and EXTI configuration) registers to their default reset...