stm32f30x_syscfg.h
Go to the documentation of this file.
1 
30 #ifndef __STM32F30x_SYSCFG_H
31 #define __STM32F30x_SYSCFG_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
38 #include "stm32f30x.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 /* Exported constants --------------------------------------------------------*/
50 
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 
65 #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
66  ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
67  ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
68  ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
69  ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
70  ((PORTSOURCE) == EXTI_PortSourceGPIOF))
71 
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 
95 #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
96  ((PINSOURCE) == EXTI_PinSource1) || \
97  ((PINSOURCE) == EXTI_PinSource2) || \
98  ((PINSOURCE) == EXTI_PinSource3) || \
99  ((PINSOURCE) == EXTI_PinSource4) || \
100  ((PINSOURCE) == EXTI_PinSource5) || \
101  ((PINSOURCE) == EXTI_PinSource6) || \
102  ((PINSOURCE) == EXTI_PinSource7) || \
103  ((PINSOURCE) == EXTI_PinSource8) || \
104  ((PINSOURCE) == EXTI_PinSource9) || \
105  ((PINSOURCE) == EXTI_PinSource10) || \
106  ((PINSOURCE) == EXTI_PinSource11) || \
107  ((PINSOURCE) == EXTI_PinSource12) || \
108  ((PINSOURCE) == EXTI_PinSource13) || \
109  ((PINSOURCE) == EXTI_PinSource14) || \
110  ((PINSOURCE) == EXTI_PinSource15))
111 
118 #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
119 #define SYSCFG_MemoryRemap_SystemMemory ((uint8_t)0x01)
120 #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
121 
122 
123 #define IS_SYSCFG_MEMORY_REMAP(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
124  ((REMAP) == SYSCFG_MemoryRemap_SystemMemory) || \
125  ((REMAP) == SYSCFG_MemoryRemap_SRAM))
126 
134 #define SYSCFG_DMARemap_TIM17 SYSCFG_CFGR1_TIM17_DMA_RMP
135 #define SYSCFG_DMARemap_TIM16 SYSCFG_CFGR1_TIM16_DMA_RMP
136 #define SYSCFG_DMARemap_ADC2ADC4 SYSCFG_CFGR1_ADC24_DMA_RMP
138 #define SYSCFG_DMARemap_TIM6DAC1Ch1 SYSCFG_CFGR1_TIM6DAC1Ch1_DMA_RMP /* Remap TIM6/DAC1 Ch1 DMA requests */
139 #define SYSCFG_DMARemap_TIM7DAC1Ch2 SYSCFG_CFGR1_TIM7DAC1Ch2_DMA_RMP /* Remap TIM7/DAC1 Ch2 DMA requests */
140 #define SYSCFG_DMARemap_DAC2Ch1 SYSCFG_CFGR1_DAC2Ch1_DMA_RMP /* Remap DAC2 Ch1 DMA requests */
141 
142 #define SYSCFG_DMARemapCh2_SPI1_RX ((uint32_t)0x80000003) /* Remap SPI1 RX DMA CH2 requests */
143 #define SYSCFG_DMARemapCh4_SPI1_RX ((uint32_t)0x80000001) /* Remap SPI1 RX DMA CH4 requests */
144 #define SYSCFG_DMARemapCh6_SPI1_RX ((uint32_t)0x80000002) /* Remap SPI1 RX DMA CH6 requests */
145 
146 #define SYSCFG_DMARemapCh3_SPI1_TX ((uint32_t)0x8000000C) /* Remap SPI1 TX DMA CH2 requests */
147 #define SYSCFG_DMARemapCh5_SPI1_TX ((uint32_t)0x80000004) /* Remap SPI1 TX DMA CH5 requests */
148 #define SYSCFG_DMARemapCh7_SPI1_TX ((uint32_t)0x80000008) /* Remap SPI1 TX DMA CH7 requests */
149 
150 #define SYSCFG_DMARemapCh7_I2C1_RX ((uint32_t)0x80000030) /* Remap I2C1 RX DMA CH7 requests */
151 #define SYSCFG_DMARemapCh3_I2C1_RX ((uint32_t)0x80000010) /* Remap I2C1 RX DMA CH3 requests */
152 #define SYSCFG_DMARemapCh5_I2C1_RX ((uint32_t)0x80000020) /* Remap I2C1 RX DMA CH5 requests */
153 
154 #define SYSCFG_DMARemapCh6_I2C1_TX ((uint32_t)0x800000C0) /* Remap I2C1 TX DMA CH6 requests */
155 #define SYSCFG_DMARemapCh2_I2C1_TX ((uint32_t)0x80000040) /* Remap I2C1 TX DMA CH2 requests */
156 #define SYSCFG_DMARemapCh4_I2C1_TX ((uint32_t)0x80000080) /* Remap I2C1 TX DMA CH4 requests */
157 
158 #define SYSCFG_DMARemapCh4_ADC2 ((uint32_t)0x80000300) /* Remap ADC2 DMA1 Ch4 requests */
159 #define SYSCFG_DMARemapCh2_ADC2 ((uint32_t)0x80000200) /* Remap ADC2 DMA1 Ch2 requests */
160 
161 /* SYSCFG_DMA_Remap_Legacy */
162 #define SYSCFG_DMARemap_TIM6DAC1 SYSCFG_DMARemap_TIM6DAC1Ch1
163 #define SYSCFG_DMARemap_TIM7DAC2 SYSCFG_DMARemap_TIM7DAC1Ch2
165 #define IS_SYSCFG_DMA_REMAP(REMAP) (((REMAP) == SYSCFG_DMARemap_TIM17) || \
166  ((REMAP) == SYSCFG_DMARemap_TIM16) || \
167  ((REMAP) == SYSCFG_DMARemap_ADC2ADC4) || \
168  ((REMAP) == SYSCFG_DMARemap_TIM6DAC1Ch1) || \
169  ((REMAP) == SYSCFG_DMARemap_TIM7DAC1Ch2) || \
170  ((REMAP) == SYSCFG_DMARemap_DAC2Ch1) || \
171  ((REMAP) == SYSCFG_DMARemapCh2_SPI1_RX) || \
172  ((REMAP) == SYSCFG_DMARemapCh4_SPI1_RX) || \
173  ((REMAP) == SYSCFG_DMARemapCh6_SPI1_RX) || \
174  ((REMAP) == SYSCFG_DMARemapCh5_SPI1_TX) || \
175  ((REMAP) == SYSCFG_DMARemapCh5_SPI1_TX) || \
176  ((REMAP) == SYSCFG_DMARemapCh7_SPI1_TX) || \
177  ((REMAP) == SYSCFG_DMARemapCh7_I2C1_RX) || \
178  ((REMAP) == SYSCFG_DMARemapCh3_I2C1_RX) || \
179  ((REMAP) == SYSCFG_DMARemapCh5_I2C1_RX) || \
180  ((REMAP) == SYSCFG_DMARemapCh6_I2C1_TX) || \
181  ((REMAP) == SYSCFG_DMARemapCh2_I2C1_TX) || \
182  ((REMAP) == SYSCFG_DMARemapCh4_I2C1_TX) || \
183  ((REMAP) == SYSCFG_DMARemapCh4_ADC2) || \
184  ((REMAP) == SYSCFG_DMARemapCh2_ADC2))
185 
193 #define SYSCFG_TriggerRemap_DACTIM3 SYSCFG_CFGR1_DAC1_TRIG1_RMP
194 #define SYSCFG_TriggerRemap_TIM1TIM17 SYSCFG_CFGR1_TIM1_ITR3_RMP
195 #define SYSCFG_TriggerRemap_DACHRTIM1_TRIG1 ((uint32_t)0x80010000)
196 #define SYSCFG_TriggerRemap_DACHRTIM1_TRIG2 ((uint32_t)0x80020000)
198 #define IS_SYSCFG_TRIGGER_REMAP(REMAP) (((REMAP) == SYSCFG_TriggerRemap_DACTIM3) || \
199  ((REMAP) == SYSCFG_TriggerRemap_DACHRTIM1_TRIG1) || \
200  ((REMAP) == SYSCFG_TriggerRemap_DACHRTIM1_TRIG2) || \
201  ((REMAP) == SYSCFG_TriggerRemap_TIM1TIM17))
202 
210 #define SYSCFG_EncoderRemap_No ((uint32_t)0x00000000)
211 #define SYSCFG_EncoderRemap_TIM2 SYSCFG_CFGR1_ENCODER_MODE_0
212 #define SYSCFG_EncoderRemap_TIM3 SYSCFG_CFGR1_ENCODER_MODE_1
213 #define SYSCFG_EncoderRemap_TIM4 SYSCFG_CFGR1_ENCODER_MODE
215 #define IS_SYSCFG_ENCODER_REMAP(REMAP) (((REMAP) == SYSCFG_EncoderRemap_No) || \
216  ((REMAP) == SYSCFG_EncoderRemap_TIM2) || \
217  ((REMAP) == SYSCFG_EncoderRemap_TIM3) || \
218  ((REMAP) == SYSCFG_EncoderRemap_TIM4))
219 
227 #define SYSCFG_I2CFastModePlus_PB6 SYSCFG_CFGR1_I2C_PB6_FMP
228 #define SYSCFG_I2CFastModePlus_PB7 SYSCFG_CFGR1_I2C_PB7_FMP
229 #define SYSCFG_I2CFastModePlus_PB8 SYSCFG_CFGR1_I2C_PB8_FMP
230 #define SYSCFG_I2CFastModePlus_PB9 SYSCFG_CFGR1_I2C_PB9_FMP
231 #define SYSCFG_I2CFastModePlus_I2C1 SYSCFG_CFGR1_I2C1_FMP
232 #define SYSCFG_I2CFastModePlus_I2C2 SYSCFG_CFGR1_I2C2_FMP
234 #define IS_SYSCFG_I2C_FMP(PIN) (((PIN) == SYSCFG_I2CFastModePlus_PB6) || \
235  ((PIN) == SYSCFG_I2CFastModePlus_PB7) || \
236  ((PIN) == SYSCFG_I2CFastModePlus_PB8) || \
237  ((PIN) == SYSCFG_I2CFastModePlus_PB9) || \
238  ((PIN) == SYSCFG_I2CFastModePlus_I2C1) || \
239  ((PIN) == SYSCFG_I2CFastModePlus_I2C2))
240 
248 #define SYSCFG_IT_IXC SYSCFG_CFGR1_FPU_IE_5
249 #define SYSCFG_IT_IDC SYSCFG_CFGR1_FPU_IE_4
250 #define SYSCFG_IT_OFC SYSCFG_CFGR1_FPU_IE_3
251 #define SYSCFG_IT_UFC SYSCFG_CFGR1_FPU_IE_2
252 #define SYSCFG_IT_DZC SYSCFG_CFGR1_FPU_IE_1
253 #define SYSCFG_IT_IOC SYSCFG_CFGR1_FPU_IE_0
255 #define IS_SYSCFG_IT(IT) ((((IT) & (uint32_t)0x03FFFFFF) == 0) && ((IT) != 0))
256 
264 #define SYSCFG_Break_PVD SYSCFG_CFGR2_PVD_LOCK
265 #define SYSCFG_Break_SRAMParity SYSCFG_CFGR2_SRAM_PARITY_LOCK
266 #define SYSCFG_Break_Lockup SYSCFG_CFGR2_LOCKUP_LOCK
268 #define IS_SYSCFG_LOCK_CONFIG(CONFIG) (((CONFIG) == SYSCFG_Break_PVD) || \
269  ((CONFIG) == SYSCFG_Break_SRAMParity) || \
270  ((CONFIG) == SYSCFG_Break_Lockup))
271 
279 #define SYSCFG_SRAMWRP_Page0 SYSCFG_RCR_PAGE0
280 #define SYSCFG_SRAMWRP_Page1 SYSCFG_RCR_PAGE1
281 #define SYSCFG_SRAMWRP_Page2 SYSCFG_RCR_PAGE2
282 #define SYSCFG_SRAMWRP_Page3 SYSCFG_RCR_PAGE3
283 #define SYSCFG_SRAMWRP_Page4 SYSCFG_RCR_PAGE4
284 #define SYSCFG_SRAMWRP_Page5 SYSCFG_RCR_PAGE5
285 #define SYSCFG_SRAMWRP_Page6 SYSCFG_RCR_PAGE6
286 #define SYSCFG_SRAMWRP_Page7 SYSCFG_RCR_PAGE7
288 #define IS_SYSCFG_PAGE(PAGE)((((PAGE) & (uint32_t)0xFFFFFF00) == 0x00000000) && ((PAGE) != 0x00000000))
289 
298 #define SYSCFG_FLAG_PE SYSCFG_CFGR2_SRAM_PE
299 
300 #define IS_SYSCFG_FLAG(FLAG) (((FLAG) == SYSCFG_FLAG_PE))
301 
310 /* Exported macro ------------------------------------------------------------*/
311 /* Exported functions ------------------------------------------------------- */
312 
313 /* Function used to set the SYSCFG configuration to the default reset state **/
314 void SYSCFG_DeInit(void);
315 
316 /* SYSCFG configuration functions *********************************************/
317 void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap);
318 void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState);
319 void SYSCFG_TriggerRemapConfig(uint32_t SYSCFG_TriggerRemap, FunctionalState NewState);
320 void SYSCFG_EncoderRemapConfig(uint32_t SYSCFG_EncoderRemap);
322 void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState);
323 void SYSCFG_ITConfig(uint32_t SYSCFG_IT, FunctionalState NewState);
324 void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
325 void SYSCFG_BreakConfig(uint32_t SYSCFG_Break);
327 void SYSCFG_SRAMWRPEnable(uint32_t SYSCFG_SRAMWRP);
328 FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag);
329 void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag);
330 
331 #ifdef __cplusplus
332 }
333 #endif
334 
335 #endif /*__STM32F30x_SYSCFG_H */
336 
345 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
FlagStatus
Definition: stm32f4xx.h:706
void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState)
Configures the DMA channels remapping.
void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap)
Configures the memory mapping at address 0x00000000.
FunctionalState
Definition: stm32f4xx.h:708
void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag)
Clears the selected SYSCFG flag.
void SYSCFG_ITConfig(uint32_t SYSCFG_IT, FunctionalState NewState)
Enables or disables the selected SYSCFG interrupts.
FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag)
Checks whether the specified SYSCFG flag is set or not.
void SYSCFG_USBInterruptLineRemapCmd(FunctionalState NewState)
Remaps the USB interrupt lines.
void SYSCFG_BreakConfig(uint32_t SYSCFG_Break)
Connects the selected parameter to the break input of TIM1.
void SYSCFG_BypassParityCheckDisable(void)
Disables the parity check on RAM.
void SYSCFG_SRAMWRPEnable(uint32_t SYSCFG_SRAMWRP)
Enables the ICODE SRAM write protection.
void SYSCFG_EncoderRemapConfig(uint32_t SYSCFG_EncoderRemap)
Configures the remapping capabilities of encoder mode. @ note This feature implement the so-called M/...
void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex)
Selects the GPIO pin used as EXTI Line.
void SYSCFG_DeInit(void)
Deinitializes the Alternate Functions (remap and EXTI configuration) registers to their default reset...
void SYSCFG_TriggerRemapConfig(uint32_t SYSCFG_TriggerRemap, FunctionalState NewState)
Configures the remapping capabilities of DAC/TIM triggers.
void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState)
Configures the I2C fast mode plus driving capability.


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:25