1 /** 2 ****************************************************************************** 3 * @file stm32f4xx_syscfg.h 4 * @author MCD Application Team 5 * @version V1.4.0 6 * @date 04-August-2014 7 * @brief This file contains all the functions prototypes for the SYSCFG firmware 8 * library. 9 ****************************************************************************** 10 * @attention 11 * 12 * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> 13 * 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: 17 * 18 * http://www.st.com/software_license_agreement_liberty_v2 19 * 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. 25 * 26 ****************************************************************************** 27 */ 28 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 40 /** @addtogroup STM32F4xx_StdPeriph_Driver 41 * @{ 42 */ 43 44 /** @addtogroup SYSCFG 45 * @{ 46 */ 47 48 /* Exported types ------------------------------------------------------------*/ 49 /* Exported constants --------------------------------------------------------*/ 50 51 /** @defgroup SYSCFG_Exported_Constants 52 * @{ 53 */ 54 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) 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 82 /** 83 * @} 84 */ 85 86 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)) 122 /** 123 * @} 124 */ 125 126 127 /** @defgroup SYSCFG_Memory_Remap_Config 128 * @{ 129 */ 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) || defined (STM32F411xE) 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 || STM32F411xE */ 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 164 /** 165 * @} 166 */ 167 168 169 /** @defgroup SYSCFG_ETHERNET_Media_Interface 170 * @{ 171 */ 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 /** 178 * @} 179 */ 180 181 /** 182 * @} 183 */ 184 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 202 /** 203 * @} 204 */ 205 206 /** 207 * @} 208 */ 209 210 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 211