STM32F0 Standard Peripheral bibliotheek  1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f0xx_syscfg.h
Go to the documentation of this file.
1 
30 #ifndef __STM32F0XX_SYSCFG_H
31 #define __STM32F0XX_SYSCFG_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
38 #include "stm32f0xx.h"
39 
47 /* Exported types ------------------------------------------------------------*/
48 /* Exported constants --------------------------------------------------------*/
49 
57 #define EXTI_PortSourceGPIOA ((uint8_t)0x00)
58 #define EXTI_PortSourceGPIOB ((uint8_t)0x01)
59 #define EXTI_PortSourceGPIOC ((uint8_t)0x02)
60 #define EXTI_PortSourceGPIOD ((uint8_t)0x03)
61 #define EXTI_PortSourceGPIOF ((uint8_t)0x05)
62 
63 #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
64  ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
65  ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
66  ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
67  ((PORTSOURCE) == EXTI_PortSourceGPIOF))
68 
75 #define EXTI_PinSource0 ((uint8_t)0x00)
76 #define EXTI_PinSource1 ((uint8_t)0x01)
77 #define EXTI_PinSource2 ((uint8_t)0x02)
78 #define EXTI_PinSource3 ((uint8_t)0x03)
79 #define EXTI_PinSource4 ((uint8_t)0x04)
80 #define EXTI_PinSource5 ((uint8_t)0x05)
81 #define EXTI_PinSource6 ((uint8_t)0x06)
82 #define EXTI_PinSource7 ((uint8_t)0x07)
83 #define EXTI_PinSource8 ((uint8_t)0x08)
84 #define EXTI_PinSource9 ((uint8_t)0x09)
85 #define EXTI_PinSource10 ((uint8_t)0x0A)
86 #define EXTI_PinSource11 ((uint8_t)0x0B)
87 #define EXTI_PinSource12 ((uint8_t)0x0C)
88 #define EXTI_PinSource13 ((uint8_t)0x0D)
89 #define EXTI_PinSource14 ((uint8_t)0x0E)
90 #define EXTI_PinSource15 ((uint8_t)0x0F)
91 
92 #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
93  ((PINSOURCE) == EXTI_PinSource1) || \
94  ((PINSOURCE) == EXTI_PinSource2) || \
95  ((PINSOURCE) == EXTI_PinSource3) || \
96  ((PINSOURCE) == EXTI_PinSource4) || \
97  ((PINSOURCE) == EXTI_PinSource5) || \
98  ((PINSOURCE) == EXTI_PinSource6) || \
99  ((PINSOURCE) == EXTI_PinSource7) || \
100  ((PINSOURCE) == EXTI_PinSource8) || \
101  ((PINSOURCE) == EXTI_PinSource9) || \
102  ((PINSOURCE) == EXTI_PinSource10) || \
103  ((PINSOURCE) == EXTI_PinSource11) || \
104  ((PINSOURCE) == EXTI_PinSource12) || \
105  ((PINSOURCE) == EXTI_PinSource13) || \
106  ((PINSOURCE) == EXTI_PinSource14) || \
107  ((PINSOURCE) == EXTI_PinSource15))
108 
115 #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
116 #define SYSCFG_MemoryRemap_SystemMemory ((uint8_t)0x01)
117 #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
118 
119 
120 #define IS_SYSCFG_MEMORY_REMAP(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
121  ((REMAP) == SYSCFG_MemoryRemap_SystemMemory) || \
122  ((REMAP) == SYSCFG_MemoryRemap_SRAM))
123 
131 #define SYSCFG_DMARemap_TIM17 SYSCFG_CFGR1_TIM17_DMA_RMP /* Remap TIM17 DMA requests from channel1 to channel2 */
132 #define SYSCFG_DMARemap_TIM16 SYSCFG_CFGR1_TIM16_DMA_RMP /* Remap TIM16 DMA requests from channel3 to channel4 */
133 #define SYSCFG_DMARemap_USART1Rx SYSCFG_CFGR1_USART1RX_DMA_RMP /* Remap USART1 Rx DMA requests from channel3 to channel5 */
134 #define SYSCFG_DMARemap_USART1Tx SYSCFG_CFGR1_USART1TX_DMA_RMP /* Remap USART1 Tx DMA requests from channel2 to channel4 */
135 #define SYSCFG_DMARemap_ADC1 SYSCFG_CFGR1_ADC_DMA_RMP /* Remap ADC1 DMA requests from channel1 to channel2 */
136 
137 #define IS_SYSCFG_DMA_REMAP(REMAP) (((REMAP) == SYSCFG_DMARemap_TIM17) || \
138  ((REMAP) == SYSCFG_DMARemap_TIM16) || \
139  ((REMAP) == SYSCFG_DMARemap_USART1Rx) || \
140  ((REMAP) == SYSCFG_DMARemap_USART1Tx) || \
141  ((REMAP) == SYSCFG_DMARemap_ADC1))
142 
150 #define SYSCFG_I2CFastModePlus_PB6 SYSCFG_CFGR1_I2C_FMP_PB6 /* Enable Fast Mode Plus on PB6 */
151 #define SYSCFG_I2CFastModePlus_PB7 SYSCFG_CFGR1_I2C_FMP_PB7 /* Enable Fast Mode Plus on PB7 */
152 #define SYSCFG_I2CFastModePlus_PB8 SYSCFG_CFGR1_I2C_FMP_PB8 /* Enable Fast Mode Plus on PB8 */
153 #define SYSCFG_I2CFastModePlus_PB9 SYSCFG_CFGR1_I2C_FMP_PB9 /* Enable Fast Mode Plus on PB9 */
154 
155 #define IS_SYSCFG_I2C_FMP(PIN) (((PIN) == SYSCFG_I2CFastModePlus_PB6) || \
156  ((PIN) == SYSCFG_I2CFastModePlus_PB7) || \
157  ((PIN) == SYSCFG_I2CFastModePlus_PB8) || \
158  ((PIN) == SYSCFG_I2CFastModePlus_PB9))
159 
167 #define SYSCFG_Break_PVD SYSCFG_CFGR2_PVD_LOCK
168 #define SYSCFG_Break_SRAMParity SYSCFG_CFGR2_SRAM_PARITY_LOCK
169 #define SYSCFG_Break_Lockup SYSCFG_CFGR2_LOCKUP_LOCK
171 #define IS_SYSCFG_LOCK_CONFIG(CONFIG) (((CONFIG) == SYSCFG_Break_PVD) || \
172  ((CONFIG) == SYSCFG_Break_SRAMParity) || \
173  ((CONFIG) == SYSCFG_Break_Lockup))
174 
183 #define SYSCFG_FLAG_PE SYSCFG_CFGR2_SRAM_PE
184 
185 #define IS_SYSCFG_FLAG(FLAG) (((FLAG) == SYSCFG_FLAG_PE))
186 
195 /* Exported macro ------------------------------------------------------------*/
196 /* Exported functions ------------------------------------------------------- */
197 
198 /* Function used to set the SYSCFG configuration to the default reset state **/
199 void SYSCFG_DeInit(void);
200 
201 /* SYSCFG configuration functions *********************************************/
202 void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap);
203 void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState);
204 void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState);
205 void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
206 void SYSCFG_BreakConfig(uint32_t SYSCFG_Break);
207 FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag);
208 void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag);
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /*__STM32F0XX_SYSCFG_H */
215 
224 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/