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