aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/demos/STM32/RT-STM32G071RB-NUCLEO64/cfg/mcuconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/demos/STM32/RT-STM32G071RB-NUCLEO64/cfg/mcuconf.h')
-rw-r--r--lib/chibios/demos/STM32/RT-STM32G071RB-NUCLEO64/cfg/mcuconf.h236
1 files changed, 236 insertions, 0 deletions
diff --git a/lib/chibios/demos/STM32/RT-STM32G071RB-NUCLEO64/cfg/mcuconf.h b/lib/chibios/demos/STM32/RT-STM32G071RB-NUCLEO64/cfg/mcuconf.h
new file mode 100644
index 000000000..51b58cf59
--- /dev/null
+++ b/lib/chibios/demos/STM32/RT-STM32G071RB-NUCLEO64/cfg/mcuconf.h
@@ -0,0 +1,236 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*
18 * STM32G0xx drivers configuration.
19 * The following settings override the default settings present in
20 * the various device driver implementation headers.
21 * Note that the settings for each driver only have effect if the whole
22 * driver is enabled in halconf.h.
23 *
24 * IRQ priorities:
25 * 3...0 Lowest...Highest.
26 *
27 * DMA priorities:
28 * 0...3 Lowest...Highest.
29 */
30
31#ifndef MCUCONF_H
32#define MCUCONF_H
33
34#define STM32G0xx_MCUCONF
35#define STM32G071_MCUCONF
36#define STM32G081_MCUCONF
37
38/*
39 * HAL driver system settings.
40 */
41#define STM32_NO_INIT FALSE
42#define STM32_VOS STM32_VOS_RANGE1
43#define STM32_PWR_CR2 (STM32_PVDRT_LEV0 | STM32_PVDFT_LEV0 | STM32_PVDE_DISABLED)
44#define STM32_HSIDIV_VALUE 1
45#define STM32_HSI16_ENABLED TRUE
46#define STM32_HSE_ENABLED FALSE
47#define STM32_LSI_ENABLED TRUE
48#define STM32_LSE_ENABLED FALSE
49#define STM32_SW STM32_SW_PLLRCLK
50#define STM32_PLLSRC STM32_PLLSRC_HSI16
51#define STM32_PLLM_VALUE 2
52#define STM32_PLLN_VALUE 16
53#define STM32_PLLP_VALUE 2
54#define STM32_PLLQ_VALUE 4
55#define STM32_PLLR_VALUE 2
56#define STM32_HPRE STM32_HPRE_DIV1
57#define STM32_PPRE STM32_PPRE_DIV1
58#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
59#define STM32_MCOPRE STM32_MCOPRE_DIV1
60#define STM32_LSCOSEL STM32_LSCOSEL_NOCLOCK
61
62/*
63 * Peripherals clocks and sources.
64 */
65#define STM32_USART1SEL STM32_USART1SEL_SYSCLK
66#define STM32_USART2SEL STM32_USART2SEL_SYSCLK
67#define STM32_LPUART1SEL STM32_LPUART1SEL_SYSCLK
68#define STM32_CECSEL STM32_CECSEL_HSI16DIV
69#define STM32_I2C1SEL STM32_I2C1SEL_PCLK
70#define STM32_I2S1SEL STM32_I2S1SEL_SYSCLK
71#define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK
72#define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK
73#define STM32_TIM1SEL STM32_TIM1SEL_TIMPCLK
74#define STM32_TIM15SEL STM32_TIM15SEL_TIMPCLK
75#define STM32_RNGSEL STM32_RNGSEL_HSI16
76#define STM32_RNGDIV_VALUE 1
77#define STM32_ADCSEL STM32_ADCSEL_PLLPCLK
78#define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
79
80/*
81 * Shared IRQ settings.
82 */
83#define STM32_IRQ_EXTI0_1_PRIORITY 3
84#define STM32_IRQ_EXTI2_3_PRIORITY 3
85#define STM32_IRQ_EXTI4_15_PRIORITY 3
86#define STM32_IRQ_EXTI1921_PRIORITY 3
87
88#define STM32_IRQ_USART1_PRIORITY 2
89#define STM32_IRQ_USART2_PRIORITY 2
90#define STM32_IRQ_USART3_4_LP1_PRIORITY 2
91
92#define STM32_IRQ_TIM1_UP_PRIORITY 1
93#define STM32_IRQ_TIM1_CC_PRIORITY 1
94#define STM32_IRQ_TIM2_PRIORITY 1
95#define STM32_IRQ_TIM3_PRIORITY 1
96#define STM32_IRQ_TIM6_PRIORITY 1
97#define STM32_IRQ_TIM7_PRIORITY 1
98#define STM32_IRQ_TIM14_PRIORITY 1
99#define STM32_IRQ_TIM15_PRIORITY 1
100#define STM32_IRQ_TIM16_PRIORITY 1
101#define STM32_IRQ_TIM17_PRIORITY 1
102
103/*
104 * ADC driver system settings.
105 */
106#define STM32_ADC_USE_ADC1 FALSE
107#define STM32_ADC_ADC1_CKMODE STM32_ADC_CKMODE_ADCCLK
108#define STM32_ADC_ADC1_DMA_PRIORITY 2
109#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
110#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID_ANY
111#define STM32_ADC_PRESCALER_VALUE 2
112
113/*
114 * DAC driver system settings.
115 */
116#define STM32_DAC_DUAL_MODE FALSE
117#define STM32_DAC_USE_DAC1_CH1 FALSE
118#define STM32_DAC_USE_DAC1_CH2 FALSE
119#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 3
120#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 3
121#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
122#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
123#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID_ANY
124#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID_ANY
125
126/*
127 * GPT driver system settings.
128 */
129#define STM32_GPT_USE_TIM1 FALSE
130#define STM32_GPT_USE_TIM2 FALSE
131#define STM32_GPT_USE_TIM3 FALSE
132#define STM32_GPT_USE_TIM6 FALSE
133#define STM32_GPT_USE_TIM7 FALSE
134
135/*
136 * I2C driver system settings.
137 */
138#define STM32_I2C_USE_I2C1 FALSE
139#define STM32_I2C_USE_I2C2 FALSE
140#define STM32_I2C_BUSY_TIMEOUT 50
141#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
142#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
143#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
144#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
145#define STM32_I2C_I2C1_IRQ_PRIORITY 3
146#define STM32_I2C_I2C2_IRQ_PRIORITY 3
147#define STM32_I2C_I2C1_DMA_PRIORITY 3
148#define STM32_I2C_I2C2_DMA_PRIORITY 3
149#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
150
151/*
152 * ICU driver system settings.
153 */
154#define STM32_ICU_USE_TIM1 FALSE
155#define STM32_ICU_USE_TIM2 FALSE
156#define STM32_ICU_USE_TIM3 FALSE
157
158/*
159 * PWM driver system settings.
160 */
161#define STM32_PWM_USE_ADVANCED FALSE
162#define STM32_PWM_USE_TIM1 FALSE
163#define STM32_PWM_USE_TIM2 FALSE
164#define STM32_PWM_USE_TIM3 FALSE
165
166/*
167 * RTC driver system settings.
168 */
169#define STM32_RTC_PRESA_VALUE 32
170#define STM32_RTC_PRESS_VALUE 1024
171#define STM32_RTC_CR_INIT 0
172#define STM32_RTC_TAMPCR_INIT 0
173
174/*
175 * SERIAL driver system settings.
176 */
177#define STM32_SERIAL_USE_USART1 FALSE
178#define STM32_SERIAL_USE_USART2 TRUE
179#define STM32_SERIAL_USE_USART3 FALSE
180#define STM32_SERIAL_USE_UART4 FALSE
181#define STM32_SERIAL_USE_LPUART1 FALSE
182
183/*
184 * SPI driver system settings.
185 */
186#define STM32_SPI_USE_SPI1 FALSE
187#define STM32_SPI_USE_SPI2 FALSE
188#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
189#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
190#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
191#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
192#define STM32_SPI_SPI1_DMA_PRIORITY 1
193#define STM32_SPI_SPI2_DMA_PRIORITY 1
194#define STM32_SPI_SPI1_IRQ_PRIORITY 2
195#define STM32_SPI_SPI2_IRQ_PRIORITY 2
196#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
197
198/*
199 * ST driver system settings.
200 */
201#define STM32_ST_IRQ_PRIORITY 2
202#define STM32_ST_USE_TIMER 2
203
204/*
205 * TRNG driver system settings.
206 * NOTE: STM32G081 only.
207 */
208#define STM32_TRNG_USE_RNG1 FALSE
209
210/*
211 * UART driver system settings.
212 */
213#define STM32_UART_USE_USART1 FALSE
214#define STM32_UART_USE_USART2 FALSE
215#define STM32_UART_USE_USART3 FALSE
216#define STM32_UART_USE_UART4 FALSE
217#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
218#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
219#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
220#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
221#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
222#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
223#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
224#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
225#define STM32_UART_USART1_DMA_PRIORITY 0
226#define STM32_UART_USART2_DMA_PRIORITY 0
227#define STM32_UART_USART3_DMA_PRIORITY 0
228#define STM32_UART_UART4_DMA_PRIORITY 0
229#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
230
231/*
232 * WDG driver system settings.
233 */
234#define STM32_WDG_USE_IWDG FALSE
235
236#endif /* MCUCONF_H */