stm32f0xx_syscfg.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. /**
  2. ******************************************************************************
  3. * @file stm32f0xx_syscfg.h
  4. * @author MCD Application Team
  5. * @version V1.5.0
  6. * @date 05-December-2014
  7. * @brief This file contains all the functions prototypes for the SYSCFG firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; 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. /*!< Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F0XX_SYSCFG_H
  30. #define __STM32F0XX_SYSCFG_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /*!< Includes ------------------------------------------------------------------*/
  35. #include "stm32f0xx.h"
  36. /** @addtogroup STM32F0xx_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) /*!< not available for STM32F031 devices */
  54. #define EXTI_PortSourceGPIOE ((uint8_t)0x04) /*!< only available for STM32F072 devices */
  55. #define EXTI_PortSourceGPIOF ((uint8_t)0x05)
  56. #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
  57. ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
  58. ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
  59. ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
  60. ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
  61. ((PORTSOURCE) == EXTI_PortSourceGPIOF))
  62. /**
  63. * @}
  64. */
  65. /** @defgroup SYSCFG_EXTI_Pin_sources
  66. * @{
  67. */
  68. #define EXTI_PinSource0 ((uint8_t)0x00)
  69. #define EXTI_PinSource1 ((uint8_t)0x01)
  70. #define EXTI_PinSource2 ((uint8_t)0x02)
  71. #define EXTI_PinSource3 ((uint8_t)0x03)
  72. #define EXTI_PinSource4 ((uint8_t)0x04)
  73. #define EXTI_PinSource5 ((uint8_t)0x05)
  74. #define EXTI_PinSource6 ((uint8_t)0x06)
  75. #define EXTI_PinSource7 ((uint8_t)0x07)
  76. #define EXTI_PinSource8 ((uint8_t)0x08)
  77. #define EXTI_PinSource9 ((uint8_t)0x09)
  78. #define EXTI_PinSource10 ((uint8_t)0x0A)
  79. #define EXTI_PinSource11 ((uint8_t)0x0B)
  80. #define EXTI_PinSource12 ((uint8_t)0x0C)
  81. #define EXTI_PinSource13 ((uint8_t)0x0D)
  82. #define EXTI_PinSource14 ((uint8_t)0x0E)
  83. #define EXTI_PinSource15 ((uint8_t)0x0F)
  84. #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
  85. ((PINSOURCE) == EXTI_PinSource1) || \
  86. ((PINSOURCE) == EXTI_PinSource2) || \
  87. ((PINSOURCE) == EXTI_PinSource3) || \
  88. ((PINSOURCE) == EXTI_PinSource4) || \
  89. ((PINSOURCE) == EXTI_PinSource5) || \
  90. ((PINSOURCE) == EXTI_PinSource6) || \
  91. ((PINSOURCE) == EXTI_PinSource7) || \
  92. ((PINSOURCE) == EXTI_PinSource8) || \
  93. ((PINSOURCE) == EXTI_PinSource9) || \
  94. ((PINSOURCE) == EXTI_PinSource10) || \
  95. ((PINSOURCE) == EXTI_PinSource11) || \
  96. ((PINSOURCE) == EXTI_PinSource12) || \
  97. ((PINSOURCE) == EXTI_PinSource13) || \
  98. ((PINSOURCE) == EXTI_PinSource14) || \
  99. ((PINSOURCE) == EXTI_PinSource15))
  100. /**
  101. * @}
  102. */
  103. /** @defgroup SYSCFG_Memory_Remap_Config
  104. * @{
  105. */
  106. #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
  107. #define SYSCFG_MemoryRemap_SystemMemory ((uint8_t)0x01)
  108. #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
  109. #define IS_SYSCFG_MEMORY_REMAP(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  110. ((REMAP) == SYSCFG_MemoryRemap_SystemMemory) || \
  111. ((REMAP) == SYSCFG_MemoryRemap_SRAM))
  112. /**
  113. * @}
  114. */
  115. /** @defgroup SYSCFG_DMA_Remap_Config
  116. * @{
  117. */
  118. #define SYSCFG_DMARemap_TIM3 SYSCFG_CFGR1_TIM3_DMA_RMP /* Remap TIM3 DMA requests from channel4 to channel6,
  119. available only for STM32F072 devices */
  120. #define SYSCFG_DMARemap_TIM2 SYSCFG_CFGR1_TIM2_DMA_RMP /* Remap TIM2 DMA requests from channel3/4 to channel7,
  121. available only for STM32F072 devices */
  122. #define SYSCFG_DMARemap_TIM1 SYSCFG_CFGR1_TIM1_DMA_RMP /* Remap TIM1 DMA requests from channel2/3/4 to channel6,
  123. available only for STM32F072 devices */
  124. #define SYSCFG_DMARemap_I2C1 SYSCFG_CFGR1_I2C1_DMA_RMP /* Remap I2C1 DMA requests from channel3/2 to channel7/6,
  125. available only for STM32F072 devices */
  126. #define SYSCFG_DMARemap_USART3 SYSCFG_CFGR1_USART3_DMA_RMP /* Remap USART3 DMA requests from channel6/7 to channel3/2,
  127. available only for STM32F072 devices */
  128. #define SYSCFG_DMARemap_USART2 SYSCFG_CFGR1_USART2_DMA_RMP /* Remap USART2 DMA requests from channel4/5 to channel6/7,
  129. available only for STM32F072 devices */
  130. #define SYSCFG_DMARemap_SPI2 SYSCFG_CFGR1_SPI2_DMA_RMP /* Remap SPI2 DMA requests from channel4/5 to channel6/7,
  131. available only for STM32F072 devices */
  132. #define SYSCFG_DMARemap_TIM17_2 SYSCFG_CFGR1_TIM17_DMA_RMP2 /* Remap TIM17 DMA requests from channel1/2 to channel7,
  133. available only for STM32F072 devices */
  134. #define SYSCFG_DMARemap_TIM16_2 SYSCFG_CFGR1_TIM16_DMA_RMP2 /* Remap TIM16 DMA requests from channel3/4 to channel6,
  135. available only for STM32F072 devices */
  136. #define SYSCFG_DMARemap_TIM17 SYSCFG_CFGR1_TIM17_DMA_RMP /* Remap TIM17 DMA requests from channel1 to channel2 */
  137. #define SYSCFG_DMARemap_TIM16 SYSCFG_CFGR1_TIM16_DMA_RMP /* Remap TIM16 DMA requests from channel3 to channel4 */
  138. #define SYSCFG_DMARemap_USART1Rx SYSCFG_CFGR1_USART1RX_DMA_RMP /* Remap USART1 Rx DMA requests from channel3 to channel5 */
  139. #define SYSCFG_DMARemap_USART1Tx SYSCFG_CFGR1_USART1TX_DMA_RMP /* Remap USART1 Tx DMA requests from channel2 to channel4 */
  140. #define SYSCFG_DMARemap_ADC1 SYSCFG_CFGR1_ADC_DMA_RMP /* Remap ADC1 DMA requests from channel1 to channel2 */
  141. #define IS_SYSCFG_DMA_REMAP(REMAP) (((REMAP) == SYSCFG_DMARemap_TIM17) || \
  142. ((REMAP) == SYSCFG_DMARemap_TIM16) || \
  143. ((REMAP) == SYSCFG_DMARemap_USART1Rx) || \
  144. ((REMAP) == SYSCFG_DMARemap_USART1Tx) || \
  145. ((REMAP) == SYSCFG_CFGR1_TIM3_DMA_RMP) || \
  146. ((REMAP) == SYSCFG_CFGR1_TIM2_DMA_RMP) || \
  147. ((REMAP) == SYSCFG_CFGR1_TIM1_DMA_RMP) || \
  148. ((REMAP) == SYSCFG_CFGR1_I2C1_DMA_RMP) || \
  149. ((REMAP) == SYSCFG_CFGR1_USART3_DMA_RMP) || \
  150. ((REMAP) == SYSCFG_CFGR1_USART2_DMA_RMP) || \
  151. ((REMAP) == SYSCFG_CFGR1_SPI2_DMA_RMP) || \
  152. ((REMAP) == SYSCFG_CFGR1_TIM17_DMA_RMP2) || \
  153. ((REMAP) == SYSCFG_CFGR1_TIM16_DMA_RMP2) || \
  154. ((REMAP) == SYSCFG_DMARemap_ADC1))
  155. /**
  156. * @}
  157. */
  158. /** @defgroup SYSCFG_I2C_FastModePlus_Config
  159. * @{
  160. */
  161. #define SYSCFG_I2CFastModePlus_PB6 SYSCFG_CFGR1_I2C_FMP_PB6 /* Enable Fast Mode Plus on PB6 */
  162. #define SYSCFG_I2CFastModePlus_PB7 SYSCFG_CFGR1_I2C_FMP_PB7 /* Enable Fast Mode Plus on PB7 */
  163. #define SYSCFG_I2CFastModePlus_PB8 SYSCFG_CFGR1_I2C_FMP_PB8 /* Enable Fast Mode Plus on PB8 */
  164. #define SYSCFG_I2CFastModePlus_PB9 SYSCFG_CFGR1_I2C_FMP_PB9 /* Enable Fast Mode Plus on PB9 */
  165. #define SYSCFG_I2CFastModePlus_I2C1 SYSCFG_CFGR1_I2C_FMP_I2C1 /* Enable Fast Mode Plus on PB10, PB11, PF6 and PF7(only for STM32F0031 and STM32F030 devices) */
  166. #define SYSCFG_I2CFastModePlus_I2C2 SYSCFG_CFGR1_I2C_FMP_I2C2 /* Enable Fast Mode Plus on I2C2 pins, available only for STM32F072 devices */
  167. #define SYSCFG_I2CFastModePlus_PA9 SYSCFG_CFGR1_I2C_FMP_PA9 /* Enable Fast Mode Plus on PA9 (only for STM32F031 and STM32F030 devices) */
  168. #define SYSCFG_I2CFastModePlus_PA10 SYSCFG_CFGR1_I2C_FMP_PA10/* Enable Fast Mode Plus on PA10(only for STM32F031 and STM32F030 devices) */
  169. #define IS_SYSCFG_I2C_FMP(PIN) (((PIN) == SYSCFG_I2CFastModePlus_PB6) || \
  170. ((PIN) == SYSCFG_I2CFastModePlus_PB7) || \
  171. ((PIN) == SYSCFG_I2CFastModePlus_PB8) || \
  172. ((PIN) == SYSCFG_I2CFastModePlus_PB9) || \
  173. ((PIN) == SYSCFG_I2CFastModePlus_I2C1) || \
  174. ((PIN) == SYSCFG_I2CFastModePlus_I2C2) || \
  175. ((PIN) == SYSCFG_I2CFastModePlus_PA9) || \
  176. ((PIN) == SYSCFG_I2CFastModePlus_PA10))
  177. /**
  178. * @}
  179. */
  180. /** @defgroup SYSCFG_Lock_Config
  181. * @{
  182. */
  183. #define SYSCFG_Break_PVD SYSCFG_CFGR2_PVD_LOCK /*!< Connects the PVD event to the Break Input of TIM1, not available for STM32F030 devices */
  184. #define SYSCFG_Break_SRAMParity SYSCFG_CFGR2_SRAM_PARITY_LOCK /*!< Connects the SRAM_PARITY error signal to the Break Input of TIM1 */
  185. #define SYSCFG_Break_Lockup SYSCFG_CFGR2_LOCKUP_LOCK /*!< Connects Lockup output of CortexM0 to the break input of TIM1 */
  186. #define IS_SYSCFG_LOCK_CONFIG(CONFIG) (((CONFIG) == SYSCFG_Break_PVD) || \
  187. ((CONFIG) == SYSCFG_Break_SRAMParity) || \
  188. ((CONFIG) == SYSCFG_Break_Lockup))
  189. /**
  190. * @}
  191. */
  192. /** @defgroup SYSCFG_flags_definition
  193. * @{
  194. */
  195. #define SYSCFG_FLAG_PE SYSCFG_CFGR2_SRAM_PE
  196. #define IS_SYSCFG_FLAG(FLAG) (((FLAG) == SYSCFG_FLAG_PE))
  197. /**
  198. * @}
  199. */
  200. /** @defgroup SYSCFG_ISR_WRAPPER
  201. * @{
  202. */
  203. #define SYSCFG_ITLINE0 ((uint32_t) 0x00000000)
  204. #define SYSCFG_ITLINE1 ((uint32_t) 0x00000001)
  205. #define SYSCFG_ITLINE2 ((uint32_t) 0x00000002)
  206. #define SYSCFG_ITLINE3 ((uint32_t) 0x00000003)
  207. #define SYSCFG_ITLINE4 ((uint32_t) 0x00000004)
  208. #define SYSCFG_ITLINE5 ((uint32_t) 0x00000005)
  209. #define SYSCFG_ITLINE6 ((uint32_t) 0x00000006)
  210. #define SYSCFG_ITLINE7 ((uint32_t) 0x00000007)
  211. #define SYSCFG_ITLINE8 ((uint32_t) 0x00000008)
  212. #define SYSCFG_ITLINE9 ((uint32_t) 0x00000009)
  213. #define SYSCFG_ITLINE10 ((uint32_t) 0x0000000A)
  214. #define SYSCFG_ITLINE11 ((uint32_t) 0x0000000B)
  215. #define SYSCFG_ITLINE12 ((uint32_t) 0x0000000C)
  216. #define SYSCFG_ITLINE13 ((uint32_t) 0x0000000D)
  217. #define SYSCFG_ITLINE14 ((uint32_t) 0x0000000E)
  218. #define SYSCFG_ITLINE15 ((uint32_t) 0x0000000F)
  219. #define SYSCFG_ITLINE16 ((uint32_t) 0x00000010)
  220. #define SYSCFG_ITLINE17 ((uint32_t) 0x00000011)
  221. #define SYSCFG_ITLINE18 ((uint32_t) 0x00000012)
  222. #define SYSCFG_ITLINE19 ((uint32_t) 0x00000013)
  223. #define SYSCFG_ITLINE20 ((uint32_t) 0x00000014)
  224. #define SYSCFG_ITLINE21 ((uint32_t) 0x00000015)
  225. #define SYSCFG_ITLINE22 ((uint32_t) 0x00000016)
  226. #define SYSCFG_ITLINE23 ((uint32_t) 0x00000017)
  227. #define SYSCFG_ITLINE24 ((uint32_t) 0x00000018)
  228. #define SYSCFG_ITLINE25 ((uint32_t) 0x00000019)
  229. #define SYSCFG_ITLINE26 ((uint32_t) 0x0000001A)
  230. #define SYSCFG_ITLINE27 ((uint32_t) 0x0000001B)
  231. #define SYSCFG_ITLINE28 ((uint32_t) 0x0000001C)
  232. #define SYSCFG_ITLINE29 ((uint32_t) 0x0000001D)
  233. #define SYSCFG_ITLINE30 ((uint32_t) 0x0000001E)
  234. #define SYSCFG_ITLINE31 ((uint32_t) 0x0000001F)
  235. #define ITLINE_EWDG ((uint32_t) ((SYSCFG_ITLINE0 << 0x18) | SYSCFG_ITLINE0_SR_EWDG)) /* EWDG Interrupt */
  236. #define ITLINE_PVDOUT ((uint32_t) ((SYSCFG_ITLINE1 << 0x18) | SYSCFG_ITLINE1_SR_PVDOUT)) /* Power voltage detection Interrupt */
  237. #define ITLINE_VDDIO2 ((uint32_t) ((SYSCFG_ITLINE1 << 0x18) | SYSCFG_ITLINE1_SR_VDDIO2)) /* VDDIO2 Interrupt */
  238. #define ITLINE_RTC_WAKEUP ((uint32_t) ((SYSCFG_ITLINE2 << 0x18) | SYSCFG_ITLINE2_SR_RTC_WAKEUP)) /* RTC WAKEUP -> exti[20] Interrupt */
  239. #define ITLINE_RTC_TSTAMP ((uint32_t) ((SYSCFG_ITLINE2 << 0x18) | SYSCFG_ITLINE2_SR_RTC_TSTAMP)) /* RTC Time Stamp -> exti[19] interrupt */
  240. #define ITLINE_RTC_ALRA ((uint32_t) ((SYSCFG_ITLINE2 << 0x18) | SYSCFG_ITLINE2_SR_RTC_ALRA)) /* RTC Alarm -> exti[17] interrupt */
  241. #define ITLINE_FLASH_ITF ((uint32_t) ((SYSCFG_ITLINE3 << 0x18) | SYSCFG_ITLINE3_SR_FLASH_ITF)) /* Flash ITF Interrupt */
  242. #define ITLINE_CRS ((uint32_t) ((SYSCFG_ITLINE4 << 0x18) | SYSCFG_ITLINE4_SR_CRS)) /* CRS Interrupt */
  243. #define ITLINE_CLK_CTRL ((uint32_t) ((SYSCFG_ITLINE4 << 0x18) | SYSCFG_ITLINE4_SR_CLK_CTRL)) /* CLK Control Interrupt */
  244. #define ITLINE_EXTI0 ((uint32_t) ((SYSCFG_ITLINE5 << 0x18) | SYSCFG_ITLINE5_SR_EXTI0)) /* External Interrupt 0 */
  245. #define ITLINE_EXTI1 ((uint32_t) ((SYSCFG_ITLINE5 << 0x18) | SYSCFG_ITLINE5_SR_EXTI1)) /* External Interrupt 1 */
  246. #define ITLINE_EXTI2 ((uint32_t) ((SYSCFG_ITLINE6 << 0x18) | SYSCFG_ITLINE6_SR_EXTI2)) /* External Interrupt 2 */
  247. #define ITLINE_EXTI3 ((uint32_t) ((SYSCFG_ITLINE6 << 0x18) | SYSCFG_ITLINE6_SR_EXTI3)) /* External Interrupt 3 */
  248. #define ITLINE_EXTI4 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI4)) /* EXTI4 Interrupt */
  249. #define ITLINE_EXTI5 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI5)) /* EXTI5 Interrupt */
  250. #define ITLINE_EXTI6 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI6)) /* EXTI6 Interrupt */
  251. #define ITLINE_EXTI7 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI7)) /* EXTI7 Interrupt */
  252. #define ITLINE_EXTI8 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI8)) /* EXTI8 Interrupt */
  253. #define ITLINE_EXTI9 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI9)) /* EXTI9 Interrupt */
  254. #define ITLINE_EXTI10 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI10)) /* EXTI10 Interrupt */
  255. #define ITLINE_EXTI11 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI11)) /* EXTI11 Interrupt */
  256. #define ITLINE_EXTI12 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI12)) /* EXTI12 Interrupt */
  257. #define ITLINE_EXTI13 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI13)) /* EXTI13 Interrupt */
  258. #define ITLINE_EXTI14 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI14)) /* EXTI14 Interrupt */
  259. #define ITLINE_EXTI15 ((uint32_t) ((SYSCFG_ITLINE7 << 0x18) | SYSCFG_ITLINE7_SR_EXTI15)) /* EXTI15 Interrupt */
  260. #define ITLINE_TSC_EOA ((uint32_t) ((SYSCFG_ITLINE8 << 0x18) | SYSCFG_ITLINE8_SR_TSC_EOA)) /* Touch control EOA Interrupt */
  261. #define ITLINE_TSC_MCE ((uint32_t) ((SYSCFG_ITLINE8 << 0x18) | SYSCFG_ITLINE8_SR_TSC_MCE)) /* Touch control MCE Interrupt */
  262. #define ITLINE_DMA1_CH1 ((uint32_t) ((SYSCFG_ITLINE9 << 0x18) | SYSCFG_ITLINE9_SR_DMA1_CH1)) /* DMA1 Channel 1 Interrupt */
  263. #define ITLINE_DMA1_CH2 ((uint32_t) ((SYSCFG_ITLINE10 << 0x18) | SYSCFG_ITLINE10_SR_DMA1_CH2)) /* DMA1 Channel 2 Interrupt */
  264. #define ITLINE_DMA1_CH3 ((uint32_t) ((SYSCFG_ITLINE10 << 0x18) | SYSCFG_ITLINE10_SR_DMA1_CH3)) /* DMA1 Channel 3 Interrupt */
  265. #define ITLINE_DMA2_CH1 ((uint32_t) ((SYSCFG_ITLINE10 << 0x18) | SYSCFG_ITLINE10_SR_DMA2_CH1)) /* DMA2 Channel 1 Interrupt */
  266. #define ITLINE_DMA2_CH2 ((uint32_t) ((SYSCFG_ITLINE10 << 0x18) | SYSCFG_ITLINE10_SR_DMA2_CH2)) /* DMA2 Channel 2 Interrupt */
  267. #define ITLINE_DMA1_CH4 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA1_CH4)) /* DMA1 Channel 4 Interrupt */
  268. #define ITLINE_DMA1_CH5 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA1_CH5)) /* DMA1 Channel 5 Interrupt */
  269. #define ITLINE_DMA1_CH6 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA1_CH6)) /* DMA1 Channel 6 Interrupt */
  270. #define ITLINE_DMA1_CH7 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA1_CH7)) /* DMA1 Channel 7 Interrupt */
  271. #define ITLINE_DMA2_CH3 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA2_CH3)) /* DMA2 Channel 3 Interrupt */
  272. #define ITLINE_DMA2_CH4 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA2_CH4)) /* DMA2 Channel 4 Interrupt */
  273. #define ITLINE_DMA2_CH5 ((uint32_t) ((SYSCFG_ITLINE11 << 0x18) | SYSCFG_ITLINE11_SR_DMA2_CH5)) /* DMA2 Channel 5 Interrupt */
  274. #define ITLINE_ADC ((uint32_t) ((SYSCFG_ITLINE12 << 0x18) | SYSCFG_ITLINE12_SR_ADC)) /* ADC Interrupt */
  275. #define ITLINE_COMP1 ((uint32_t) ((SYSCFG_ITLINE12 << 0x18) | SYSCFG_ITLINE12_SR_COMP1)) /* COMP1 Interrupt -> exti[21] */
  276. #define ITLINE_COMP2 ((uint32_t) ((SYSCFG_ITLINE12 << 0x18) | SYSCFG_ITLINE12_SR_COMP2)) /* COMP2 Interrupt -> exti[21] */
  277. #define ITLINE_TIM1_BRK ((uint32_t) ((SYSCFG_ITLINE13 << 0x18) | SYSCFG_ITLINE13_SR_TIM1_BRK)) /* TIM1 BRK Interrupt */
  278. #define ITLINE_TIM1_UPD ((uint32_t) ((SYSCFG_ITLINE13 << 0x18) | SYSCFG_ITLINE13_SR_TIM1_UPD)) /* TIM1 UPD Interrupt */
  279. #define ITLINE_TIM1_TRG ((uint32_t) ((SYSCFG_ITLINE13 << 0x18) | SYSCFG_ITLINE13_SR_TIM1_TRG)) /* TIM1 TRG Interrupt */
  280. #define ITLINE_TIM1_CCU ((uint32_t) ((SYSCFG_ITLINE13 << 0x18) | SYSCFG_ITLINE13_SR_TIM1_CCU)) /* TIM1 CCU Interrupt */
  281. #define ITLINE_TIM1_CC ((uint32_t) ((SYSCFG_ITLINE14 << 0x18) | SYSCFG_ITLINE14_SR_TIM1_CC)) /* TIM1 CC Interrupt */
  282. #define ITLINE_TIM2 ((uint32_t) ((SYSCFG_ITLINE15 << 0x18) | SYSCFG_ITLINE15_SR_TIM2_GLB)) /* TIM2 Interrupt */
  283. #define ITLINE_TIM3 ((uint32_t) ((SYSCFG_ITLINE16 << 0x18) | SYSCFG_ITLINE16_SR_TIM3_GLB)) /* TIM3 Interrupt */
  284. #define ITLINE_DAC ((uint32_t) ((SYSCFG_ITLINE17 << 0x18) | SYSCFG_ITLINE17_SR_DAC)) /* DAC Interrupt */
  285. #define ITLINE_TIM6 ((uint32_t) ((SYSCFG_ITLINE17 << 0x18) | SYSCFG_ITLINE17_SR_TIM6_GLB)) /* TIM6 Interrupt */
  286. #define ITLINE_TIM7 ((uint32_t) ((SYSCFG_ITLINE18 << 0x18) | SYSCFG_ITLINE18_SR_TIM7_GLB)) /* TIM7 Interrupt */
  287. #define ITLINE_TIM14 ((uint32_t) ((SYSCFG_ITLINE19 << 0x18) | SYSCFG_ITLINE19_SR_TIM14_GLB)) /* TIM14 Interrupt */
  288. #define ITLINE_TIM15 ((uint32_t) ((SYSCFG_ITLINE20 << 0x18) | SYSCFG_ITLINE20_SR_TIM15_GLB)) /* TIM15 Interrupt */
  289. #define ITLINE_TIM16 ((uint32_t) ((SYSCFG_ITLINE21 << 0x18) | SYSCFG_ITLINE21_SR_TIM16_GLB)) /* TIM16 Interrupt */
  290. #define ITLINE_TIM17 ((uint32_t) ((SYSCFG_ITLINE22 << 0x18) | SYSCFG_ITLINE22_SR_TIM17_GLB)) /* TIM17 Interrupt */
  291. #define ITLINE_I2C1 ((uint32_t) ((SYSCFG_ITLINE23 << 0x18) | SYSCFG_ITLINE23_SR_I2C1_GLB)) /* I2C1 Interrupt -> exti[23] */
  292. #define ITLINE_I2C2 ((uint32_t) ((SYSCFG_ITLINE24 << 0x18) | SYSCFG_ITLINE24_SR_I2C2_GLB)) /* I2C2 Interrupt */
  293. #define ITLINE_SPI1 ((uint32_t) ((SYSCFG_ITLINE25 << 0x18) | SYSCFG_ITLINE25_SR_SPI1)) /* I2C1 Interrupt -> exti[23] */
  294. #define ITLINE_SPI2 ((uint32_t) ((SYSCFG_ITLINE26 << 0x18) | SYSCFG_ITLINE26_SR_SPI2)) /* SPI1 Interrupt */
  295. #define ITLINE_USART1 ((uint32_t) ((SYSCFG_ITLINE27 << 0x18) | SYSCFG_ITLINE27_SR_USART1_GLB)) /*!< USART1 GLB Interrupt -> exti[25] */
  296. #define ITLINE_USART2 ((uint32_t) ((SYSCFG_ITLINE28 << 0x18) | SYSCFG_ITLINE28_SR_USART2_GLB)) /*!< USART2 GLB Interrupt -> exti[26] */
  297. #define ITLINE_USART3 ((uint32_t) ((SYSCFG_ITLINE29 << 0x18) | SYSCFG_ITLINE29_SR_USART3_GLB)) /* USART3 Interrupt */
  298. #define ITLINE_USART4 ((uint32_t) ((SYSCFG_ITLINE29 << 0x18) | SYSCFG_ITLINE29_SR_USART4_GLB)) /* USART4 Interrupt */
  299. #define ITLINE_USART5 ((uint32_t) ((SYSCFG_ITLINE29 << 0x18) | SYSCFG_ITLINE29_SR_USART5_GLB)) /* USART5 Interrupt */
  300. #define ITLINE_USART6 ((uint32_t) ((SYSCFG_ITLINE29 << 0x18) | SYSCFG_ITLINE29_SR_USART6_GLB)) /* USART6 Interrupt */
  301. #define ITLINE_USART7 ((uint32_t) ((SYSCFG_ITLINE29 << 0x18) | SYSCFG_ITLINE29_SR_USART7_GLB)) /* USART7 Interrupt */
  302. #define ITLINE_USART8 ((uint32_t) ((SYSCFG_ITLINE29 << 0x18) | SYSCFG_ITLINE29_SR_USART8_GLB)) /* USART8 Interrupt */
  303. #define ITLINE_CAN ((uint32_t) ((SYSCFG_ITLINE30 << 0x18) | SYSCFG_ITLINE30_SR_CAN)) /* CAN Interrupt */
  304. #define ITLINE_CEC ((uint32_t) ((SYSCFG_ITLINE30 << 0x18) | SYSCFG_ITLINE30_SR_CEC)) /* CEC Interrupt -> exti[27] */
  305. #define IS_SYSCFG_ITLINE(LINE) (((LINE) == ITLINE_EWDG) || \
  306. ((LINE) == ITLINE_PVDOUT) || \
  307. ((LINE) == ITLINE_VDDIO2) || \
  308. ((LINE) == ITLINE_RTC_WAKEUP) || \
  309. ((LINE) == ITLINE_RTC_TSTAMP) || \
  310. ((LINE) == ITLINE_RTC_ALRA) || \
  311. ((LINE) == ITLINE_FLASH_ITF) || \
  312. ((LINE) == ITLINE_CRS) || \
  313. ((LINE) == ITLINE_CLK_CTRL) || \
  314. ((LINE) == ITLINE_EXTI0) || \
  315. ((LINE) == ITLINE_EXTI1) || \
  316. ((LINE) == ITLINE_EXTI2) || \
  317. ((LINE) == ITLINE_EXTI3) || \
  318. ((LINE) == ITLINE_EXTI4) || \
  319. ((LINE) == ITLINE_EXTI5) || \
  320. ((LINE) == ITLINE_EXTI6) || \
  321. ((LINE) == ITLINE_EXTI7) || \
  322. ((LINE) == ITLINE_EXTI8) || \
  323. ((LINE) == ITLINE_EXTI9) || \
  324. ((LINE) == ITLINE_EXTI10) || \
  325. ((LINE) == ITLINE_EXTI11) || \
  326. ((LINE) == ITLINE_EXTI12) || \
  327. ((LINE) == ITLINE_EXTI13) || \
  328. ((LINE) == ITLINE_EXTI14) || \
  329. ((LINE) == ITLINE_EXTI15) || \
  330. ((LINE) == ITLINE_TSC_EOA) || \
  331. ((LINE) == ITLINE_TSC_MCE) || \
  332. ((LINE) == ITLINE_DMA1_CH1) || \
  333. ((LINE) == ITLINE_DMA1_CH2) || \
  334. ((LINE) == ITLINE_DMA1_CH3) || \
  335. ((LINE) == ITLINE_DMA1_CH4) || \
  336. ((LINE) == ITLINE_DMA1_CH5) || \
  337. ((LINE) == ITLINE_DMA1_CH6) || \
  338. ((LINE) == ITLINE_DMA1_CH7) || \
  339. ((LINE) == ITLINE_DMA2_CH1) || \
  340. ((LINE) == ITLINE_DMA2_CH2) || \
  341. ((LINE) == ITLINE_DMA2_CH3) || \
  342. ((LINE) == ITLINE_DMA2_CH4) || \
  343. ((LINE) == ITLINE_DMA2_CH5) || \
  344. ((LINE) == ITLINE_ADC) || \
  345. ((LINE) == ITLINE_COMP1) || \
  346. ((LINE) == ITLINE_COMP2) || \
  347. ((LINE) == ITLINE_TIM1_BRK) || \
  348. ((LINE) == ITLINE_TIM1_UPD) || \
  349. ((LINE) == ITLINE_TIM1_TRG) || \
  350. ((LINE) == ITLINE_TIM1_CCU) || \
  351. ((LINE) == ITLINE_TIM1_CC) || \
  352. ((LINE) == ITLINE_TIM2) || \
  353. ((LINE) == ITLINE_TIM3) || \
  354. ((LINE) == ITLINE_DAC) || \
  355. ((LINE) == ITLINE_TIM6) || \
  356. ((LINE) == ITLINE_TIM7) || \
  357. ((LINE) == ITLINE_TIM14) || \
  358. ((LINE) == ITLINE_TIM15) || \
  359. ((LINE) == ITLINE_TIM16) || \
  360. ((LINE) == ITLINE_TIM17) || \
  361. ((LINE) == ITLINE_I2C1) || \
  362. ((LINE) == ITLINE_I2C2) || \
  363. ((LINE) == ITLINE_SPI1) || \
  364. ((LINE) == ITLINE_SPI2) || \
  365. ((LINE) == ITLINE_USART1) || \
  366. ((LINE) == ITLINE_USART2) || \
  367. ((LINE) == ITLINE_USART3) || \
  368. ((LINE) == ITLINE_USART4) || \
  369. ((LINE) == ITLINE_USART5) || \
  370. ((LINE) == ITLINE_USART6) || \
  371. ((LINE) == ITLINE_USART7) || \
  372. ((LINE) == ITLINE_USART8) || \
  373. ((LINE) == ITLINE_CAN) || \
  374. ((LINE) == ITLINE_CEC))
  375. /**
  376. * @}
  377. */
  378. /** @defgroup IRDA_ENV_SEL
  379. * @{
  380. */
  381. #define SYSCFG_IRDA_ENV_SEL_TIM16 (SYSCFG_CFGR1_IRDA_ENV_SEL_0&SYSCFG_CFGR1_IRDA_ENV_SEL_1) /* Timer16 is selected as IRDA Modulation envelope source */
  382. #define SYSCFG_IRDA_ENV_SEL_USART1 (SYSCFG_CFGR1_IRDA_ENV_SEL_0) /* USART1 is selected as IRDA Modulation envelope source.*/
  383. #define SYSCFG_IRDA_ENV_SEL_USART4 (SYSCFG_CFGR1_IRDA_ENV_SEL_1) /* USART4 is selected as IRDA Modulation envelope source.*/
  384. #define IS_SYSCFG_IRDA_ENV(ENV) (((ENV) == SYSCFG_IRDA_ENV_SEL_TIM16) || \
  385. ((ENV) == SYSCFG_IRDA_ENV_SEL_USART1) || \
  386. ((ENV) == SYSCFG_IRDA_ENV_SEL_USART4))
  387. /**
  388. * @}
  389. */
  390. /**
  391. * @}
  392. */
  393. /* Exported macro ------------------------------------------------------------*/
  394. /* Exported functions ------------------------------------------------------- */
  395. /* Function used to set the SYSCFG configuration to the default reset state **/
  396. void SYSCFG_DeInit(void);
  397. /* SYSCFG configuration functions *********************************************/
  398. void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap);
  399. void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState);
  400. void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState);
  401. void SYSCFG_IRDAEnvSelection(uint32_t SYSCFG_IRDAEnv);
  402. void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
  403. uint32_t SYSCFG_GetPendingIT(uint32_t ITSourceLine);
  404. void SYSCFG_BreakConfig(uint32_t SYSCFG_Break);
  405. FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag);
  406. void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag);
  407. #ifdef __cplusplus
  408. }
  409. #endif
  410. #endif /*__STM32F0XX_SYSCFG_H */
  411. /**
  412. * @}
  413. */
  414. /**
  415. * @}
  416. */
  417. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/