diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY')
3 files changed, 1636 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.c b/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.c new file mode 100644 index 000000000..cd9e32ee7 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.c | |||
@@ -0,0 +1,288 @@ | |||
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 | * This file has been automatically generated using ChibiStudio board | ||
19 | * generator plugin. Do not edit manually. | ||
20 | */ | ||
21 | |||
22 | #include "hal.h" | ||
23 | #include "stm32_gpio.h" | ||
24 | |||
25 | /*===========================================================================*/ | ||
26 | /* Driver local definitions. */ | ||
27 | /*===========================================================================*/ | ||
28 | |||
29 | /*===========================================================================*/ | ||
30 | /* Driver exported variables. */ | ||
31 | /*===========================================================================*/ | ||
32 | |||
33 | /*===========================================================================*/ | ||
34 | /* Driver local variables and types. */ | ||
35 | /*===========================================================================*/ | ||
36 | |||
37 | /** | ||
38 | * @brief Type of STM32 GPIO port setup. | ||
39 | */ | ||
40 | typedef struct { | ||
41 | uint32_t moder; | ||
42 | uint32_t otyper; | ||
43 | uint32_t ospeedr; | ||
44 | uint32_t pupdr; | ||
45 | uint32_t odr; | ||
46 | uint32_t afrl; | ||
47 | uint32_t afrh; | ||
48 | } gpio_setup_t; | ||
49 | |||
50 | /** | ||
51 | * @brief Type of STM32 GPIO initialization data. | ||
52 | */ | ||
53 | typedef struct { | ||
54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
55 | gpio_setup_t PAData; | ||
56 | #endif | ||
57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
58 | gpio_setup_t PBData; | ||
59 | #endif | ||
60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
61 | gpio_setup_t PCData; | ||
62 | #endif | ||
63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
64 | gpio_setup_t PDData; | ||
65 | #endif | ||
66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
67 | gpio_setup_t PEData; | ||
68 | #endif | ||
69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
70 | gpio_setup_t PFData; | ||
71 | #endif | ||
72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
73 | gpio_setup_t PGData; | ||
74 | #endif | ||
75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
76 | gpio_setup_t PHData; | ||
77 | #endif | ||
78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
79 | gpio_setup_t PIData; | ||
80 | #endif | ||
81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
82 | gpio_setup_t PJData; | ||
83 | #endif | ||
84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
85 | gpio_setup_t PKData; | ||
86 | #endif | ||
87 | } gpio_config_t; | ||
88 | |||
89 | /** | ||
90 | * @brief STM32 GPIO static initialization data. | ||
91 | */ | ||
92 | static const gpio_config_t gpio_default_config = { | ||
93 | #if STM32_HAS_GPIOA | ||
94 | { | ||
95 | VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
96 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH | ||
97 | }, | ||
98 | #endif | ||
99 | #if STM32_HAS_GPIOB | ||
100 | { | ||
101 | VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
102 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH | ||
103 | }, | ||
104 | #endif | ||
105 | #if STM32_HAS_GPIOC | ||
106 | { | ||
107 | VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
108 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH | ||
109 | }, | ||
110 | #endif | ||
111 | #if STM32_HAS_GPIOD | ||
112 | { | ||
113 | VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
114 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH | ||
115 | }, | ||
116 | #endif | ||
117 | #if STM32_HAS_GPIOE | ||
118 | { | ||
119 | VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
120 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH | ||
121 | }, | ||
122 | #endif | ||
123 | #if STM32_HAS_GPIOF | ||
124 | { | ||
125 | VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
126 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH | ||
127 | }, | ||
128 | #endif | ||
129 | #if STM32_HAS_GPIOG | ||
130 | { | ||
131 | VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
132 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH | ||
133 | }, | ||
134 | #endif | ||
135 | #if STM32_HAS_GPIOH | ||
136 | { | ||
137 | VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
138 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH | ||
139 | }, | ||
140 | #endif | ||
141 | #if STM32_HAS_GPIOI | ||
142 | { | ||
143 | VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
144 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH | ||
145 | }, | ||
146 | #endif | ||
147 | #if STM32_HAS_GPIOJ | ||
148 | { | ||
149 | VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
150 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH | ||
151 | }, | ||
152 | #endif | ||
153 | #if STM32_HAS_GPIOK | ||
154 | { | ||
155 | VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
156 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH | ||
157 | } | ||
158 | #endif | ||
159 | }; | ||
160 | |||
161 | /*===========================================================================*/ | ||
162 | /* Driver local functions. */ | ||
163 | /*===========================================================================*/ | ||
164 | |||
165 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
166 | |||
167 | gpiop->OTYPER = config->otyper; | ||
168 | gpiop->OSPEEDR = config->ospeedr; | ||
169 | gpiop->PUPDR = config->pupdr; | ||
170 | gpiop->ODR = config->odr; | ||
171 | gpiop->AFRL = config->afrl; | ||
172 | gpiop->AFRH = config->afrh; | ||
173 | gpiop->MODER = config->moder; | ||
174 | } | ||
175 | |||
176 | static void stm32_gpio_init(void) { | ||
177 | |||
178 | /* Enabling GPIO-related clocks, the mask comes from the | ||
179 | registry header file.*/ | ||
180 | rccResetAHB1(STM32_GPIO_EN_MASK); | ||
181 | rccEnableAHB1(STM32_GPIO_EN_MASK, true); | ||
182 | |||
183 | /* Initializing all the defined GPIO ports.*/ | ||
184 | #if STM32_HAS_GPIOA | ||
185 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
186 | #endif | ||
187 | #if STM32_HAS_GPIOB | ||
188 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
189 | #endif | ||
190 | #if STM32_HAS_GPIOC | ||
191 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
192 | #endif | ||
193 | #if STM32_HAS_GPIOD | ||
194 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
195 | #endif | ||
196 | #if STM32_HAS_GPIOE | ||
197 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
198 | #endif | ||
199 | #if STM32_HAS_GPIOF | ||
200 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
201 | #endif | ||
202 | #if STM32_HAS_GPIOG | ||
203 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
204 | #endif | ||
205 | #if STM32_HAS_GPIOH | ||
206 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
207 | #endif | ||
208 | #if STM32_HAS_GPIOI | ||
209 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
210 | #endif | ||
211 | #if STM32_HAS_GPIOJ | ||
212 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
213 | #endif | ||
214 | #if STM32_HAS_GPIOK | ||
215 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
216 | #endif | ||
217 | } | ||
218 | |||
219 | /*===========================================================================*/ | ||
220 | /* Driver interrupt handlers. */ | ||
221 | /*===========================================================================*/ | ||
222 | |||
223 | /*===========================================================================*/ | ||
224 | /* Driver exported functions. */ | ||
225 | /*===========================================================================*/ | ||
226 | |||
227 | /** | ||
228 | * @brief Early initialization code. | ||
229 | * @details GPIO ports and system clocks are initialized before everything | ||
230 | * else. | ||
231 | */ | ||
232 | void __early_init(void) { | ||
233 | |||
234 | stm32_gpio_init(); | ||
235 | stm32_clock_init(); | ||
236 | } | ||
237 | |||
238 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
239 | /** | ||
240 | * @brief SDC card detection. | ||
241 | */ | ||
242 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
243 | |||
244 | (void)sdcp; | ||
245 | /* TODO: Fill the implementation.*/ | ||
246 | return true; | ||
247 | } | ||
248 | |||
249 | /** | ||
250 | * @brief SDC card write protection detection. | ||
251 | */ | ||
252 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
253 | |||
254 | (void)sdcp; | ||
255 | /* TODO: Fill the implementation.*/ | ||
256 | return false; | ||
257 | } | ||
258 | #endif /* HAL_USE_SDC */ | ||
259 | |||
260 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
261 | /** | ||
262 | * @brief MMC_SPI card detection. | ||
263 | */ | ||
264 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
265 | |||
266 | (void)mmcp; | ||
267 | /* TODO: Fill the implementation.*/ | ||
268 | return true; | ||
269 | } | ||
270 | |||
271 | /** | ||
272 | * @brief MMC_SPI card write protection detection. | ||
273 | */ | ||
274 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
275 | |||
276 | (void)mmcp; | ||
277 | /* TODO: Fill the implementation.*/ | ||
278 | return false; | ||
279 | } | ||
280 | #endif | ||
281 | |||
282 | /** | ||
283 | * @brief Board-specific initialization code. | ||
284 | * @todo Add your board-specific code, if any. | ||
285 | */ | ||
286 | void boardInit(void) { | ||
287 | |||
288 | } | ||
diff --git a/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.h b/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.h new file mode 100644 index 000000000..f24a5d479 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.h | |||
@@ -0,0 +1,1339 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
3 | ChibiOS ST32F411-Disco Board Description - Copyright (C) 2019 Tim Rheinfels | ||
4 | |||
5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | you may not use this file except in compliance with the License. | ||
7 | You may obtain a copy of the License at | ||
8 | |||
9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | |||
11 | Unless required by applicable law or agreed to in writing, software | ||
12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | See the License for the specific language governing permissions and | ||
15 | limitations under the License. | ||
16 | */ | ||
17 | |||
18 | /* | ||
19 | * This file has been automatically generated using ChibiStudio board | ||
20 | * generator plugin. Do not edit manually. | ||
21 | */ | ||
22 | |||
23 | /* | ||
24 | * Did so... Using the ChibiOS / STM32F4-Disco HAL with the following changes: | ||
25 | * | ||
26 | * - STM32F4 -> STM32F411 | ||
27 | * - Removed all pad specializations except for SWD and HSE oscillator | ||
28 | */ | ||
29 | |||
30 | #ifndef BOARD_H | ||
31 | #define BOARD_H | ||
32 | |||
33 | /*===========================================================================*/ | ||
34 | /* Driver constants. */ | ||
35 | /*===========================================================================*/ | ||
36 | |||
37 | /* | ||
38 | * Setup for STMicroelectronics STM32F411-Discovery board. | ||
39 | */ | ||
40 | |||
41 | /* | ||
42 | * Board identifier. | ||
43 | */ | ||
44 | #define BOARD_ST_STM32F411_DISCOVERY | ||
45 | #define BOARD_NAME "STMicroelectronics STM32F411-Discovery" | ||
46 | |||
47 | /* | ||
48 | * Board oscillators-related settings. | ||
49 | * NOTE: LSE not fitted. | ||
50 | */ | ||
51 | #if !defined(STM32_LSECLK) | ||
52 | #define STM32_LSECLK 0U | ||
53 | #endif | ||
54 | |||
55 | #if !defined(STM32_HSECLK) | ||
56 | #define STM32_HSECLK 8000000U | ||
57 | #endif | ||
58 | |||
59 | /* | ||
60 | * Board voltages. | ||
61 | * Required for performance limits calculation. | ||
62 | */ | ||
63 | #define STM32_VDD 300U | ||
64 | |||
65 | /* | ||
66 | * MCU type as defined in the ST header. | ||
67 | */ | ||
68 | #define STM32F411xE | ||
69 | |||
70 | /* | ||
71 | * IO pins assignments. | ||
72 | */ | ||
73 | #define GPIOA_PIN0 0U | ||
74 | #define GPIOA_PIN1 1U | ||
75 | #define GPIOA_PIN2 2U | ||
76 | #define GPIOA_PIN3 3U | ||
77 | #define GPIOA_PIN4 4U | ||
78 | #define GPIOA_PIN5 5U | ||
79 | #define GPIOA_PIN6 6U | ||
80 | #define GPIOA_PIN7 7U | ||
81 | #define GPIOA_PIN8 8U | ||
82 | #define GPIOA_PIN9 9U | ||
83 | #define GPIOA_PIN10 10U | ||
84 | #define GPIOA_PIN11 11U | ||
85 | #define GPIOA_PIN12 12U | ||
86 | #define GPIOA_SWDIO 13U | ||
87 | #define GPIOA_SWCLK 14U | ||
88 | #define GPIOA_PIN15 15U | ||
89 | |||
90 | #define GPIOB_PIN0 0U | ||
91 | #define GPIOB_PIN1 1U | ||
92 | #define GPIOB_PIN2 2U | ||
93 | #define GPIOB_PIN3 3U | ||
94 | #define GPIOB_PIN4 4U | ||
95 | #define GPIOB_PIN5 5U | ||
96 | #define GPIOB_PIN6 6U | ||
97 | #define GPIOB_PIN7 7U | ||
98 | #define GPIOB_PIN8 8U | ||
99 | #define GPIOB_PIN9 9U | ||
100 | #define GPIOB_PIN10 10U | ||
101 | #define GPIOB_PIN11 11U | ||
102 | #define GPIOB_PIN12 12U | ||
103 | #define GPIOB_PIN13 13U | ||
104 | #define GPIOB_PIN14 14U | ||
105 | #define GPIOB_PIN15 15U | ||
106 | |||
107 | #define GPIOC_PIN0 0U | ||
108 | #define GPIOC_PIN1 1U | ||
109 | #define GPIOC_PIN2 2U | ||
110 | #define GPIOC_PIN3 3U | ||
111 | #define GPIOC_PIN4 4U | ||
112 | #define GPIOC_PIN5 5U | ||
113 | #define GPIOC_PIN6 6U | ||
114 | #define GPIOC_PIN7 7U | ||
115 | #define GPIOC_PIN8 8U | ||
116 | #define GPIOC_PIN9 9U | ||
117 | #define GPIOC_PIN10 10U | ||
118 | #define GPIOC_PIN11 11U | ||
119 | #define GPIOC_PIN12 12U | ||
120 | #define GPIOC_PIN13 13U | ||
121 | #define GPIOC_PIN14 14U | ||
122 | #define GPIOC_PIN15 15U | ||
123 | |||
124 | #define GPIOD_PIN0 0U | ||
125 | #define GPIOD_PIN1 1U | ||
126 | #define GPIOD_PIN2 2U | ||
127 | #define GPIOD_PIN3 3U | ||
128 | #define GPIOD_PIN4 4U | ||
129 | #define GPIOD_PIN5 5U | ||
130 | #define GPIOD_PIN6 6U | ||
131 | #define GPIOD_PIN7 7U | ||
132 | #define GPIOD_PIN8 8U | ||
133 | #define GPIOD_PIN9 9U | ||
134 | #define GPIOD_PIN10 10U | ||
135 | #define GPIOD_PIN11 11U | ||
136 | #define GPIOD_PIN12 12U | ||
137 | #define GPIOD_PIN13 13U | ||
138 | #define GPIOD_PIN14 14U | ||
139 | #define GPIOD_PIN15 15U | ||
140 | |||
141 | #define GPIOE_PIN0 0U | ||
142 | #define GPIOE_PIN1 1U | ||
143 | #define GPIOE_PIN2 2U | ||
144 | #define GPIOE_PIN3 3U | ||
145 | #define GPIOE_PIN4 4U | ||
146 | #define GPIOE_PIN5 5U | ||
147 | #define GPIOE_PIN6 6U | ||
148 | #define GPIOE_PIN7 7U | ||
149 | #define GPIOE_PIN8 8U | ||
150 | #define GPIOE_PIN9 9U | ||
151 | #define GPIOE_PIN10 10U | ||
152 | #define GPIOE_PIN11 11U | ||
153 | #define GPIOE_PIN12 12U | ||
154 | #define GPIOE_PIN13 13U | ||
155 | #define GPIOE_PIN14 14U | ||
156 | #define GPIOE_PIN15 15U | ||
157 | |||
158 | #define GPIOF_PIN0 0U | ||
159 | #define GPIOF_PIN1 1U | ||
160 | #define GPIOF_PIN2 2U | ||
161 | #define GPIOF_PIN3 3U | ||
162 | #define GPIOF_PIN4 4U | ||
163 | #define GPIOF_PIN5 5U | ||
164 | #define GPIOF_PIN6 6U | ||
165 | #define GPIOF_PIN7 7U | ||
166 | #define GPIOF_PIN8 8U | ||
167 | #define GPIOF_PIN9 9U | ||
168 | #define GPIOF_PIN10 10U | ||
169 | #define GPIOF_PIN11 11U | ||
170 | #define GPIOF_PIN12 12U | ||
171 | #define GPIOF_PIN13 13U | ||
172 | #define GPIOF_PIN14 14U | ||
173 | #define GPIOF_PIN15 15U | ||
174 | |||
175 | #define GPIOG_PIN0 0U | ||
176 | #define GPIOG_PIN1 1U | ||
177 | #define GPIOG_PIN2 2U | ||
178 | #define GPIOG_PIN3 3U | ||
179 | #define GPIOG_PIN4 4U | ||
180 | #define GPIOG_PIN5 5U | ||
181 | #define GPIOG_PIN6 6U | ||
182 | #define GPIOG_PIN7 7U | ||
183 | #define GPIOG_PIN8 8U | ||
184 | #define GPIOG_PIN9 9U | ||
185 | #define GPIOG_PIN10 10U | ||
186 | #define GPIOG_PIN11 11U | ||
187 | #define GPIOG_PIN12 12U | ||
188 | #define GPIOG_PIN13 13U | ||
189 | #define GPIOG_PIN14 14U | ||
190 | #define GPIOG_PIN15 15U | ||
191 | |||
192 | #define GPIOH_OSC_IN 0U | ||
193 | #define GPIOH_OSC_OUT 1U | ||
194 | #define GPIOH_PIN2 2U | ||
195 | #define GPIOH_PIN3 3U | ||
196 | #define GPIOH_PIN4 4U | ||
197 | #define GPIOH_PIN5 5U | ||
198 | #define GPIOH_PIN6 6U | ||
199 | #define GPIOH_PIN7 7U | ||
200 | #define GPIOH_PIN8 8U | ||
201 | #define GPIOH_PIN9 9U | ||
202 | #define GPIOH_PIN10 10U | ||
203 | #define GPIOH_PIN11 11U | ||
204 | #define GPIOH_PIN12 12U | ||
205 | #define GPIOH_PIN13 13U | ||
206 | #define GPIOH_PIN14 14U | ||
207 | #define GPIOH_PIN15 15U | ||
208 | |||
209 | #define GPIOI_PIN0 0U | ||
210 | #define GPIOI_PIN1 1U | ||
211 | #define GPIOI_PIN2 2U | ||
212 | #define GPIOI_PIN3 3U | ||
213 | #define GPIOI_PIN4 4U | ||
214 | #define GPIOI_PIN5 5U | ||
215 | #define GPIOI_PIN6 6U | ||
216 | #define GPIOI_PIN7 7U | ||
217 | #define GPIOI_PIN8 8U | ||
218 | #define GPIOI_PIN9 9U | ||
219 | #define GPIOI_PIN10 10U | ||
220 | #define GPIOI_PIN11 11U | ||
221 | #define GPIOI_PIN12 12U | ||
222 | #define GPIOI_PIN13 13U | ||
223 | #define GPIOI_PIN14 14U | ||
224 | #define GPIOI_PIN15 15U | ||
225 | |||
226 | /* | ||
227 | * IO lines assignments. | ||
228 | */ | ||
229 | #define LINE_SWDIO PAL_LINE(GPIOA, GPIOA_SWDIO) | ||
230 | #define LINE_SWCLK PAL_LINE(GPIOA, GPIOA_SWCLK) | ||
231 | #define LINE_OSC_IN PAL_LINE(GPIOH, 0U) | ||
232 | #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) | ||
233 | |||
234 | /*===========================================================================*/ | ||
235 | /* Driver pre-compile time settings. */ | ||
236 | /*===========================================================================*/ | ||
237 | |||
238 | /*===========================================================================*/ | ||
239 | /* Derived constants and error checks. */ | ||
240 | /*===========================================================================*/ | ||
241 | |||
242 | /*===========================================================================*/ | ||
243 | /* Driver data structures and types. */ | ||
244 | /*===========================================================================*/ | ||
245 | |||
246 | /*===========================================================================*/ | ||
247 | /* Driver macros. */ | ||
248 | /*===========================================================================*/ | ||
249 | |||
250 | /* | ||
251 | * I/O ports initial setup, this configuration is established soon after reset | ||
252 | * in the initialization code. | ||
253 | * Please refer to the STM32 Reference Manual for details. | ||
254 | */ | ||
255 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
256 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
257 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
258 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
259 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
260 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
261 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
262 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
263 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
264 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
265 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
266 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
267 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
268 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
269 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
270 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
271 | |||
272 | /* | ||
273 | * GPIOA setup: | ||
274 | * | ||
275 | * PA0 - PIN0 (analog). | ||
276 | * PA1 - PIN1 (analog). | ||
277 | * PA2 - PIN2 (analog). | ||
278 | * PA3 - PIN3 (analog). | ||
279 | * PA4 - PIN4 (analog). | ||
280 | * PA5 - PIN5 (analog). | ||
281 | * PA6 - PIN6 (analog). | ||
282 | * PA7 - PIN7 (analog). | ||
283 | * PA8 - PIN8 (analog). | ||
284 | * PA9 - PIN9 (analog). | ||
285 | * PA10 - PIN10 (analog). | ||
286 | * PA11 - PIN11 (analog). | ||
287 | * PA12 - PIN12 (analog). | ||
288 | * PA13 - SWDIO (alternate 0). | ||
289 | * PA14 - SWCLK (alternate 0). | ||
290 | * PA15 - PIN15 (analog). | ||
291 | */ | ||
292 | #define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_PIN0) | \ | ||
293 | PIN_MODE_ANALOG(GPIOA_PIN1) | \ | ||
294 | PIN_MODE_ANALOG(GPIOA_PIN2) | \ | ||
295 | PIN_MODE_ANALOG(GPIOA_PIN3) | \ | ||
296 | PIN_MODE_ANALOG(GPIOA_PIN4) | \ | ||
297 | PIN_MODE_ANALOG(GPIOA_PIN5) | \ | ||
298 | PIN_MODE_ANALOG(GPIOA_PIN6) | \ | ||
299 | PIN_MODE_ANALOG(GPIOA_PIN7) | \ | ||
300 | PIN_MODE_ANALOG(GPIOA_PIN8) | \ | ||
301 | PIN_MODE_ANALOG(GPIOA_PIN9) | \ | ||
302 | PIN_MODE_ANALOG(GPIOA_PIN10) | \ | ||
303 | PIN_MODE_ANALOG(GPIOA_PIN11) | \ | ||
304 | PIN_MODE_ANALOG(GPIOA_PIN12) | \ | ||
305 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
306 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
307 | PIN_MODE_ANALOG(GPIOA_PIN15)) | ||
308 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ | ||
309 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
310 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
311 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
312 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
313 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
314 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
315 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
316 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
317 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
318 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
319 | PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ | ||
320 | PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ | ||
321 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
322 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
323 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
324 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ | ||
325 | PIN_OSPEED_HIGH(GPIOA_PIN1) | \ | ||
326 | PIN_OSPEED_HIGH(GPIOA_PIN2) | \ | ||
327 | PIN_OSPEED_HIGH(GPIOA_PIN3) | \ | ||
328 | PIN_OSPEED_HIGH(GPIOA_PIN4) | \ | ||
329 | PIN_OSPEED_HIGH(GPIOA_PIN5) | \ | ||
330 | PIN_OSPEED_HIGH(GPIOA_PIN6) | \ | ||
331 | PIN_OSPEED_HIGH(GPIOA_PIN7) | \ | ||
332 | PIN_OSPEED_HIGH(GPIOA_PIN8) | \ | ||
333 | PIN_OSPEED_HIGH(GPIOA_PIN9) | \ | ||
334 | PIN_OSPEED_HIGH(GPIOA_PIN10) | \ | ||
335 | PIN_OSPEED_HIGH(GPIOA_PIN11) | \ | ||
336 | PIN_OSPEED_HIGH(GPIOA_PIN12) | \ | ||
337 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
338 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
339 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
340 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ | ||
341 | PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ | ||
342 | PIN_PUPDR_FLOATING(GPIOA_PIN2) | \ | ||
343 | PIN_PUPDR_FLOATING(GPIOA_PIN3) | \ | ||
344 | PIN_PUPDR_FLOATING(GPIOA_PIN4) | \ | ||
345 | PIN_PUPDR_FLOATING(GPIOA_PIN5) | \ | ||
346 | PIN_PUPDR_FLOATING(GPIOA_PIN6) | \ | ||
347 | PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ | ||
348 | PIN_PUPDR_FLOATING(GPIOA_PIN8) | \ | ||
349 | PIN_PUPDR_FLOATING(GPIOA_PIN9) | \ | ||
350 | PIN_PUPDR_FLOATING(GPIOA_PIN10) | \ | ||
351 | PIN_PUPDR_FLOATING(GPIOA_PIN11) | \ | ||
352 | PIN_PUPDR_FLOATING(GPIOA_PIN12) | \ | ||
353 | PIN_PUPDR_FLOATING(GPIOA_SWDIO) | \ | ||
354 | PIN_PUPDR_FLOATING(GPIOA_SWCLK) | \ | ||
355 | PIN_PUPDR_FLOATING(GPIOA_PIN15)) | ||
356 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ | ||
357 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
358 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
359 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
360 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
361 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
362 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
363 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
364 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
365 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
366 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
367 | PIN_ODR_HIGH(GPIOA_PIN11) | \ | ||
368 | PIN_ODR_HIGH(GPIOA_PIN12) | \ | ||
369 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
370 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
371 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
372 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \ | ||
373 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
374 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
375 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
376 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
377 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
378 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
379 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
380 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
381 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
382 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
383 | PIN_AFIO_AF(GPIOA_PIN11, 0U) | \ | ||
384 | PIN_AFIO_AF(GPIOA_PIN12, 0U) | \ | ||
385 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
386 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
387 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
388 | |||
389 | /* | ||
390 | * GPIOB setup: | ||
391 | * | ||
392 | * PB0 - PIN0 (analog). | ||
393 | * PB1 - PIN1 (analog). | ||
394 | * PB2 - PIN2 (analog). | ||
395 | * PB3 - PIN3 (analog). | ||
396 | * PB4 - PIN4 (analog). | ||
397 | * PB5 - PIN5 (analog). | ||
398 | * PB6 - PIN6 (analog). | ||
399 | * PB7 - PIN7 (analog). | ||
400 | * PB8 - PIN8 (analog). | ||
401 | * PB9 - PIN9 (analog). | ||
402 | * PB10 - PIN10 (analog). | ||
403 | * PB11 - PIN11 (analog). | ||
404 | * PB12 - PIN12 (analog). | ||
405 | * PB13 - PIN13 (analog). | ||
406 | * PB14 - PIN14 (analog). | ||
407 | * PB15 - PIN15 (analog). | ||
408 | */ | ||
409 | #define VAL_GPIOB_MODER (PIN_MODE_ANALOG(GPIOB_PIN0) | \ | ||
410 | PIN_MODE_ANALOG(GPIOB_PIN1) | \ | ||
411 | PIN_MODE_ANALOG(GPIOB_PIN2) | \ | ||
412 | PIN_MODE_ANALOG(GPIOB_PIN3) | \ | ||
413 | PIN_MODE_ANALOG(GPIOB_PIN4) | \ | ||
414 | PIN_MODE_ANALOG(GPIOB_PIN5) | \ | ||
415 | PIN_MODE_ANALOG(GPIOB_PIN6) | \ | ||
416 | PIN_MODE_ANALOG(GPIOB_PIN7) | \ | ||
417 | PIN_MODE_ANALOG(GPIOB_PIN8) | \ | ||
418 | PIN_MODE_ANALOG(GPIOB_PIN9) | \ | ||
419 | PIN_MODE_ANALOG(GPIOB_PIN10) | \ | ||
420 | PIN_MODE_ANALOG(GPIOB_PIN11) | \ | ||
421 | PIN_MODE_ANALOG(GPIOB_PIN12) | \ | ||
422 | PIN_MODE_ALTERNATE(GPIOB_PIN13) | \ | ||
423 | PIN_MODE_ALTERNATE(GPIOB_PIN14) | \ | ||
424 | PIN_MODE_ANALOG(GPIOB_PIN15)) | ||
425 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
426 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
427 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
428 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
429 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
430 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
431 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
432 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
433 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
434 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
435 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
436 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
437 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
438 | PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ | ||
439 | PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ | ||
440 | PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) | ||
441 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ | ||
442 | PIN_OSPEED_HIGH(GPIOB_PIN1) | \ | ||
443 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
444 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
445 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
446 | PIN_OSPEED_HIGH(GPIOB_PIN5) | \ | ||
447 | PIN_OSPEED_HIGH(GPIOB_PIN6) | \ | ||
448 | PIN_OSPEED_HIGH(GPIOB_PIN7) | \ | ||
449 | PIN_OSPEED_HIGH(GPIOB_PIN8) | \ | ||
450 | PIN_OSPEED_HIGH(GPIOB_PIN9) | \ | ||
451 | PIN_OSPEED_HIGH(GPIOB_PIN10) | \ | ||
452 | PIN_OSPEED_HIGH(GPIOB_PIN11) | \ | ||
453 | PIN_OSPEED_HIGH(GPIOB_PIN12) | \ | ||
454 | PIN_OSPEED_HIGH(GPIOB_PIN13) | \ | ||
455 | PIN_OSPEED_HIGH(GPIOB_PIN14) | \ | ||
456 | PIN_OSPEED_HIGH(GPIOB_PIN15)) | ||
457 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0) | \ | ||
458 | PIN_PUPDR_FLOATING(GPIOB_PIN1) | \ | ||
459 | PIN_PUPDR_FLOATING(GPIOB_PIN2) | \ | ||
460 | PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ | ||
461 | PIN_PUPDR_FLOATING(GPIOB_PIN4) | \ | ||
462 | PIN_PUPDR_FLOATING(GPIOB_PIN5) | \ | ||
463 | PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ | ||
464 | PIN_PUPDR_FLOATING(GPIOB_PIN7) | \ | ||
465 | PIN_PUPDR_FLOATING(GPIOB_PIN8) | \ | ||
466 | PIN_PUPDR_FLOATING(GPIOB_PIN9) | \ | ||
467 | PIN_PUPDR_FLOATING(GPIOB_PIN10) | \ | ||
468 | PIN_PUPDR_FLOATING(GPIOB_PIN11) | \ | ||
469 | PIN_PUPDR_FLOATING(GPIOB_PIN12) | \ | ||
470 | PIN_PUPDR_FLOATING(GPIOB_PIN13) | \ | ||
471 | PIN_PUPDR_FLOATING(GPIOB_PIN14) | \ | ||
472 | PIN_PUPDR_FLOATING(GPIOB_PIN15)) | ||
473 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
474 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
475 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
476 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
477 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
478 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
479 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
480 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
481 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
482 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
483 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
484 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
485 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
486 | PIN_ODR_HIGH(GPIOB_PIN13) | \ | ||
487 | PIN_ODR_HIGH(GPIOB_PIN14) | \ | ||
488 | PIN_ODR_HIGH(GPIOB_PIN15)) | ||
489 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
490 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
491 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
492 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
493 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
494 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
495 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
496 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
497 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
498 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
499 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
500 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
501 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
502 | PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ | ||
503 | PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ | ||
504 | PIN_AFIO_AF(GPIOB_PIN15, 0U)) | ||
505 | |||
506 | /* | ||
507 | * GPIOC setup: | ||
508 | * | ||
509 | * PC0 - PIN0 (analog). | ||
510 | * PC1 - PIN1 (analog). | ||
511 | * PC2 - PIN2 (analog). | ||
512 | * PC3 - PIN3 (analog). | ||
513 | * PC4 - PIN4 (analog). | ||
514 | * PC5 - PIN5 (analog). | ||
515 | * PC6 - PIN6 (analog). | ||
516 | * PC7 - PIN7 (analog). | ||
517 | * PC8 - PIN8 (analog). | ||
518 | * PC9 - PIN9 (analog). | ||
519 | * PC10 - PIN10 (analog). | ||
520 | * PC11 - PIN11 (analog). | ||
521 | * PC12 - PIN12 (analog). | ||
522 | * PC13 - PIN13 (analog). | ||
523 | * PC14 - PIN14 (analog). | ||
524 | * PC15 - PIN15 (analog). | ||
525 | */ | ||
526 | #define VAL_GPIOC_MODER (PIN_MODE_ANALOG(GPIOC_PIN0) | \ | ||
527 | PIN_MODE_ANALOG(GPIOC_PIN1) | \ | ||
528 | PIN_MODE_ANALOG(GPIOC_PIN2) | \ | ||
529 | PIN_MODE_ANALOG(GPIOC_PIN3) | \ | ||
530 | PIN_MODE_ANALOG(GPIOC_PIN4) | \ | ||
531 | PIN_MODE_ANALOG(GPIOC_PIN5) | \ | ||
532 | PIN_MODE_ANALOG(GPIOC_PIN6) | \ | ||
533 | PIN_MODE_ANALOG(GPIOC_PIN7) | \ | ||
534 | PIN_MODE_ANALOG(GPIOC_PIN8) | \ | ||
535 | PIN_MODE_ANALOG(GPIOC_PIN9) | \ | ||
536 | PIN_MODE_ANALOG(GPIOC_PIN10) | \ | ||
537 | PIN_MODE_ANALOG(GPIOC_PIN11) | \ | ||
538 | PIN_MODE_ANALOG(GPIOC_PIN12) | \ | ||
539 | PIN_MODE_ALTERNATE(GPIOC_PIN13) | \ | ||
540 | PIN_MODE_ALTERNATE(GPIOC_PIN14) | \ | ||
541 | PIN_MODE_ANALOG(GPIOC_PIN15)) | ||
542 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ | ||
543 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
544 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
545 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
546 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
547 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
548 | PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ | ||
549 | PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ | ||
550 | PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ | ||
551 | PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ | ||
552 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
553 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
554 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
555 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
556 | PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ | ||
557 | PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) | ||
558 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ | ||
559 | PIN_OSPEED_HIGH(GPIOC_PIN1) | \ | ||
560 | PIN_OSPEED_HIGH(GPIOC_PIN2) | \ | ||
561 | PIN_OSPEED_HIGH(GPIOC_PIN3) | \ | ||
562 | PIN_OSPEED_HIGH(GPIOC_PIN4) | \ | ||
563 | PIN_OSPEED_HIGH(GPIOC_PIN5) | \ | ||
564 | PIN_OSPEED_HIGH(GPIOC_PIN6) | \ | ||
565 | PIN_OSPEED_HIGH(GPIOC_PIN7) | \ | ||
566 | PIN_OSPEED_HIGH(GPIOC_PIN8) | \ | ||
567 | PIN_OSPEED_HIGH(GPIOC_PIN9) | \ | ||
568 | PIN_OSPEED_HIGH(GPIOC_PIN10) | \ | ||
569 | PIN_OSPEED_HIGH(GPIOC_PIN11) | \ | ||
570 | PIN_OSPEED_HIGH(GPIOC_PIN12) | \ | ||
571 | PIN_OSPEED_HIGH(GPIOC_PIN13) | \ | ||
572 | PIN_OSPEED_HIGH(GPIOC_PIN14) | \ | ||
573 | PIN_OSPEED_HIGH(GPIOC_PIN15)) | ||
574 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \ | ||
575 | PIN_PUPDR_FLOATING(GPIOC_PIN1) | \ | ||
576 | PIN_PUPDR_FLOATING(GPIOC_PIN2) | \ | ||
577 | PIN_PUPDR_FLOATING(GPIOC_PIN3) | \ | ||
578 | PIN_PUPDR_FLOATING(GPIOC_PIN4) | \ | ||
579 | PIN_PUPDR_FLOATING(GPIOC_PIN5) | \ | ||
580 | PIN_PUPDR_FLOATING(GPIOC_PIN6) | \ | ||
581 | PIN_PUPDR_FLOATING(GPIOC_PIN7) | \ | ||
582 | PIN_PUPDR_FLOATING(GPIOC_PIN8) | \ | ||
583 | PIN_PUPDR_FLOATING(GPIOC_PIN9) | \ | ||
584 | PIN_PUPDR_FLOATING(GPIOC_PIN10) | \ | ||
585 | PIN_PUPDR_FLOATING(GPIOC_PIN11) | \ | ||
586 | PIN_PUPDR_FLOATING(GPIOC_PIN12) | \ | ||
587 | PIN_PUPDR_FLOATING(GPIOC_PIN13) | \ | ||
588 | PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ | ||
589 | PIN_PUPDR_FLOATING(GPIOC_PIN15)) | ||
590 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ | ||
591 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
592 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
593 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
594 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
595 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
596 | PIN_ODR_HIGH(GPIOC_PIN6) | \ | ||
597 | PIN_ODR_HIGH(GPIOC_PIN7) | \ | ||
598 | PIN_ODR_HIGH(GPIOC_PIN8) | \ | ||
599 | PIN_ODR_HIGH(GPIOC_PIN9) | \ | ||
600 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
601 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
602 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
603 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
604 | PIN_ODR_HIGH(GPIOC_PIN14) | \ | ||
605 | PIN_ODR_HIGH(GPIOC_PIN15)) | ||
606 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \ | ||
607 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
608 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
609 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
610 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
611 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
612 | PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ | ||
613 | PIN_AFIO_AF(GPIOC_PIN7, 0U)) | ||
614 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \ | ||
615 | PIN_AFIO_AF(GPIOC_PIN9, 0U) | \ | ||
616 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
617 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
618 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
619 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
620 | PIN_AFIO_AF(GPIOC_PIN14, 0U) | \ | ||
621 | PIN_AFIO_AF(GPIOC_PIN15, 0U)) | ||
622 | |||
623 | /* | ||
624 | * GPIOD setup: | ||
625 | * | ||
626 | * PD0 - PIN0 (analog). | ||
627 | * PD1 - PIN1 (analog). | ||
628 | * PD2 - PIN2 (analog). | ||
629 | * PD3 - PIN3 (analog). | ||
630 | * PD4 - PIN4 (analog). | ||
631 | * PD5 - PIN5 (analog). | ||
632 | * PD6 - PIN6 (analog). | ||
633 | * PD7 - PIN7 (analog). | ||
634 | * PD8 - PIN8 (analog). | ||
635 | * PD9 - PIN9 (analog). | ||
636 | * PD10 - PIN10 (analog). | ||
637 | * PD11 - PIN11 (analog). | ||
638 | * PD12 - PIN12 (analog). | ||
639 | * PD13 - PIN13 (analog). | ||
640 | * PD14 - PIN14 (analog). | ||
641 | * PD15 - PIN15 (analog). | ||
642 | */ | ||
643 | #define VAL_GPIOD_MODER (PIN_MODE_ANALOG(GPIOD_PIN0) | \ | ||
644 | PIN_MODE_ANALOG(GPIOD_PIN1) | \ | ||
645 | PIN_MODE_ANALOG(GPIOD_PIN2) | \ | ||
646 | PIN_MODE_ANALOG(GPIOD_PIN3) | \ | ||
647 | PIN_MODE_ANALOG(GPIOD_PIN4) | \ | ||
648 | PIN_MODE_ANALOG(GPIOD_PIN5) | \ | ||
649 | PIN_MODE_ANALOG(GPIOD_PIN6) | \ | ||
650 | PIN_MODE_ANALOG(GPIOD_PIN7) | \ | ||
651 | PIN_MODE_ANALOG(GPIOD_PIN8) | \ | ||
652 | PIN_MODE_ANALOG(GPIOD_PIN9) | \ | ||
653 | PIN_MODE_ANALOG(GPIOD_PIN10) | \ | ||
654 | PIN_MODE_ANALOG(GPIOD_PIN11) | \ | ||
655 | PIN_MODE_ANALOG(GPIOD_PIN12) | \ | ||
656 | PIN_MODE_ALTERNATE(GPIOD_PIN13) | \ | ||
657 | PIN_MODE_ALTERNATE(GPIOD_PIN14) | \ | ||
658 | PIN_MODE_ANALOG(GPIOD_PIN15)) | ||
659 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
660 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
661 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
662 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
663 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
664 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
665 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
666 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
667 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
668 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
669 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
670 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
671 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
672 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
673 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
674 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
675 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ | ||
676 | PIN_OSPEED_HIGH(GPIOD_PIN1) | \ | ||
677 | PIN_OSPEED_HIGH(GPIOD_PIN2) | \ | ||
678 | PIN_OSPEED_HIGH(GPIOD_PIN3) | \ | ||
679 | PIN_OSPEED_HIGH(GPIOD_PIN4) | \ | ||
680 | PIN_OSPEED_HIGH(GPIOD_PIN5) | \ | ||
681 | PIN_OSPEED_HIGH(GPIOD_PIN6) | \ | ||
682 | PIN_OSPEED_HIGH(GPIOD_PIN7) | \ | ||
683 | PIN_OSPEED_HIGH(GPIOD_PIN8) | \ | ||
684 | PIN_OSPEED_HIGH(GPIOD_PIN9) | \ | ||
685 | PIN_OSPEED_HIGH(GPIOD_PIN10) | \ | ||
686 | PIN_OSPEED_HIGH(GPIOD_PIN11) | \ | ||
687 | PIN_OSPEED_HIGH(GPIOD_PIN12) | \ | ||
688 | PIN_OSPEED_HIGH(GPIOD_PIN13) | \ | ||
689 | PIN_OSPEED_HIGH(GPIOD_PIN14) | \ | ||
690 | PIN_OSPEED_HIGH(GPIOD_PIN15)) | ||
691 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \ | ||
692 | PIN_PUPDR_FLOATING(GPIOD_PIN1) | \ | ||
693 | PIN_PUPDR_FLOATING(GPIOD_PIN2) | \ | ||
694 | PIN_PUPDR_FLOATING(GPIOD_PIN3) | \ | ||
695 | PIN_PUPDR_FLOATING(GPIOD_PIN4) | \ | ||
696 | PIN_PUPDR_FLOATING(GPIOD_PIN5) | \ | ||
697 | PIN_PUPDR_FLOATING(GPIOD_PIN6) | \ | ||
698 | PIN_PUPDR_FLOATING(GPIOD_PIN7) | \ | ||
699 | PIN_PUPDR_FLOATING(GPIOD_PIN8) | \ | ||
700 | PIN_PUPDR_FLOATING(GPIOD_PIN9) | \ | ||
701 | PIN_PUPDR_FLOATING(GPIOD_PIN10) | \ | ||
702 | PIN_PUPDR_FLOATING(GPIOD_PIN11) | \ | ||
703 | PIN_PUPDR_FLOATING(GPIOD_PIN12) | \ | ||
704 | PIN_PUPDR_FLOATING(GPIOD_PIN13) | \ | ||
705 | PIN_PUPDR_FLOATING(GPIOD_PIN14) | \ | ||
706 | PIN_PUPDR_FLOATING(GPIOD_PIN15)) | ||
707 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
708 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
709 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
710 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
711 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
712 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
713 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
714 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
715 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
716 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
717 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
718 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
719 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
720 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
721 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
722 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
723 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
724 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
725 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
726 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
727 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
728 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
729 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
730 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
731 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
732 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
733 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
734 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
735 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
736 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
737 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
738 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
739 | |||
740 | /* | ||
741 | * GPIOE setup: | ||
742 | * | ||
743 | * PE0 - PIN0 (analog). | ||
744 | * PE1 - PIN1 (analog). | ||
745 | * PE2 - PIN2 (analog). | ||
746 | * PE3 - PIN3 (analog). | ||
747 | * PE4 - PIN4 (analog). | ||
748 | * PE5 - PIN5 (analog). | ||
749 | * PE6 - PIN6 (analog). | ||
750 | * PE7 - PIN7 (analog). | ||
751 | * PE8 - PIN8 (analog). | ||
752 | * PE9 - PIN9 (analog). | ||
753 | * PE10 - PIN10 (analog). | ||
754 | * PE11 - PIN11 (analog). | ||
755 | * PE12 - PIN12 (analog). | ||
756 | * PE13 - PIN13 (analog). | ||
757 | * PE14 - PIN14 (analog). | ||
758 | * PE15 - PIN15 (analog). | ||
759 | */ | ||
760 | #define VAL_GPIOE_MODER (PIN_MODE_ANALOG(GPIOE_PIN0) | \ | ||
761 | PIN_MODE_ANALOG(GPIOE_PIN1) | \ | ||
762 | PIN_MODE_ANALOG(GPIOE_PIN2) | \ | ||
763 | PIN_MODE_ANALOG(GPIOE_PIN3) | \ | ||
764 | PIN_MODE_ANALOG(GPIOE_PIN4) | \ | ||
765 | PIN_MODE_ANALOG(GPIOE_PIN5) | \ | ||
766 | PIN_MODE_ANALOG(GPIOE_PIN6) | \ | ||
767 | PIN_MODE_ANALOG(GPIOE_PIN7) | \ | ||
768 | PIN_MODE_ANALOG(GPIOE_PIN8) | \ | ||
769 | PIN_MODE_ANALOG(GPIOE_PIN9) | \ | ||
770 | PIN_MODE_ANALOG(GPIOE_PIN10) | \ | ||
771 | PIN_MODE_ANALOG(GPIOE_PIN11) | \ | ||
772 | PIN_MODE_ANALOG(GPIOE_PIN12) | \ | ||
773 | PIN_MODE_ALTERNATE(GPIOE_PIN13) | \ | ||
774 | PIN_MODE_ALTERNATE(GPIOE_PIN14) | \ | ||
775 | PIN_MODE_ANALOG(GPIOE_PIN15)) | ||
776 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
777 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
778 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
779 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
780 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
781 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
782 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
783 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
784 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
785 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
786 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
787 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
788 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
789 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
790 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
791 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
792 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ | ||
793 | PIN_OSPEED_HIGH(GPIOE_PIN1) | \ | ||
794 | PIN_OSPEED_HIGH(GPIOE_PIN2) | \ | ||
795 | PIN_OSPEED_HIGH(GPIOE_PIN3) | \ | ||
796 | PIN_OSPEED_HIGH(GPIOE_PIN4) | \ | ||
797 | PIN_OSPEED_HIGH(GPIOE_PIN5) | \ | ||
798 | PIN_OSPEED_HIGH(GPIOE_PIN6) | \ | ||
799 | PIN_OSPEED_HIGH(GPIOE_PIN7) | \ | ||
800 | PIN_OSPEED_HIGH(GPIOE_PIN8) | \ | ||
801 | PIN_OSPEED_HIGH(GPIOE_PIN9) | \ | ||
802 | PIN_OSPEED_HIGH(GPIOE_PIN10) | \ | ||
803 | PIN_OSPEED_HIGH(GPIOE_PIN11) | \ | ||
804 | PIN_OSPEED_HIGH(GPIOE_PIN12) | \ | ||
805 | PIN_OSPEED_HIGH(GPIOE_PIN13) | \ | ||
806 | PIN_OSPEED_HIGH(GPIOE_PIN14) | \ | ||
807 | PIN_OSPEED_HIGH(GPIOE_PIN15)) | ||
808 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \ | ||
809 | PIN_PUPDR_FLOATING(GPIOE_PIN1) | \ | ||
810 | PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ | ||
811 | PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ | ||
812 | PIN_PUPDR_FLOATING(GPIOE_PIN4) | \ | ||
813 | PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ | ||
814 | PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ | ||
815 | PIN_PUPDR_FLOATING(GPIOE_PIN7) | \ | ||
816 | PIN_PUPDR_FLOATING(GPIOE_PIN8) | \ | ||
817 | PIN_PUPDR_FLOATING(GPIOE_PIN9) | \ | ||
818 | PIN_PUPDR_FLOATING(GPIOE_PIN10) | \ | ||
819 | PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ | ||
820 | PIN_PUPDR_FLOATING(GPIOE_PIN12) | \ | ||
821 | PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ | ||
822 | PIN_PUPDR_FLOATING(GPIOE_PIN14) | \ | ||
823 | PIN_PUPDR_FLOATING(GPIOE_PIN15)) | ||
824 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
825 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
826 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
827 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
828 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
829 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
830 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
831 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
832 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
833 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
834 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
835 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
836 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
837 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
838 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
839 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
840 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
841 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
842 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
843 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
844 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
845 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
846 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
847 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
848 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
849 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
850 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
851 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
852 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
853 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
854 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
855 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
856 | |||
857 | /* | ||
858 | * GPIOF setup: | ||
859 | * | ||
860 | ! * PF0 - PIN0 (analog). | ||
861 | * PF1 - PIN1 (analog). | ||
862 | * PF2 - PIN2 (analog). | ||
863 | * PF3 - PIN3 (analog). | ||
864 | * PF4 - PIN4 (analog). | ||
865 | * PF5 - PIN5 (analog). | ||
866 | * PF6 - PIN6 (analog). | ||
867 | * PF7 - PIN7 (analog). | ||
868 | * PF8 - PIN8 (analog). | ||
869 | * PF9 - PIN9 (analog). | ||
870 | * PF10 - PIN10 (analog). | ||
871 | * PF11 - PIN11 (analog). | ||
872 | * PF12 - PIN12 (analog). | ||
873 | * PF13 - PIN13 (analog). | ||
874 | * PF14 - PIN14 (analog). | ||
875 | * PF15 - PIN15 (analog). | ||
876 | */ | ||
877 | #define VAL_GPIOF_MODER (PIN_MODE_ANALOG(GPIOF_PIN0) | \ | ||
878 | PIN_MODE_ANALOG(GPIOF_PIN1) | \ | ||
879 | PIN_MODE_ANALOG(GPIOF_PIN2) | \ | ||
880 | PIN_MODE_ANALOG(GPIOF_PIN3) | \ | ||
881 | PIN_MODE_ANALOG(GPIOF_PIN4) | \ | ||
882 | PIN_MODE_ANALOG(GPIOF_PIN5) | \ | ||
883 | PIN_MODE_ANALOG(GPIOF_PIN6) | \ | ||
884 | PIN_MODE_ANALOG(GPIOF_PIN7) | \ | ||
885 | PIN_MODE_ANALOG(GPIOF_PIN8) | \ | ||
886 | PIN_MODE_ANALOG(GPIOF_PIN9) | \ | ||
887 | PIN_MODE_ANALOG(GPIOF_PIN10) | \ | ||
888 | PIN_MODE_ANALOG(GPIOF_PIN11) | \ | ||
889 | PIN_MODE_ANALOG(GPIOF_PIN12) | \ | ||
890 | PIN_MODE_ALTERNATE(GPIOF_PIN13) | \ | ||
891 | PIN_MODE_ALTERNATE(GPIOF_PIN14) | \ | ||
892 | PIN_MODE_ANALOG(GPIOF_PIN15)) | ||
893 | #define VAL_GPIOF_OTYPFR (PIN_OTYPF_PUSHPULL(GPIOF_PIN0) | \ | ||
894 | PIN_OTYPF_PUSHPULL(GPIOF_PIN1) | \ | ||
895 | PIN_OTYPF_PUSHPULL(GPIOF_PIN2) | \ | ||
896 | PIN_OTYPF_PUSHPULL(GPIOF_PIN3) | \ | ||
897 | PIN_OTYPF_PUSHPULL(GPIOF_PIN4) | \ | ||
898 | PIN_OTYPF_PUSHPULL(GPIOF_PIN5) | \ | ||
899 | PIN_OTYPF_PUSHPULL(GPIOF_PIN6) | \ | ||
900 | PIN_OTYPF_PUSHPULL(GPIOF_PIN7) | \ | ||
901 | PIN_OTYPF_PUSHPULL(GPIOF_PIN8) | \ | ||
902 | PIN_OTYPF_PUSHPULL(GPIOF_PIN9) | \ | ||
903 | PIN_OTYPF_PUSHPULL(GPIOF_PIN10) | \ | ||
904 | PIN_OTYPF_PUSHPULL(GPIOF_PIN11) | \ | ||
905 | PIN_OTYPF_PUSHPULL(GPIOF_PIN12) | \ | ||
906 | PIN_OTYPF_PUSHPULL(GPIOF_PIN13) | \ | ||
907 | PIN_OTYPF_PUSHPULL(GPIOF_PIN14) | \ | ||
908 | PIN_OTYPF_PUSHPULL(GPIOF_PIN15)) | ||
909 | #define VAL_GPIOF_OSPFEDR (PIN_OSPFED_HIGH(GPIOF_PIN0) | \ | ||
910 | PIN_OSPFED_HIGH(GPIOF_PIN1) | \ | ||
911 | PIN_OSPFED_HIGH(GPIOF_PIN2) | \ | ||
912 | PIN_OSPFED_HIGH(GPIOF_PIN3) | \ | ||
913 | PIN_OSPFED_HIGH(GPIOF_PIN4) | \ | ||
914 | PIN_OSPFED_HIGH(GPIOF_PIN5) | \ | ||
915 | PIN_OSPFED_HIGH(GPIOF_PIN6) | \ | ||
916 | PIN_OSPFED_HIGH(GPIOF_PIN7) | \ | ||
917 | PIN_OSPFED_HIGH(GPIOF_PIN8) | \ | ||
918 | PIN_OSPFED_HIGH(GPIOF_PIN9) | \ | ||
919 | PIN_OSPFED_HIGH(GPIOF_PIN10) | \ | ||
920 | PIN_OSPFED_HIGH(GPIOF_PIN11) | \ | ||
921 | PIN_OSPFED_HIGH(GPIOF_PIN12) | \ | ||
922 | PIN_OSPFED_HIGH(GPIOF_PIN13) | \ | ||
923 | PIN_OSPFED_HIGH(GPIOF_PIN14) | \ | ||
924 | PIN_OSPFED_HIGH(GPIOF_PIN15)) | ||
925 | #define VAL_GPIOF_PUPFR (PIN_PUPFR_FLOATING(GPIOF_PIN0) | \ | ||
926 | PIN_PUPFR_FLOATING(GPIOF_PIN1) | \ | ||
927 | PIN_PUPFR_FLOATING(GPIOF_PIN2) | \ | ||
928 | PIN_PUPFR_FLOATING(GPIOF_PIN3) | \ | ||
929 | PIN_PUPFR_FLOATING(GPIOF_PIN4) | \ | ||
930 | PIN_PUPFR_FLOATING(GPIOF_PIN5) | \ | ||
931 | PIN_PUPFR_FLOATING(GPIOF_PIN6) | \ | ||
932 | PIN_PUPFR_FLOATING(GPIOF_PIN7) | \ | ||
933 | PIN_PUPFR_FLOATING(GPIOF_PIN8) | \ | ||
934 | PIN_PUPFR_FLOATING(GPIOF_PIN9) | \ | ||
935 | PIN_PUPFR_FLOATING(GPIOF_PIN10) | \ | ||
936 | PIN_PUPFR_FLOATING(GPIOF_PIN11) | \ | ||
937 | PIN_PUPFR_FLOATING(GPIOF_PIN12) | \ | ||
938 | PIN_PUPFR_FLOATING(GPIOF_PIN13) | \ | ||
939 | PIN_PUPFR_FLOATING(GPIOF_PIN14) | \ | ||
940 | PIN_PUPFR_FLOATING(GPIOF_PIN15)) | ||
941 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ | ||
942 | PIN_ODR_HIGH(GPIOF_PIN1) | \ | ||
943 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
944 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
945 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
946 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
947 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
948 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
949 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
950 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
951 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
952 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
953 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
954 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
955 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
956 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
957 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \ | ||
958 | PIN_AFIO_AF(GPIOF_PIN1, 0U) | \ | ||
959 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
960 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
961 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
962 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
963 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
964 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
965 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
966 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
967 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
968 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
969 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
970 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
971 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
972 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
973 | |||
974 | /* | ||
975 | * GPIOG setup: | ||
976 | * | ||
977 | * PH0 - PIN0 (analog). | ||
978 | * PH1 - PIN1 (analog). | ||
979 | * PH2 - PIN2 (analog). | ||
980 | * PH3 - PIN3 (analog). | ||
981 | * PH4 - PIN4 (analog). | ||
982 | * PH5 - PIN5 (analog). | ||
983 | * PH6 - PIN6 (analog). | ||
984 | * PH7 - PIN7 (analog). | ||
985 | * PH8 - PIN8 (analog). | ||
986 | * PH9 - PIN9 (analog). | ||
987 | * PH10 - PIN10 (analog). | ||
988 | * PH11 - PIN11 (analog). | ||
989 | * PH12 - PIN12 (analog). | ||
990 | * PH13 - PIN13 (analog). | ||
991 | * PH14 - PIN14 (analog). | ||
992 | * PH15 - PIN15 (analog). | ||
993 | */ | ||
994 | #define VAL_GPIOG_MODER (PIN_MODE_ANALOG(GPIOG_PIN0) | \ | ||
995 | PIN_MODE_ANALOG(GPIOG_PIN1) | \ | ||
996 | PIN_MODE_ANALOG(GPIOG_PIN2) | \ | ||
997 | PIN_MODE_ANALOG(GPIOG_PIN3) | \ | ||
998 | PIN_MODE_ANALOG(GPIOG_PIN4) | \ | ||
999 | PIN_MODE_ANALOG(GPIOG_PIN5) | \ | ||
1000 | PIN_MODE_ANALOG(GPIOG_PIN6) | \ | ||
1001 | PIN_MODE_ANALOG(GPIOG_PIN7) | \ | ||
1002 | PIN_MODE_ANALOG(GPIOG_PIN8) | \ | ||
1003 | PIN_MODE_ANALOG(GPIOG_PIN9) | \ | ||
1004 | PIN_MODE_ANALOG(GPIOG_PIN10) | \ | ||
1005 | PIN_MODE_ANALOG(GPIOG_PIN11) | \ | ||
1006 | PIN_MODE_ANALOG(GPIOG_PIN12) | \ | ||
1007 | PIN_MODE_ALTERNATE(GPIOG_PIN13) | \ | ||
1008 | PIN_MODE_ALTERNATE(GPIOG_PIN14) | \ | ||
1009 | PIN_MODE_ANALOG(GPIOG_PIN15)) | ||
1010 | #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ | ||
1011 | PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ | ||
1012 | PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ | ||
1013 | PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ | ||
1014 | PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ | ||
1015 | PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ | ||
1016 | PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ | ||
1017 | PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ | ||
1018 | PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ | ||
1019 | PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ | ||
1020 | PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ | ||
1021 | PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ | ||
1022 | PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ | ||
1023 | PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ | ||
1024 | PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ | ||
1025 | PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) | ||
1026 | #define VAL_GPIOG_OSPHEDR (PIN_OSPHED_HIGH(GPIOG_PIN0) | \ | ||
1027 | PIN_OSPHED_HIGH(GPIOG_PIN1) | \ | ||
1028 | PIN_OSPHED_HIGH(GPIOG_PIN2) | \ | ||
1029 | PIN_OSPHED_HIGH(GPIOG_PIN3) | \ | ||
1030 | PIN_OSPHED_HIGH(GPIOG_PIN4) | \ | ||
1031 | PIN_OSPHED_HIGH(GPIOG_PIN5) | \ | ||
1032 | PIN_OSPHED_HIGH(GPIOG_PIN6) | \ | ||
1033 | PIN_OSPHED_HIGH(GPIOG_PIN7) | \ | ||
1034 | PIN_OSPHED_HIGH(GPIOG_PIN8) | \ | ||
1035 | PIN_OSPHED_HIGH(GPIOG_PIN9) | \ | ||
1036 | PIN_OSPHED_HIGH(GPIOG_PIN10) | \ | ||
1037 | PIN_OSPHED_HIGH(GPIOG_PIN11) | \ | ||
1038 | PIN_OSPHED_HIGH(GPIOG_PIN12) | \ | ||
1039 | PIN_OSPHED_HIGH(GPIOG_PIN13) | \ | ||
1040 | PIN_OSPHED_HIGH(GPIOG_PIN14) | \ | ||
1041 | PIN_OSPHED_HIGH(GPIOG_PIN15)) | ||
1042 | #define VAL_GPIOG_PUPHR (PIN_PUPHR_FLOATING(GPIOG_PIN0) | \ | ||
1043 | PIN_PUPHR_FLOATING(GPIOG_PIN1) | \ | ||
1044 | PIN_PUPHR_FLOATING(GPIOG_PIN2) | \ | ||
1045 | PIN_PUPHR_FLOATING(GPIOG_PIN3) | \ | ||
1046 | PIN_PUPHR_FLOATING(GPIOG_PIN4) | \ | ||
1047 | PIN_PUPHR_FLOATING(GPIOG_PIN5) | \ | ||
1048 | PIN_PUPHR_FLOATING(GPIOG_PIN6) | \ | ||
1049 | PIN_PUPHR_FLOATING(GPIOG_PIN7) | \ | ||
1050 | PIN_PUPHR_FLOATING(GPIOG_PIN8) | \ | ||
1051 | PIN_PUPHR_FLOATING(GPIOG_PIN9) | \ | ||
1052 | PIN_PUPHR_FLOATING(GPIOG_PIN10) | \ | ||
1053 | PIN_PUPHR_FLOATING(GPIOG_PIN11) | \ | ||
1054 | PIN_PUPHR_FLOATING(GPIOG_PIN12) | \ | ||
1055 | PIN_PUPHR_FLOATING(GPIOG_PIN13) | \ | ||
1056 | PIN_PUPHR_FLOATING(GPIOG_PIN14) | \ | ||
1057 | PIN_PUPHR_FLOATING(GPIOG_PIN15)) | ||
1058 | #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ | ||
1059 | PIN_ODR_HIGH(GPIOG_PIN1) | \ | ||
1060 | PIN_ODR_HIGH(GPIOG_PIN2) | \ | ||
1061 | PIN_ODR_HIGH(GPIOG_PIN3) | \ | ||
1062 | PIN_ODR_HIGH(GPIOG_PIN4) | \ | ||
1063 | PIN_ODR_HIGH(GPIOG_PIN5) | \ | ||
1064 | PIN_ODR_HIGH(GPIOG_PIN6) | \ | ||
1065 | PIN_ODR_HIGH(GPIOG_PIN7) | \ | ||
1066 | PIN_ODR_HIGH(GPIOG_PIN8) | \ | ||
1067 | PIN_ODR_HIGH(GPIOG_PIN9) | \ | ||
1068 | PIN_ODR_HIGH(GPIOG_PIN10) | \ | ||
1069 | PIN_ODR_HIGH(GPIOG_PIN11) | \ | ||
1070 | PIN_ODR_HIGH(GPIOG_PIN12) | \ | ||
1071 | PIN_ODR_HIGH(GPIOG_PIN13) | \ | ||
1072 | PIN_ODR_HIGH(GPIOG_PIN14) | \ | ||
1073 | PIN_ODR_HIGH(GPIOG_PIN15)) | ||
1074 | #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \ | ||
1075 | PIN_AFIO_AF(GPIOG_PIN1, 0U) | \ | ||
1076 | PIN_AFIO_AF(GPIOG_PIN2, 0U) | \ | ||
1077 | PIN_AFIO_AF(GPIOG_PIN3, 0U) | \ | ||
1078 | PIN_AFIO_AF(GPIOG_PIN4, 0U) | \ | ||
1079 | PIN_AFIO_AF(GPIOG_PIN5, 0U) | \ | ||
1080 | PIN_AFIO_AF(GPIOG_PIN6, 0U) | \ | ||
1081 | PIN_AFIO_AF(GPIOG_PIN7, 0U)) | ||
1082 | #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \ | ||
1083 | PIN_AFIO_AF(GPIOG_PIN9, 0U) | \ | ||
1084 | PIN_AFIO_AF(GPIOG_PIN10, 0U) | \ | ||
1085 | PIN_AFIO_AF(GPIOG_PIN11, 0U) | \ | ||
1086 | PIN_AFIO_AF(GPIOG_PIN12, 0U) | \ | ||
1087 | PIN_AFIO_AF(GPIOG_PIN13, 0U) | \ | ||
1088 | PIN_AFIO_AF(GPIOG_PIN14, 0U) | \ | ||
1089 | PIN_AFIO_AF(GPIOG_PIN15, 0U)) | ||
1090 | |||
1091 | /* | ||
1092 | * GPIOH setup: | ||
1093 | * | ||
1094 | * PH0 - OSC_IN (input floating). | ||
1095 | * PH1 - OSC_OUT (input floating). | ||
1096 | * PH2 - PIN2 (analog). | ||
1097 | * PH3 - PIN3 (analog). | ||
1098 | * PH4 - PIN4 (analog). | ||
1099 | * PH5 - PIN5 (analog). | ||
1100 | * PH6 - PIN6 (analog). | ||
1101 | * PH7 - PIN7 (analog). | ||
1102 | * PH8 - PIN8 (analog). | ||
1103 | * PH9 - PIN9 (analog). | ||
1104 | * PH10 - PIN10 (analog). | ||
1105 | * PH11 - PIN11 (analog). | ||
1106 | * PH12 - PIN12 (analog). | ||
1107 | * PH13 - PIN13 (analog). | ||
1108 | * PH14 - PIN14 (analog). | ||
1109 | * PH15 - PIN15 (analog). | ||
1110 | */ | ||
1111 | #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \ | ||
1112 | PIN_MODE_INPUT(GPIOH_OSC_OUT) | \ | ||
1113 | PIN_MODE_ANALOG(GPIOH_PIN2) | \ | ||
1114 | PIN_MODE_ANALOG(GPIOH_PIN3) | \ | ||
1115 | PIN_MODE_ANALOG(GPIOH_PIN4) | \ | ||
1116 | PIN_MODE_ANALOG(GPIOH_PIN5) | \ | ||
1117 | PIN_MODE_ANALOG(GPIOH_PIN6) | \ | ||
1118 | PIN_MODE_ANALOG(GPIOH_PIN7) | \ | ||
1119 | PIN_MODE_ANALOG(GPIOH_PIN8) | \ | ||
1120 | PIN_MODE_ANALOG(GPIOH_PIN9) | \ | ||
1121 | PIN_MODE_ANALOG(GPIOH_PIN10) | \ | ||
1122 | PIN_MODE_ANALOG(GPIOH_PIN11) | \ | ||
1123 | PIN_MODE_ANALOG(GPIOH_PIN12) | \ | ||
1124 | PIN_MODE_ALTERNATE(GPIOH_PIN13) | \ | ||
1125 | PIN_MODE_ALTERNATE(GPIOH_PIN14) | \ | ||
1126 | PIN_MODE_ANALOG(GPIOH_PIN15)) | ||
1127 | #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ | ||
1128 | PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ | ||
1129 | PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ | ||
1130 | PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ | ||
1131 | PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ | ||
1132 | PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ | ||
1133 | PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ | ||
1134 | PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ | ||
1135 | PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ | ||
1136 | PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ | ||
1137 | PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ | ||
1138 | PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ | ||
1139 | PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ | ||
1140 | PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ | ||
1141 | PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ | ||
1142 | PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) | ||
1143 | #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ | ||
1144 | PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ | ||
1145 | PIN_OSPEED_HIGH(GPIOH_PIN2) | \ | ||
1146 | PIN_OSPEED_HIGH(GPIOH_PIN3) | \ | ||
1147 | PIN_OSPEED_HIGH(GPIOH_PIN4) | \ | ||
1148 | PIN_OSPEED_HIGH(GPIOH_PIN5) | \ | ||
1149 | PIN_OSPEED_HIGH(GPIOH_PIN6) | \ | ||
1150 | PIN_OSPEED_HIGH(GPIOH_PIN7) | \ | ||
1151 | PIN_OSPEED_HIGH(GPIOH_PIN8) | \ | ||
1152 | PIN_OSPEED_HIGH(GPIOH_PIN9) | \ | ||
1153 | PIN_OSPEED_HIGH(GPIOH_PIN10) | \ | ||
1154 | PIN_OSPEED_HIGH(GPIOH_PIN11) | \ | ||
1155 | PIN_OSPEED_HIGH(GPIOH_PIN12) | \ | ||
1156 | PIN_OSPEED_HIGH(GPIOH_PIN13) | \ | ||
1157 | PIN_OSPEED_HIGH(GPIOH_PIN14) | \ | ||
1158 | PIN_OSPEED_HIGH(GPIOH_PIN15)) | ||
1159 | #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ | ||
1160 | PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ | ||
1161 | PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ | ||
1162 | PIN_PUPDR_FLOATING(GPIOH_PIN3) | \ | ||
1163 | PIN_PUPDR_FLOATING(GPIOH_PIN4) | \ | ||
1164 | PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ | ||
1165 | PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ | ||
1166 | PIN_PUPDR_FLOATING(GPIOH_PIN7) | \ | ||
1167 | PIN_PUPDR_FLOATING(GPIOH_PIN8) | \ | ||
1168 | PIN_PUPDR_FLOATING(GPIOH_PIN9) | \ | ||
1169 | PIN_PUPDR_FLOATING(GPIOH_PIN10) | \ | ||
1170 | PIN_PUPDR_FLOATING(GPIOH_PIN11) | \ | ||
1171 | PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ | ||
1172 | PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ | ||
1173 | PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ | ||
1174 | PIN_PUPDR_FLOATING(GPIOH_PIN15)) | ||
1175 | #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \ | ||
1176 | PIN_ODR_HIGH(GPIOH_OSC_OUT) | \ | ||
1177 | PIN_ODR_HIGH(GPIOH_PIN2) | \ | ||
1178 | PIN_ODR_HIGH(GPIOH_PIN3) | \ | ||
1179 | PIN_ODR_HIGH(GPIOH_PIN4) | \ | ||
1180 | PIN_ODR_HIGH(GPIOH_PIN5) | \ | ||
1181 | PIN_ODR_HIGH(GPIOH_PIN6) | \ | ||
1182 | PIN_ODR_HIGH(GPIOH_PIN7) | \ | ||
1183 | PIN_ODR_HIGH(GPIOH_PIN8) | \ | ||
1184 | PIN_ODR_HIGH(GPIOH_PIN9) | \ | ||
1185 | PIN_ODR_HIGH(GPIOH_PIN10) | \ | ||
1186 | PIN_ODR_HIGH(GPIOH_PIN11) | \ | ||
1187 | PIN_ODR_HIGH(GPIOH_PIN12) | \ | ||
1188 | PIN_ODR_HIGH(GPIOH_PIN13) | \ | ||
1189 | PIN_ODR_HIGH(GPIOH_PIN14) | \ | ||
1190 | PIN_ODR_HIGH(GPIOH_PIN15)) | ||
1191 | #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \ | ||
1192 | PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \ | ||
1193 | PIN_AFIO_AF(GPIOH_PIN2, 0U) | \ | ||
1194 | PIN_AFIO_AF(GPIOH_PIN3, 0U) | \ | ||
1195 | PIN_AFIO_AF(GPIOH_PIN4, 0U) | \ | ||
1196 | PIN_AFIO_AF(GPIOH_PIN5, 0U) | \ | ||
1197 | PIN_AFIO_AF(GPIOH_PIN6, 0U) | \ | ||
1198 | PIN_AFIO_AF(GPIOH_PIN7, 0U)) | ||
1199 | #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \ | ||
1200 | PIN_AFIO_AF(GPIOH_PIN9, 0U) | \ | ||
1201 | PIN_AFIO_AF(GPIOH_PIN10, 0U) | \ | ||
1202 | PIN_AFIO_AF(GPIOH_PIN11, 0U) | \ | ||
1203 | PIN_AFIO_AF(GPIOH_PIN12, 0U) | \ | ||
1204 | PIN_AFIO_AF(GPIOH_PIN13, 0U) | \ | ||
1205 | PIN_AFIO_AF(GPIOH_PIN14, 0U) | \ | ||
1206 | PIN_AFIO_AF(GPIOH_PIN15, 0U)) | ||
1207 | |||
1208 | /* | ||
1209 | * GPIOI setup: | ||
1210 | * | ||
1211 | * PI0 - PIN0 (analog). | ||
1212 | * PI1 - PIN1 (analog). | ||
1213 | * PI2 - PIN2 (analog). | ||
1214 | * PI3 - PIN3 (analog). | ||
1215 | * PI4 - PIN4 (analog). | ||
1216 | * PI5 - PIN5 (analog). | ||
1217 | * PI6 - PIN6 (analog). | ||
1218 | * PI7 - PIN7 (analog). | ||
1219 | * PI8 - PIN8 (analog). | ||
1220 | * PI9 - PIN9 (analog). | ||
1221 | * PI10 - PIN10 (analog). | ||
1222 | * PI11 - PIN11 (analog). | ||
1223 | * PI12 - PIN12 (analog). | ||
1224 | * PI13 - PIN13 (analog). | ||
1225 | * PI14 - PIN14 (analog). | ||
1226 | * PI15 - PIN15 (analog). | ||
1227 | */ | ||
1228 | #define VAL_GPIOI_MODER (PIN_MODE_ANALOG(GPIOI_PIN0) | \ | ||
1229 | PIN_MODE_ANALOG(GPIOI_PIN1) | \ | ||
1230 | PIN_MODE_ANALOG(GPIOI_PIN2) | \ | ||
1231 | PIN_MODE_ANALOG(GPIOI_PIN3) | \ | ||
1232 | PIN_MODE_ANALOG(GPIOI_PIN4) | \ | ||
1233 | PIN_MODE_ANALOG(GPIOI_PIN5) | \ | ||
1234 | PIN_MODE_ANALOG(GPIOI_PIN6) | \ | ||
1235 | PIN_MODE_ANALOG(GPIOI_PIN7) | \ | ||
1236 | PIN_MODE_ANALOG(GPIOI_PIN8) | \ | ||
1237 | PIN_MODE_ANALOG(GPIOI_PIN9) | \ | ||
1238 | PIN_MODE_ANALOG(GPIOI_PIN10) | \ | ||
1239 | PIN_MODE_ANALOG(GPIOI_PIN11) | \ | ||
1240 | PIN_MODE_ANALOG(GPIOI_PIN12) | \ | ||
1241 | PIN_MODE_ALTERNATE(GPIOI_PIN13) | \ | ||
1242 | PIN_MODE_ALTERNATE(GPIOI_PIN14) | \ | ||
1243 | PIN_MODE_ANALOG(GPIOI_PIN15)) | ||
1244 | #define VAL_GPIOI_OTYPIR (PIN_OTYPI_PUSHPULL(GPIOI_PIN0) | \ | ||
1245 | PIN_OTYPI_PUSHPULL(GPIOI_PIN1) | \ | ||
1246 | PIN_OTYPI_PUSHPULL(GPIOI_PIN2) | \ | ||
1247 | PIN_OTYPI_PUSHPULL(GPIOI_PIN3) | \ | ||
1248 | PIN_OTYPI_PUSHPULL(GPIOI_PIN4) | \ | ||
1249 | PIN_OTYPI_PUSHPULL(GPIOI_PIN5) | \ | ||
1250 | PIN_OTYPI_PUSHPULL(GPIOI_PIN6) | \ | ||
1251 | PIN_OTYPI_PUSHPULL(GPIOI_PIN7) | \ | ||
1252 | PIN_OTYPI_PUSHPULL(GPIOI_PIN8) | \ | ||
1253 | PIN_OTYPI_PUSHPULL(GPIOI_PIN9) | \ | ||
1254 | PIN_OTYPI_PUSHPULL(GPIOI_PIN10) | \ | ||
1255 | PIN_OTYPI_PUSHPULL(GPIOI_PIN11) | \ | ||
1256 | PIN_OTYPI_PUSHPULL(GPIOI_PIN12) | \ | ||
1257 | PIN_OTYPI_PUSHPULL(GPIOI_PIN13) | \ | ||
1258 | PIN_OTYPI_PUSHPULL(GPIOI_PIN14) | \ | ||
1259 | PIN_OTYPI_PUSHPULL(GPIOI_PIN15)) | ||
1260 | #define VAL_GPIOI_OSPIEDR (PIN_OSPIED_HIGH(GPIOI_PIN0) | \ | ||
1261 | PIN_OSPIED_HIGH(GPIOI_PIN1) | \ | ||
1262 | PIN_OSPIED_HIGH(GPIOI_PIN2) | \ | ||
1263 | PIN_OSPIED_HIGH(GPIOI_PIN3) | \ | ||
1264 | PIN_OSPIED_HIGH(GPIOI_PIN4) | \ | ||
1265 | PIN_OSPIED_HIGH(GPIOI_PIN5) | \ | ||
1266 | PIN_OSPIED_HIGH(GPIOI_PIN6) | \ | ||
1267 | PIN_OSPIED_HIGH(GPIOI_PIN7) | \ | ||
1268 | PIN_OSPIED_HIGH(GPIOI_PIN8) | \ | ||
1269 | PIN_OSPIED_HIGH(GPIOI_PIN9) | \ | ||
1270 | PIN_OSPIED_HIGH(GPIOI_PIN10) | \ | ||
1271 | PIN_OSPIED_HIGH(GPIOI_PIN11) | \ | ||
1272 | PIN_OSPIED_HIGH(GPIOI_PIN12) | \ | ||
1273 | PIN_OSPIED_HIGH(GPIOI_PIN13) | \ | ||
1274 | PIN_OSPIED_HIGH(GPIOI_PIN14) | \ | ||
1275 | PIN_OSPIED_HIGH(GPIOI_PIN15)) | ||
1276 | #define VAL_GPIOI_PUPIR (PIN_PUPIR_FLOATING(GPIOI_PIN0) | \ | ||
1277 | PIN_PUPIR_FLOATING(GPIOI_PIN1) | \ | ||
1278 | PIN_PUPIR_FLOATING(GPIOI_PIN2) | \ | ||
1279 | PIN_PUPIR_FLOATING(GPIOI_PIN3) | \ | ||
1280 | PIN_PUPIR_FLOATING(GPIOI_PIN4) | \ | ||
1281 | PIN_PUPIR_FLOATING(GPIOI_PIN5) | \ | ||
1282 | PIN_PUPIR_FLOATING(GPIOI_PIN6) | \ | ||
1283 | PIN_PUPIR_FLOATING(GPIOI_PIN7) | \ | ||
1284 | PIN_PUPIR_FLOATING(GPIOI_PIN8) | \ | ||
1285 | PIN_PUPIR_FLOATING(GPIOI_PIN9) | \ | ||
1286 | PIN_PUPIR_FLOATING(GPIOI_PIN10) | \ | ||
1287 | PIN_PUPIR_FLOATING(GPIOI_PIN11) | \ | ||
1288 | PIN_PUPIR_FLOATING(GPIOI_PIN12) | \ | ||
1289 | PIN_PUPIR_FLOATING(GPIOI_PIN13) | \ | ||
1290 | PIN_PUPIR_FLOATING(GPIOI_PIN14) | \ | ||
1291 | PIN_PUPIR_FLOATING(GPIOI_PIN15)) | ||
1292 | #define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_PIN0) | \ | ||
1293 | PIN_ODR_HIGH(GPIOI_PIN1) | \ | ||
1294 | PIN_ODR_HIGH(GPIOI_PIN2) | \ | ||
1295 | PIN_ODR_HIGH(GPIOI_PIN3) | \ | ||
1296 | PIN_ODR_HIGH(GPIOI_PIN4) | \ | ||
1297 | PIN_ODR_HIGH(GPIOI_PIN5) | \ | ||
1298 | PIN_ODR_HIGH(GPIOI_PIN6) | \ | ||
1299 | PIN_ODR_HIGH(GPIOI_PIN7) | \ | ||
1300 | PIN_ODR_HIGH(GPIOI_PIN8) | \ | ||
1301 | PIN_ODR_HIGH(GPIOI_PIN9) | \ | ||
1302 | PIN_ODR_HIGH(GPIOI_PIN10) | \ | ||
1303 | PIN_ODR_HIGH(GPIOI_PIN11) | \ | ||
1304 | PIN_ODR_HIGH(GPIOI_PIN12) | \ | ||
1305 | PIN_ODR_HIGH(GPIOI_PIN13) | \ | ||
1306 | PIN_ODR_HIGH(GPIOI_PIN14) | \ | ||
1307 | PIN_ODR_HIGH(GPIOI_PIN15)) | ||
1308 | #define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0U) | \ | ||
1309 | PIN_AFIO_AF(GPIOI_PIN1, 0U) | \ | ||
1310 | PIN_AFIO_AF(GPIOI_PIN2, 0U) | \ | ||
1311 | PIN_AFIO_AF(GPIOI_PIN3, 0U) | \ | ||
1312 | PIN_AFIO_AF(GPIOI_PIN4, 0U) | \ | ||
1313 | PIN_AFIO_AF(GPIOI_PIN5, 0U) | \ | ||
1314 | PIN_AFIO_AF(GPIOI_PIN6, 0U) | \ | ||
1315 | PIN_AFIO_AF(GPIOI_PIN7, 0U)) | ||
1316 | #define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \ | ||
1317 | PIN_AFIO_AF(GPIOI_PIN9, 0U) | \ | ||
1318 | PIN_AFIO_AF(GPIOI_PIN10, 0U) | \ | ||
1319 | PIN_AFIO_AF(GPIOI_PIN11, 0U) | \ | ||
1320 | PIN_AFIO_AF(GPIOI_PIN12, 0U) | \ | ||
1321 | PIN_AFIO_AF(GPIOI_PIN13, 0U) | \ | ||
1322 | PIN_AFIO_AF(GPIOI_PIN14, 0U) | \ | ||
1323 | PIN_AFIO_AF(GPIOI_PIN15, 0U)) | ||
1324 | |||
1325 | /*===========================================================================*/ | ||
1326 | /* External declarations. */ | ||
1327 | /*===========================================================================*/ | ||
1328 | |||
1329 | #if !defined(_FROM_ASM_) | ||
1330 | #ifdef __cplusplus | ||
1331 | extern "C" { | ||
1332 | #endif | ||
1333 | void boardInit(void); | ||
1334 | #ifdef __cplusplus | ||
1335 | } | ||
1336 | #endif | ||
1337 | #endif /* _FROM_ASM_ */ | ||
1338 | |||
1339 | #endif /* BOARD_H */ | ||
diff --git a/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.mk b/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.mk new file mode 100644 index 000000000..a9648e4a8 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/ST_STM32F411_DISCOVERY/board.mk | |||
@@ -0,0 +1,9 @@ | |||
1 | # List of all the board related files. | ||
2 | BOARDSRC = $(CHIBIOS_CONTRIB)/os/hal/boards/ST_STM32F411_DISCOVERY/board.c | ||
3 | |||
4 | # Required include directories | ||
5 | BOARDINC = $(CHIBIOS_CONTRIB)/os/hal/boards/ST_STM32F411_DISCOVERY | ||
6 | |||
7 | # Shared variables | ||
8 | ALLCSRC += $(BOARDSRC) | ||
9 | ALLINC += $(BOARDINC) | ||