stm32f2xx_syscfg.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /**
  2. ******************************************************************************
  3. * @file stm32f2xx_syscfg.h
  4. * @author MCD Application Team
  5. * @version V1.1.3
  6. * @date 31-December-2021
  7. * @brief This file contains all the functions prototypes for the SYSCFG firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * Copyright (c) 2012 STMicroelectronics.
  13. * All rights reserved.
  14. *
  15. * This software is licensed under terms that can be found in the LICENSE file
  16. * in the root directory of this software component.
  17. * If no LICENSE file comes with this software, it is provided AS-IS.
  18. *
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F2xx_SYSCFG_H
  23. #define __STM32F2xx_SYSCFG_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f2xx.h"
  29. /** @addtogroup STM32F2xx_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup SYSCFG
  33. * @{
  34. */
  35. /* Exported types ------------------------------------------------------------*/
  36. /* Exported constants --------------------------------------------------------*/
  37. /** @defgroup SYSCFG_Exported_Constants
  38. * @{
  39. */
  40. /** @defgroup SYSCFG_EXTI_Port_Sources
  41. * @{
  42. */
  43. #define EXTI_PortSourceGPIOA ((uint8_t)0x00)
  44. #define EXTI_PortSourceGPIOB ((uint8_t)0x01)
  45. #define EXTI_PortSourceGPIOC ((uint8_t)0x02)
  46. #define EXTI_PortSourceGPIOD ((uint8_t)0x03)
  47. #define EXTI_PortSourceGPIOE ((uint8_t)0x04)
  48. #define EXTI_PortSourceGPIOF ((uint8_t)0x05)
  49. #define EXTI_PortSourceGPIOG ((uint8_t)0x06)
  50. #define EXTI_PortSourceGPIOH ((uint8_t)0x07)
  51. #define EXTI_PortSourceGPIOI ((uint8_t)0x08)
  52. #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
  53. ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
  54. ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
  55. ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
  56. ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
  57. ((PORTSOURCE) == EXTI_PortSourceGPIOF) || \
  58. ((PORTSOURCE) == EXTI_PortSourceGPIOG) || \
  59. ((PORTSOURCE) == EXTI_PortSourceGPIOH) || \
  60. ((PORTSOURCE) == EXTI_PortSourceGPIOI))
  61. /**
  62. * @}
  63. */
  64. /** @defgroup SYSCFG_EXTI_Pin_Sources
  65. * @{
  66. */
  67. #define EXTI_PinSource0 ((uint8_t)0x00)
  68. #define EXTI_PinSource1 ((uint8_t)0x01)
  69. #define EXTI_PinSource2 ((uint8_t)0x02)
  70. #define EXTI_PinSource3 ((uint8_t)0x03)
  71. #define EXTI_PinSource4 ((uint8_t)0x04)
  72. #define EXTI_PinSource5 ((uint8_t)0x05)
  73. #define EXTI_PinSource6 ((uint8_t)0x06)
  74. #define EXTI_PinSource7 ((uint8_t)0x07)
  75. #define EXTI_PinSource8 ((uint8_t)0x08)
  76. #define EXTI_PinSource9 ((uint8_t)0x09)
  77. #define EXTI_PinSource10 ((uint8_t)0x0A)
  78. #define EXTI_PinSource11 ((uint8_t)0x0B)
  79. #define EXTI_PinSource12 ((uint8_t)0x0C)
  80. #define EXTI_PinSource13 ((uint8_t)0x0D)
  81. #define EXTI_PinSource14 ((uint8_t)0x0E)
  82. #define EXTI_PinSource15 ((uint8_t)0x0F)
  83. #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
  84. ((PINSOURCE) == EXTI_PinSource1) || \
  85. ((PINSOURCE) == EXTI_PinSource2) || \
  86. ((PINSOURCE) == EXTI_PinSource3) || \
  87. ((PINSOURCE) == EXTI_PinSource4) || \
  88. ((PINSOURCE) == EXTI_PinSource5) || \
  89. ((PINSOURCE) == EXTI_PinSource6) || \
  90. ((PINSOURCE) == EXTI_PinSource7) || \
  91. ((PINSOURCE) == EXTI_PinSource8) || \
  92. ((PINSOURCE) == EXTI_PinSource9) || \
  93. ((PINSOURCE) == EXTI_PinSource10) || \
  94. ((PINSOURCE) == EXTI_PinSource11) || \
  95. ((PINSOURCE) == EXTI_PinSource12) || \
  96. ((PINSOURCE) == EXTI_PinSource13) || \
  97. ((PINSOURCE) == EXTI_PinSource14) || \
  98. ((PINSOURCE) == EXTI_PinSource15))
  99. /**
  100. * @}
  101. */
  102. /** @defgroup SYSCFG_Memory_Remap_Config
  103. * @{
  104. */
  105. #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
  106. #define SYSCFG_MemoryRemap_SystemFlash ((uint8_t)0x01)
  107. #define SYSCFG_MemoryRemap_FSMC ((uint8_t)0x02)
  108. #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
  109. #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  110. ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
  111. ((REMAP) == SYSCFG_MemoryRemap_SRAM) || \
  112. ((REMAP) == SYSCFG_MemoryRemap_FSMC))
  113. /**
  114. * @}
  115. */
  116. /** @defgroup SYSCFG_ETHERNET_Media_Interface
  117. * @{
  118. */
  119. #define SYSCFG_ETH_MediaInterface_MII ((uint32_t)0x00000000)
  120. #define SYSCFG_ETH_MediaInterface_RMII ((uint32_t)0x00000001)
  121. #define IS_SYSCFG_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == SYSCFG_ETH_MediaInterface_MII) || \
  122. ((INTERFACE) == SYSCFG_ETH_MediaInterface_RMII))
  123. /**
  124. * @}
  125. */
  126. /**
  127. * @}
  128. */
  129. /* Exported macro ------------------------------------------------------------*/
  130. /* Exported functions --------------------------------------------------------*/
  131. void SYSCFG_DeInit(void);
  132. void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap);
  133. void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
  134. void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface);
  135. void SYSCFG_CompensationCellCmd(FunctionalState NewState);
  136. FlagStatus SYSCFG_GetCompensationCellStatus(void);
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #endif /*__STM32F2xx_SYSCFG_H */
  141. /**
  142. * @}
  143. */
  144. /**
  145. * @}
  146. */