stm32f4xx_syscfg.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_syscfg.h
  4. * @author MCD Application Team
  5. * @version V1.5.0
  6. * @date 06-March-2015
  7. * @brief This file contains all the functions prototypes for the SYSCFG firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2015 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. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F4xx_SYSCFG_H
  30. #define __STM32F4xx_SYSCFG_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f4xx.h"
  36. /** @addtogroup STM32F4xx_StdPeriph_Driver
  37. * @{
  38. */
  39. /** @addtogroup SYSCFG
  40. * @{
  41. */
  42. /* Exported types ------------------------------------------------------------*/
  43. /* Exported constants --------------------------------------------------------*/
  44. /** @defgroup SYSCFG_Exported_Constants
  45. * @{
  46. */
  47. /** @defgroup SYSCFG_EXTI_Port_Sources
  48. * @{
  49. */
  50. #define EXTI_PortSourceGPIOA ((uint8_t)0x00)
  51. #define EXTI_PortSourceGPIOB ((uint8_t)0x01)
  52. #define EXTI_PortSourceGPIOC ((uint8_t)0x02)
  53. #define EXTI_PortSourceGPIOD ((uint8_t)0x03)
  54. #define EXTI_PortSourceGPIOE ((uint8_t)0x04)
  55. #define EXTI_PortSourceGPIOF ((uint8_t)0x05)
  56. #define EXTI_PortSourceGPIOG ((uint8_t)0x06)
  57. #define EXTI_PortSourceGPIOH ((uint8_t)0x07)
  58. #define EXTI_PortSourceGPIOI ((uint8_t)0x08)
  59. #define EXTI_PortSourceGPIOJ ((uint8_t)0x09)
  60. #define EXTI_PortSourceGPIOK ((uint8_t)0x0A)
  61. #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
  62. ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
  63. ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
  64. ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
  65. ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
  66. ((PORTSOURCE) == EXTI_PortSourceGPIOF) || \
  67. ((PORTSOURCE) == EXTI_PortSourceGPIOG) || \
  68. ((PORTSOURCE) == EXTI_PortSourceGPIOH) || \
  69. ((PORTSOURCE) == EXTI_PortSourceGPIOI) || \
  70. ((PORTSOURCE) == EXTI_PortSourceGPIOJ) || \
  71. ((PORTSOURCE) == EXTI_PortSourceGPIOK))
  72. /**
  73. * @}
  74. */
  75. /** @defgroup SYSCFG_EXTI_Pin_Sources
  76. * @{
  77. */
  78. #define EXTI_PinSource0 ((uint8_t)0x00)
  79. #define EXTI_PinSource1 ((uint8_t)0x01)
  80. #define EXTI_PinSource2 ((uint8_t)0x02)
  81. #define EXTI_PinSource3 ((uint8_t)0x03)
  82. #define EXTI_PinSource4 ((uint8_t)0x04)
  83. #define EXTI_PinSource5 ((uint8_t)0x05)
  84. #define EXTI_PinSource6 ((uint8_t)0x06)
  85. #define EXTI_PinSource7 ((uint8_t)0x07)
  86. #define EXTI_PinSource8 ((uint8_t)0x08)
  87. #define EXTI_PinSource9 ((uint8_t)0x09)
  88. #define EXTI_PinSource10 ((uint8_t)0x0A)
  89. #define EXTI_PinSource11 ((uint8_t)0x0B)
  90. #define EXTI_PinSource12 ((uint8_t)0x0C)
  91. #define EXTI_PinSource13 ((uint8_t)0x0D)
  92. #define EXTI_PinSource14 ((uint8_t)0x0E)
  93. #define EXTI_PinSource15 ((uint8_t)0x0F)
  94. #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
  95. ((PINSOURCE) == EXTI_PinSource1) || \
  96. ((PINSOURCE) == EXTI_PinSource2) || \
  97. ((PINSOURCE) == EXTI_PinSource3) || \
  98. ((PINSOURCE) == EXTI_PinSource4) || \
  99. ((PINSOURCE) == EXTI_PinSource5) || \
  100. ((PINSOURCE) == EXTI_PinSource6) || \
  101. ((PINSOURCE) == EXTI_PinSource7) || \
  102. ((PINSOURCE) == EXTI_PinSource8) || \
  103. ((PINSOURCE) == EXTI_PinSource9) || \
  104. ((PINSOURCE) == EXTI_PinSource10) || \
  105. ((PINSOURCE) == EXTI_PinSource11) || \
  106. ((PINSOURCE) == EXTI_PinSource12) || \
  107. ((PINSOURCE) == EXTI_PinSource13) || \
  108. ((PINSOURCE) == EXTI_PinSource14) || \
  109. ((PINSOURCE) == EXTI_PinSource15))
  110. /**
  111. * @}
  112. */
  113. /** @defgroup SYSCFG_Memory_Remap_Config
  114. * @{
  115. */
  116. #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
  117. #define SYSCFG_MemoryRemap_SystemFlash ((uint8_t)0x01)
  118. #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
  119. #define SYSCFG_MemoryRemap_SDRAM ((uint8_t)0x04)
  120. #if defined (STM32F40_41xxx)
  121. #define SYSCFG_MemoryRemap_FSMC ((uint8_t)0x02)
  122. #endif /* STM32F40_41xxx */
  123. #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
  124. #define SYSCFG_MemoryRemap_FMC ((uint8_t)0x02)
  125. #endif /* STM32F427_437xx || STM32F429_439xx */
  126. #if defined (STM32F446xx)
  127. #define SYSCFG_MemoryRemap_ExtMEM ((uint8_t)0x02)
  128. #endif /* STM32F446xx */
  129. #if defined (STM32F40_41xxx)
  130. #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  131. ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
  132. ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
  133. ((REMAP) == SYSCFG_MemoryRemap_FSMC))
  134. #endif /* STM32F40_41xxx */
  135. #if defined (STM32F401xx) || defined (STM32F411xE)
  136. #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  137. ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
  138. ((REMAP) == SYSCFG_MemoryRemap_SRAM))
  139. #endif /* STM32F401xx || STM32F411xE */
  140. #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
  141. #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  142. ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
  143. ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
  144. ((REMAP) == SYSCFG_MemoryRemap_SDRAM) || \
  145. ((REMAP) == SYSCFG_MemoryRemap_FMC))
  146. #endif /* STM32F427_437xx || STM32F429_439xx */
  147. #if defined (STM32F446xx)
  148. #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  149. ((REMAP) == SYSCFG_MemoryRemap_ExtMEM) || \
  150. ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
  151. ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
  152. ((REMAP) == SYSCFG_MemoryRemap_SDRAM))
  153. #endif /* STM32F446xx */
  154. /**
  155. * @}
  156. */
  157. /** @defgroup SYSCFG_ETHERNET_Media_Interface
  158. * @{
  159. */
  160. #define SYSCFG_ETH_MediaInterface_MII ((uint32_t)0x00000000)
  161. #define SYSCFG_ETH_MediaInterface_RMII ((uint32_t)0x00000001)
  162. #define IS_SYSCFG_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == SYSCFG_ETH_MediaInterface_MII) || \
  163. ((INTERFACE) == SYSCFG_ETH_MediaInterface_RMII))
  164. /**
  165. * @}
  166. */
  167. /**
  168. * @}
  169. */
  170. /* Exported macro ------------------------------------------------------------*/
  171. /* Exported functions --------------------------------------------------------*/
  172. void SYSCFG_DeInit(void);
  173. void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap);
  174. void SYSCFG_MemorySwappingBank(FunctionalState NewState);
  175. void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
  176. void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface);
  177. void SYSCFG_CompensationCellCmd(FunctionalState NewState);
  178. FlagStatus SYSCFG_GetCompensationCellStatus(void);
  179. #ifdef __cplusplus
  180. }
  181. #endif
  182. #endif /*__STM32F4xx_SYSCFG_H */
  183. /**
  184. * @}
  185. */
  186. /**
  187. * @}
  188. */
  189. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/