aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ')
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.c266
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.h971
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.mk9
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.chcfg799
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.fmpp15
5 files changed, 2060 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.c b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.c
new file mode 100644
index 000000000..365ca089a
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/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 */
40typedef 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 */
53typedef 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 */
92static 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
143static 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
154static void stm32_gpio_init(void) {
155
156 /* Enabling GPIO-related clocks, the mask comes from the
157 registry header file.*/
158 rccResetIOP(STM32_GPIO_EN_MASK);
159 rccEnableIOP(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 */
210void __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 */
220bool 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 */
230bool 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 */
242bool 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 */
252bool 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 */
264void boardInit(void) {
265
266}
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.h b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.h
new file mode 100644
index 000000000..84a62dd84
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.h
@@ -0,0 +1,971 @@
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 STM32 Nucleo64-L073RZ board.
31 */
32
33/*
34 * Board identifier.
35 */
36#define BOARD_ST_NUCLEO64_L073RZ
37#define BOARD_NAME "STMicroelectronics STM32 Nucleo64-L073RZ"
38
39/*
40 * Board oscillators-related settings.
41 */
42#if !defined(STM32_LSECLK)
43#define STM32_LSECLK 32768U
44#endif
45
46#define STM32_LSEDRV (3U << 11U)
47
48#if !defined(STM32_HSECLK)
49#define STM32_HSECLK 8000000U
50#endif
51
52#define STM32_HSE_BYPASS
53
54/*
55 * MCU type as defined in the ST header.
56 */
57#define STM32L073xx
58
59/*
60 * IO pins assignments.
61 */
62#define GPIOA_ARD_A0 0U
63#define GPIOA_ACD1_IN0 0U
64#define GPIOA_ARD_A1 1U
65#define GPIOA_ACD1_IN1 1U
66#define GPIOA_ARD_D1 2U
67#define GPIOA_USART2_TX 2U
68#define GPIOA_ARD_D0 3U
69#define GPIOA_USART2_RX 3U
70#define GPIOA_ARD_A2 4U
71#define GPIOA_ACD1_IN4 4U
72#define GPIOA_LED_GREEN 5U
73#define GPIOA_ARD_D13 5U
74#define GPIOA_ARD_D12 6U
75#define GPIOA_ARD_D11 7U
76#define GPIOA_ARD_D7 8U
77#define GPIOA_ARD_D8 9U
78#define GPIOA_ARD_D2 10U
79#define GPIOA_PIN11 11U
80#define GPIOA_PIN12 12U
81#define GPIOA_SWDIO 13U
82#define GPIOA_SWCLK 14U
83#define GPIOA_PIN15 15U
84
85#define GPIOB_ARD_A3 0U
86#define GPIOB_ACD1_IN8 0U
87#define GPIOB_PIN1 1U
88#define GPIOB_PIN2 2U
89#define GPIOB_SWO 3U
90#define GPIOB_ARD_D3 3U
91#define GPIOB_ARD_D5 4U
92#define GPIOB_ARD_D4 5U
93#define GPIOB_ARD_D10 6U
94#define GPIOB_PIN7 7U
95#define GPIOB_ARD_D15 8U
96#define GPIOB_ARD_D14 9U
97#define GPIOB_ARD_D6 10U
98#define GPIOB_PIN11 11U
99#define GPIOB_PIN12 12U
100#define GPIOB_PIN13 13U
101#define GPIOB_PIN14 14U
102#define GPIOB_PIN15 15U
103
104#define GPIOC_ARD_A5 0U
105#define GPIOC_ACD1_IN10 0U
106#define GPIOC_ARD_A4 1U
107#define GPIOC_ACD1_IN11 1U
108#define GPIOC_PIN2 2U
109#define GPIOC_PIN3 3U
110#define GPIOC_PIN4 4U
111#define GPIOC_PIN5 5U
112#define GPIOC_PIN6 6U
113#define GPIOC_ARD_D9 7U
114#define GPIOC_PIN8 8U
115#define GPIOC_PIN9 9U
116#define GPIOC_PIN10 10U
117#define GPIOC_PIN11 11U
118#define GPIOC_PIN12 12U
119#define GPIOC_BUTTON 13U
120#define GPIOC_OSC32_IN 14U
121#define GPIOC_OSC32_OUT 15U
122
123#define GPIOD_PIN0 0U
124#define GPIOD_PIN1 1U
125#define GPIOD_PIN2 2U
126#define GPIOD_PIN3 3U
127#define GPIOD_PIN4 4U
128#define GPIOD_PIN5 5U
129#define GPIOD_PIN6 6U
130#define GPIOD_PIN7 7U
131#define GPIOD_PIN8 8U
132#define GPIOD_PIN9 9U
133#define GPIOD_PIN10 10U
134#define GPIOD_PIN11 11U
135#define GPIOD_PIN12 12U
136#define GPIOD_PIN13 13U
137#define GPIOD_PIN14 14U
138#define GPIOD_PIN15 15U
139
140#define GPIOE_PIN0 0U
141#define GPIOE_PIN1 1U
142#define GPIOE_PIN2 2U
143#define GPIOE_PIN3 3U
144#define GPIOE_PIN4 4U
145#define GPIOE_PIN5 5U
146#define GPIOE_PIN6 6U
147#define GPIOE_PIN7 7U
148#define GPIOE_PIN8 8U
149#define GPIOE_PIN9 9U
150#define GPIOE_PIN10 10U
151#define GPIOE_PIN11 11U
152#define GPIOE_PIN12 12U
153#define GPIOE_PIN13 13U
154#define GPIOE_PIN14 14U
155#define GPIOE_PIN15 15U
156
157#define GPIOH_OSC_IN 0U
158#define GPIOH_OSC_OUT 1U
159#define GPIOH_PIN2 2U
160#define GPIOH_PIN3 3U
161#define GPIOH_PIN4 4U
162#define GPIOH_PIN5 5U
163#define GPIOH_PIN6 6U
164#define GPIOH_PIN7 7U
165#define GPIOH_PIN8 8U
166#define GPIOH_PIN9 9U
167#define GPIOH_PIN10 10U
168#define GPIOH_PIN11 11U
169#define GPIOH_PIN12 12U
170#define GPIOH_PIN13 13U
171#define GPIOH_PIN14 14U
172#define GPIOH_PIN15 15U
173
174/*
175 * IO lines assignments.
176 */
177#define LINE_ARD_A0 PAL_LINE(GPIOA, 0U)
178#define LINE_ACD1_IN0 PAL_LINE(GPIOA, 0U)
179#define LINE_ARD_A1 PAL_LINE(GPIOA, 1U)
180#define LINE_ACD1_IN1 PAL_LINE(GPIOA, 1U)
181#define LINE_ARD_D1 PAL_LINE(GPIOA, 2U)
182#define LINE_USART2_TX PAL_LINE(GPIOA, 2U)
183#define LINE_ARD_D0 PAL_LINE(GPIOA, 3U)
184#define LINE_USART2_RX PAL_LINE(GPIOA, 3U)
185#define LINE_ARD_A2 PAL_LINE(GPIOA, 4U)
186#define LINE_ACD1_IN4 PAL_LINE(GPIOA, 4U)
187#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U)
188#define LINE_ARD_D13 PAL_LINE(GPIOA, 5U)
189#define LINE_ARD_D12 PAL_LINE(GPIOA, 6U)
190#define LINE_ARD_D11 PAL_LINE(GPIOA, 7U)
191#define LINE_ARD_D7 PAL_LINE(GPIOA, 8U)
192#define LINE_ARD_D8 PAL_LINE(GPIOA, 9U)
193#define LINE_ARD_D2 PAL_LINE(GPIOA, 10U)
194#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
195#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
196#define LINE_ARD_A3 PAL_LINE(GPIOB, 0U)
197#define LINE_ACD1_IN8 PAL_LINE(GPIOB, 0U)
198#define LINE_SWO PAL_LINE(GPIOB, 3U)
199#define LINE_ARD_D3 PAL_LINE(GPIOB, 3U)
200#define LINE_ARD_D5 PAL_LINE(GPIOB, 4U)
201#define LINE_ARD_D4 PAL_LINE(GPIOB, 5U)
202#define LINE_ARD_D10 PAL_LINE(GPIOB, 6U)
203#define LINE_ARD_D15 PAL_LINE(GPIOB, 8U)
204#define LINE_ARD_D14 PAL_LINE(GPIOB, 9U)
205#define LINE_ARD_D6 PAL_LINE(GPIOB, 10U)
206#define LINE_ARD_A5 PAL_LINE(GPIOC, 0U)
207#define LINE_ACD1_IN10 PAL_LINE(GPIOC, 0U)
208#define LINE_ARD_A4 PAL_LINE(GPIOC, 1U)
209#define LINE_ACD1_IN11 PAL_LINE(GPIOC, 1U)
210#define LINE_ARD_D9 PAL_LINE(GPIOC, 7U)
211#define LINE_BUTTON PAL_LINE(GPIOC, 13U)
212#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
213#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
214#define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
215#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
216
217/*===========================================================================*/
218/* Driver pre-compile time settings. */
219/*===========================================================================*/
220
221/*===========================================================================*/
222/* Derived constants and error checks. */
223/*===========================================================================*/
224
225/*===========================================================================*/
226/* Driver data structures and types. */
227/*===========================================================================*/
228
229/*===========================================================================*/
230/* Driver macros. */
231/*===========================================================================*/
232
233/*
234 * I/O ports initial setup, this configuration is established soon after reset
235 * in the initialization code.
236 * Please refer to the STM32 Reference Manual for details.
237 */
238#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
239#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
240#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
241#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
242#define PIN_ODR_LOW(n) (0U << (n))
243#define PIN_ODR_HIGH(n) (1U << (n))
244#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
245#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
246#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
247#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
248#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
249#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
250#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
251#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
252#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
253#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
254
255/*
256 * GPIOA setup:
257 *
258 * PA0 - ARD_A0 ACD1_IN0 (input pullup).
259 * PA1 - ARD_A1 ACD1_IN1 (input pullup).
260 * PA2 - ARD_D1 USART2_TX (alternate 4).
261 * PA3 - ARD_D0 USART2_RX (alternate 4).
262 * PA4 - ARD_A2 ACD1_IN4 (input pullup).
263 * PA5 - LED_GREEN ARD_D13 (output pushpull maximum).
264 * PA6 - ARD_D12 (input pullup).
265 * PA7 - ARD_D11 (input pullup).
266 * PA8 - ARD_D7 (input pullup).
267 * PA9 - ARD_D8 (input pullup).
268 * PA10 - ARD_D2 (input pullup).
269 * PA11 - PIN11 (input pullup).
270 * PA12 - PIN12 (input pullup).
271 * PA13 - SWDIO (alternate 0).
272 * PA14 - SWCLK (alternate 0).
273 * PA15 - PIN15 (input pullup).
274 */
275#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_ARD_A0) | \
276 PIN_MODE_INPUT(GPIOA_ARD_A1) | \
277 PIN_MODE_ALTERNATE(GPIOA_ARD_D1) | \
278 PIN_MODE_ALTERNATE(GPIOA_ARD_D0) | \
279 PIN_MODE_INPUT(GPIOA_ARD_A2) | \
280 PIN_MODE_OUTPUT(GPIOA_LED_GREEN) | \
281 PIN_MODE_INPUT(GPIOA_ARD_D12) | \
282 PIN_MODE_INPUT(GPIOA_ARD_D11) | \
283 PIN_MODE_INPUT(GPIOA_ARD_D7) | \
284 PIN_MODE_INPUT(GPIOA_ARD_D8) | \
285 PIN_MODE_INPUT(GPIOA_ARD_D2) | \
286 PIN_MODE_INPUT(GPIOA_PIN11) | \
287 PIN_MODE_INPUT(GPIOA_PIN12) | \
288 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
289 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
290 PIN_MODE_INPUT(GPIOA_PIN15))
291#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_ARD_A0) | \
292 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A1) | \
293 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D1) | \
294 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D0) | \
295 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A2) | \
296 PIN_OTYPE_PUSHPULL(GPIOA_LED_GREEN) | \
297 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D12) | \
298 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D11) | \
299 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D7) | \
300 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D8) | \
301 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D2) | \
302 PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \
303 PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \
304 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
305 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
306 PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
307#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_ARD_A0) | \
308 PIN_OSPEED_HIGH(GPIOA_ARD_A1) | \
309 PIN_OSPEED_MEDIUM(GPIOA_ARD_D1) | \
310 PIN_OSPEED_MEDIUM(GPIOA_ARD_D0) | \
311 PIN_OSPEED_HIGH(GPIOA_ARD_A2) | \
312 PIN_OSPEED_HIGH(GPIOA_LED_GREEN) | \
313 PIN_OSPEED_HIGH(GPIOA_ARD_D12) | \
314 PIN_OSPEED_HIGH(GPIOA_ARD_D11) | \
315 PIN_OSPEED_HIGH(GPIOA_ARD_D7) | \
316 PIN_OSPEED_HIGH(GPIOA_ARD_D8) | \
317 PIN_OSPEED_HIGH(GPIOA_ARD_D2) | \
318 PIN_OSPEED_HIGH(GPIOA_PIN11) | \
319 PIN_OSPEED_HIGH(GPIOA_PIN12) | \
320 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
321 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
322 PIN_OSPEED_HIGH(GPIOA_PIN15))
323#define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_ARD_A0) | \
324 PIN_PUPDR_PULLUP(GPIOA_ARD_A1) | \
325 PIN_PUPDR_FLOATING(GPIOA_ARD_D1) | \
326 PIN_PUPDR_FLOATING(GPIOA_ARD_D0) | \
327 PIN_PUPDR_PULLUP(GPIOA_ARD_A2) | \
328 PIN_PUPDR_FLOATING(GPIOA_LED_GREEN) | \
329 PIN_PUPDR_PULLUP(GPIOA_ARD_D12) | \
330 PIN_PUPDR_PULLUP(GPIOA_ARD_D11) | \
331 PIN_PUPDR_PULLUP(GPIOA_ARD_D7) | \
332 PIN_PUPDR_PULLUP(GPIOA_ARD_D8) | \
333 PIN_PUPDR_PULLUP(GPIOA_ARD_D2) | \
334 PIN_PUPDR_PULLUP(GPIOA_PIN11) | \
335 PIN_PUPDR_PULLUP(GPIOA_PIN12) | \
336 PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
337 PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
338 PIN_PUPDR_PULLUP(GPIOA_PIN15))
339#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_ARD_A0) | \
340 PIN_ODR_HIGH(GPIOA_ARD_A1) | \
341 PIN_ODR_HIGH(GPIOA_ARD_D1) | \
342 PIN_ODR_HIGH(GPIOA_ARD_D0) | \
343 PIN_ODR_HIGH(GPIOA_ARD_A2) | \
344 PIN_ODR_LOW(GPIOA_LED_GREEN) | \
345 PIN_ODR_HIGH(GPIOA_ARD_D12) | \
346 PIN_ODR_HIGH(GPIOA_ARD_D11) | \
347 PIN_ODR_HIGH(GPIOA_ARD_D7) | \
348 PIN_ODR_HIGH(GPIOA_ARD_D8) | \
349 PIN_ODR_HIGH(GPIOA_ARD_D2) | \
350 PIN_ODR_HIGH(GPIOA_PIN11) | \
351 PIN_ODR_HIGH(GPIOA_PIN12) | \
352 PIN_ODR_HIGH(GPIOA_SWDIO) | \
353 PIN_ODR_HIGH(GPIOA_SWCLK) | \
354 PIN_ODR_HIGH(GPIOA_PIN15))
355#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_ARD_A0, 0U) | \
356 PIN_AFIO_AF(GPIOA_ARD_A1, 0U) | \
357 PIN_AFIO_AF(GPIOA_ARD_D1, 4U) | \
358 PIN_AFIO_AF(GPIOA_ARD_D0, 4U) | \
359 PIN_AFIO_AF(GPIOA_ARD_A2, 0U) | \
360 PIN_AFIO_AF(GPIOA_LED_GREEN, 0U) | \
361 PIN_AFIO_AF(GPIOA_ARD_D12, 0U) | \
362 PIN_AFIO_AF(GPIOA_ARD_D11, 0U))
363#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_ARD_D7, 0U) | \
364 PIN_AFIO_AF(GPIOA_ARD_D8, 0U) | \
365 PIN_AFIO_AF(GPIOA_ARD_D2, 0U) | \
366 PIN_AFIO_AF(GPIOA_PIN11, 0U) | \
367 PIN_AFIO_AF(GPIOA_PIN12, 0U) | \
368 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
369 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
370 PIN_AFIO_AF(GPIOA_PIN15, 0U))
371
372/*
373 * GPIOB setup:
374 *
375 * PB0 - ARD_A3 ACD1_IN8 (input pullup).
376 * PB1 - PIN1 (input pullup).
377 * PB2 - PIN2 (input pullup).
378 * PB3 - SWO ARD_D3 (alternate 0).
379 * PB4 - ARD_D5 (input pullup).
380 * PB5 - ARD_D4 (input pullup).
381 * PB6 - ARD_D10 (input pullup).
382 * PB7 - PIN7 (input pullup).
383 * PB8 - ARD_D15 (input pullup).
384 * PB9 - ARD_D14 (input pullup).
385 * PB10 - ARD_D6 (input pullup).
386 * PB11 - PIN11 (input pullup).
387 * PB12 - PIN12 (input pullup).
388 * PB13 - PIN13 (input pullup).
389 * PB14 - PIN14 (input pullup).
390 * PB15 - PIN15 (input pullup).
391 */
392#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_ARD_A3) | \
393 PIN_MODE_INPUT(GPIOB_PIN1) | \
394 PIN_MODE_INPUT(GPIOB_PIN2) | \
395 PIN_MODE_ALTERNATE(GPIOB_SWO) | \
396 PIN_MODE_INPUT(GPIOB_ARD_D5) | \
397 PIN_MODE_INPUT(GPIOB_ARD_D4) | \
398 PIN_MODE_INPUT(GPIOB_ARD_D10) | \
399 PIN_MODE_INPUT(GPIOB_PIN7) | \
400 PIN_MODE_INPUT(GPIOB_ARD_D15) | \
401 PIN_MODE_INPUT(GPIOB_ARD_D14) | \
402 PIN_MODE_INPUT(GPIOB_ARD_D6) | \
403 PIN_MODE_INPUT(GPIOB_PIN11) | \
404 PIN_MODE_INPUT(GPIOB_PIN12) | \
405 PIN_MODE_INPUT(GPIOB_PIN13) | \
406 PIN_MODE_INPUT(GPIOB_PIN14) | \
407 PIN_MODE_INPUT(GPIOB_PIN15))
408#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ARD_A3) | \
409 PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
410 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
411 PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \
412 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D5) | \
413 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D4) | \
414 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D10) | \
415 PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
416 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D15) | \
417 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D14) | \
418 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D6) | \
419 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
420 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
421 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
422 PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
423 PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
424#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_ARD_A3) | \
425 PIN_OSPEED_HIGH(GPIOB_PIN1) | \
426 PIN_OSPEED_HIGH(GPIOB_PIN2) | \
427 PIN_OSPEED_HIGH(GPIOB_SWO) | \
428 PIN_OSPEED_HIGH(GPIOB_ARD_D5) | \
429 PIN_OSPEED_HIGH(GPIOB_ARD_D4) | \
430 PIN_OSPEED_HIGH(GPIOB_ARD_D10) | \
431 PIN_OSPEED_HIGH(GPIOB_PIN7) | \
432 PIN_OSPEED_HIGH(GPIOB_ARD_D15) | \
433 PIN_OSPEED_HIGH(GPIOB_ARD_D14) | \
434 PIN_OSPEED_HIGH(GPIOB_ARD_D6) | \
435 PIN_OSPEED_HIGH(GPIOB_PIN11) | \
436 PIN_OSPEED_HIGH(GPIOB_PIN12) | \
437 PIN_OSPEED_HIGH(GPIOB_PIN13) | \
438 PIN_OSPEED_HIGH(GPIOB_PIN14) | \
439 PIN_OSPEED_HIGH(GPIOB_PIN15))
440#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_ARD_A3) | \
441 PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
442 PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
443 PIN_PUPDR_PULLUP(GPIOB_SWO) | \
444 PIN_PUPDR_PULLUP(GPIOB_ARD_D5) | \
445 PIN_PUPDR_PULLUP(GPIOB_ARD_D4) | \
446 PIN_PUPDR_PULLUP(GPIOB_ARD_D10) | \
447 PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
448 PIN_PUPDR_PULLUP(GPIOB_ARD_D15) | \
449 PIN_PUPDR_PULLUP(GPIOB_ARD_D14) | \
450 PIN_PUPDR_PULLUP(GPIOB_ARD_D6) | \
451 PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
452 PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
453 PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
454 PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
455 PIN_PUPDR_PULLUP(GPIOB_PIN15))
456#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ARD_A3) | \
457 PIN_ODR_HIGH(GPIOB_PIN1) | \
458 PIN_ODR_HIGH(GPIOB_PIN2) | \
459 PIN_ODR_HIGH(GPIOB_SWO) | \
460 PIN_ODR_HIGH(GPIOB_ARD_D5) | \
461 PIN_ODR_HIGH(GPIOB_ARD_D4) | \
462 PIN_ODR_HIGH(GPIOB_ARD_D10) | \
463 PIN_ODR_HIGH(GPIOB_PIN7) | \
464 PIN_ODR_HIGH(GPIOB_ARD_D15) | \
465 PIN_ODR_HIGH(GPIOB_ARD_D14) | \
466 PIN_ODR_HIGH(GPIOB_ARD_D6) | \
467 PIN_ODR_HIGH(GPIOB_PIN11) | \
468 PIN_ODR_HIGH(GPIOB_PIN12) | \
469 PIN_ODR_HIGH(GPIOB_PIN13) | \
470 PIN_ODR_HIGH(GPIOB_PIN14) | \
471 PIN_ODR_HIGH(GPIOB_PIN15))
472#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ARD_A3, 0U) | \
473 PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
474 PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
475 PIN_AFIO_AF(GPIOB_SWO, 0U) | \
476 PIN_AFIO_AF(GPIOB_ARD_D5, 0U) | \
477 PIN_AFIO_AF(GPIOB_ARD_D4, 0U) | \
478 PIN_AFIO_AF(GPIOB_ARD_D10, 0U) | \
479 PIN_AFIO_AF(GPIOB_PIN7, 0U))
480#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_ARD_D15, 0U) | \
481 PIN_AFIO_AF(GPIOB_ARD_D14, 0U) | \
482 PIN_AFIO_AF(GPIOB_ARD_D6, 0U) | \
483 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
484 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
485 PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
486 PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
487 PIN_AFIO_AF(GPIOB_PIN15, 0U))
488
489/*
490 * GPIOC setup:
491 *
492 * PC0 - ARD_A5 ACD1_IN10 (input pullup).
493 * PC1 - ARD_A4 ACD1_IN11 (input pullup).
494 * PC2 - PIN2 (input pullup).
495 * PC3 - PIN3 (input pullup).
496 * PC4 - PIN4 (input pullup).
497 * PC5 - PIN5 (input pullup).
498 * PC6 - PIN6 (input pullup).
499 * PC7 - ARD_D9 (input pullup).
500 * PC8 - PIN8 (input pullup).
501 * PC9 - PIN9 (input pullup).
502 * PC10 - PIN10 (input pullup).
503 * PC11 - PIN11 (input pullup).
504 * PC12 - PIN12 (input pullup).
505 * PC13 - BUTTON (input floating).
506 * PC14 - OSC32_IN (input floating).
507 * PC15 - OSC32_OUT (input floating).
508 */
509#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_ARD_A5) | \
510 PIN_MODE_INPUT(GPIOC_ARD_A4) | \
511 PIN_MODE_INPUT(GPIOC_PIN2) | \
512 PIN_MODE_INPUT(GPIOC_PIN3) | \
513 PIN_MODE_INPUT(GPIOC_PIN4) | \
514 PIN_MODE_INPUT(GPIOC_PIN5) | \
515 PIN_MODE_INPUT(GPIOC_PIN6) | \
516 PIN_MODE_INPUT(GPIOC_ARD_D9) | \
517 PIN_MODE_INPUT(GPIOC_PIN8) | \
518 PIN_MODE_INPUT(GPIOC_PIN9) | \
519 PIN_MODE_INPUT(GPIOC_PIN10) | \
520 PIN_MODE_INPUT(GPIOC_PIN11) | \
521 PIN_MODE_INPUT(GPIOC_PIN12) | \
522 PIN_MODE_INPUT(GPIOC_BUTTON) | \
523 PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
524 PIN_MODE_INPUT(GPIOC_OSC32_OUT))
525#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_ARD_A5) | \
526 PIN_OTYPE_PUSHPULL(GPIOC_ARD_A4) | \
527 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
528 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
529 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
530 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
531 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
532 PIN_OTYPE_PUSHPULL(GPIOC_ARD_D9) | \
533 PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
534 PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
535 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
536 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
537 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
538 PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \
539 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
540 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
541#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_ARD_A5) | \
542 PIN_OSPEED_HIGH(GPIOC_ARD_A4) | \
543 PIN_OSPEED_HIGH(GPIOC_PIN2) | \
544 PIN_OSPEED_HIGH(GPIOC_PIN3) | \
545 PIN_OSPEED_HIGH(GPIOC_PIN4) | \
546 PIN_OSPEED_HIGH(GPIOC_PIN5) | \
547 PIN_OSPEED_HIGH(GPIOC_PIN6) | \
548 PIN_OSPEED_HIGH(GPIOC_ARD_D9) | \
549 PIN_OSPEED_HIGH(GPIOC_PIN8) | \
550 PIN_OSPEED_HIGH(GPIOC_PIN9) | \
551 PIN_OSPEED_HIGH(GPIOC_PIN10) | \
552 PIN_OSPEED_HIGH(GPIOC_PIN11) | \
553 PIN_OSPEED_HIGH(GPIOC_PIN12) | \
554 PIN_OSPEED_HIGH(GPIOC_BUTTON) | \
555 PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
556 PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
557#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_ARD_A5) | \
558 PIN_PUPDR_PULLUP(GPIOC_ARD_A4) | \
559 PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
560 PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
561 PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
562 PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
563 PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
564 PIN_PUPDR_PULLUP(GPIOC_ARD_D9) | \
565 PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
566 PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
567 PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
568 PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
569 PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
570 PIN_PUPDR_FLOATING(GPIOC_BUTTON) | \
571 PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
572 PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
573#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_ARD_A5) | \
574 PIN_ODR_HIGH(GPIOC_ARD_A4) | \
575 PIN_ODR_HIGH(GPIOC_PIN2) | \
576 PIN_ODR_HIGH(GPIOC_PIN3) | \
577 PIN_ODR_HIGH(GPIOC_PIN4) | \
578 PIN_ODR_HIGH(GPIOC_PIN5) | \
579 PIN_ODR_HIGH(GPIOC_PIN6) | \
580 PIN_ODR_HIGH(GPIOC_ARD_D9) | \
581 PIN_ODR_HIGH(GPIOC_PIN8) | \
582 PIN_ODR_HIGH(GPIOC_PIN9) | \
583 PIN_ODR_HIGH(GPIOC_PIN10) | \
584 PIN_ODR_HIGH(GPIOC_PIN11) | \
585 PIN_ODR_HIGH(GPIOC_PIN12) | \
586 PIN_ODR_HIGH(GPIOC_BUTTON) | \
587 PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
588 PIN_ODR_HIGH(GPIOC_OSC32_OUT))
589#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_ARD_A5, 0U) | \
590 PIN_AFIO_AF(GPIOC_ARD_A4, 0U) | \
591 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
592 PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
593 PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
594 PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
595 PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
596 PIN_AFIO_AF(GPIOC_ARD_D9, 0U))
597#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
598 PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
599 PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
600 PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
601 PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
602 PIN_AFIO_AF(GPIOC_BUTTON, 0U) | \
603 PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
604 PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
605
606/*
607 * GPIOD setup:
608 *
609 * PD0 - PIN0 (input pullup).
610 * PD1 - PIN1 (input pullup).
611 * PD2 - PIN2 (input pullup).
612 * PD3 - PIN3 (input pullup).
613 * PD4 - PIN4 (input pullup).
614 * PD5 - PIN5 (input pullup).
615 * PD6 - PIN6 (input pullup).
616 * PD7 - PIN7 (input pullup).
617 * PD8 - PIN8 (input pullup).
618 * PD9 - PIN9 (input pullup).
619 * PD10 - PIN10 (input pullup).
620 * PD11 - PIN11 (input pullup).
621 * PD12 - PIN12 (input pullup).
622 * PD13 - PIN13 (input pullup).
623 * PD14 - PIN14 (input pullup).
624 * PD15 - PIN15 (input pullup).
625 */
626#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
627 PIN_MODE_INPUT(GPIOD_PIN1) | \
628 PIN_MODE_INPUT(GPIOD_PIN2) | \
629 PIN_MODE_INPUT(GPIOD_PIN3) | \
630 PIN_MODE_INPUT(GPIOD_PIN4) | \
631 PIN_MODE_INPUT(GPIOD_PIN5) | \
632 PIN_MODE_INPUT(GPIOD_PIN6) | \
633 PIN_MODE_INPUT(GPIOD_PIN7) | \
634 PIN_MODE_INPUT(GPIOD_PIN8) | \
635 PIN_MODE_INPUT(GPIOD_PIN9) | \
636 PIN_MODE_INPUT(GPIOD_PIN10) | \
637 PIN_MODE_INPUT(GPIOD_PIN11) | \
638 PIN_MODE_INPUT(GPIOD_PIN12) | \
639 PIN_MODE_INPUT(GPIOD_PIN13) | \
640 PIN_MODE_INPUT(GPIOD_PIN14) | \
641 PIN_MODE_INPUT(GPIOD_PIN15))
642#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
643 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
644 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
645 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
646 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
647 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
648 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
649 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
650 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
651 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
652 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
653 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
654 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
655 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
656 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
657 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
658#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \
659 PIN_OSPEED_HIGH(GPIOD_PIN1) | \
660 PIN_OSPEED_HIGH(GPIOD_PIN2) | \
661 PIN_OSPEED_HIGH(GPIOD_PIN3) | \
662 PIN_OSPEED_HIGH(GPIOD_PIN4) | \
663 PIN_OSPEED_HIGH(GPIOD_PIN5) | \
664 PIN_OSPEED_HIGH(GPIOD_PIN6) | \
665 PIN_OSPEED_HIGH(GPIOD_PIN7) | \
666 PIN_OSPEED_HIGH(GPIOD_PIN8) | \
667 PIN_OSPEED_HIGH(GPIOD_PIN9) | \
668 PIN_OSPEED_HIGH(GPIOD_PIN10) | \
669 PIN_OSPEED_HIGH(GPIOD_PIN11) | \
670 PIN_OSPEED_HIGH(GPIOD_PIN12) | \
671 PIN_OSPEED_HIGH(GPIOD_PIN13) | \
672 PIN_OSPEED_HIGH(GPIOD_PIN14) | \
673 PIN_OSPEED_HIGH(GPIOD_PIN15))
674#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
675 PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
676 PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
677 PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
678 PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
679 PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
680 PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
681 PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
682 PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
683 PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
684 PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
685 PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
686 PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
687 PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
688 PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
689 PIN_PUPDR_PULLUP(GPIOD_PIN15))
690#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
691 PIN_ODR_HIGH(GPIOD_PIN1) | \
692 PIN_ODR_HIGH(GPIOD_PIN2) | \
693 PIN_ODR_HIGH(GPIOD_PIN3) | \
694 PIN_ODR_HIGH(GPIOD_PIN4) | \
695 PIN_ODR_HIGH(GPIOD_PIN5) | \
696 PIN_ODR_HIGH(GPIOD_PIN6) | \
697 PIN_ODR_HIGH(GPIOD_PIN7) | \
698 PIN_ODR_HIGH(GPIOD_PIN8) | \
699 PIN_ODR_HIGH(GPIOD_PIN9) | \
700 PIN_ODR_HIGH(GPIOD_PIN10) | \
701 PIN_ODR_HIGH(GPIOD_PIN11) | \
702 PIN_ODR_HIGH(GPIOD_PIN12) | \
703 PIN_ODR_HIGH(GPIOD_PIN13) | \
704 PIN_ODR_HIGH(GPIOD_PIN14) | \
705 PIN_ODR_HIGH(GPIOD_PIN15))
706#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
707 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
708 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
709 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
710 PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
711 PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
712 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
713 PIN_AFIO_AF(GPIOD_PIN7, 0U))
714#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
715 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
716 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
717 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
718 PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
719 PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
720 PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
721 PIN_AFIO_AF(GPIOD_PIN15, 0U))
722
723/*
724 * GPIOE setup:
725 *
726 * PE0 - PIN0 (input pullup).
727 * PE1 - PIN1 (input pullup).
728 * PE2 - PIN2 (input pullup).
729 * PE3 - PIN3 (input pullup).
730 * PE4 - PIN4 (input pullup).
731 * PE5 - PIN5 (input pullup).
732 * PE6 - PIN6 (input pullup).
733 * PE7 - PIN7 (input pullup).
734 * PE8 - PIN8 (input pullup).
735 * PE9 - PIN9 (input pullup).
736 * PE10 - PIN10 (input pullup).
737 * PE11 - PIN11 (input pullup).
738 * PE12 - PIN12 (input pullup).
739 * PE13 - PIN13 (input pullup).
740 * PE14 - PIN14 (input pullup).
741 * PE15 - PIN15 (input pullup).
742 */
743#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
744 PIN_MODE_INPUT(GPIOE_PIN1) | \
745 PIN_MODE_INPUT(GPIOE_PIN2) | \
746 PIN_MODE_INPUT(GPIOE_PIN3) | \
747 PIN_MODE_INPUT(GPIOE_PIN4) | \
748 PIN_MODE_INPUT(GPIOE_PIN5) | \
749 PIN_MODE_INPUT(GPIOE_PIN6) | \
750 PIN_MODE_INPUT(GPIOE_PIN7) | \
751 PIN_MODE_INPUT(GPIOE_PIN8) | \
752 PIN_MODE_INPUT(GPIOE_PIN9) | \
753 PIN_MODE_INPUT(GPIOE_PIN10) | \
754 PIN_MODE_INPUT(GPIOE_PIN11) | \
755 PIN_MODE_INPUT(GPIOE_PIN12) | \
756 PIN_MODE_INPUT(GPIOE_PIN13) | \
757 PIN_MODE_INPUT(GPIOE_PIN14) | \
758 PIN_MODE_INPUT(GPIOE_PIN15))
759#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
760 PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
761 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
762 PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
763 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
764 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
765 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
766 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
767 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
768 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
769 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
770 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
771 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
772 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
773 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
774 PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
775#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \
776 PIN_OSPEED_HIGH(GPIOE_PIN1) | \
777 PIN_OSPEED_HIGH(GPIOE_PIN2) | \
778 PIN_OSPEED_HIGH(GPIOE_PIN3) | \
779 PIN_OSPEED_HIGH(GPIOE_PIN4) | \
780 PIN_OSPEED_HIGH(GPIOE_PIN5) | \
781 PIN_OSPEED_HIGH(GPIOE_PIN6) | \
782 PIN_OSPEED_HIGH(GPIOE_PIN7) | \
783 PIN_OSPEED_HIGH(GPIOE_PIN8) | \
784 PIN_OSPEED_HIGH(GPIOE_PIN9) | \
785 PIN_OSPEED_HIGH(GPIOE_PIN10) | \
786 PIN_OSPEED_HIGH(GPIOE_PIN11) | \
787 PIN_OSPEED_HIGH(GPIOE_PIN12) | \
788 PIN_OSPEED_HIGH(GPIOE_PIN13) | \
789 PIN_OSPEED_HIGH(GPIOE_PIN14) | \
790 PIN_OSPEED_HIGH(GPIOE_PIN15))
791#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
792 PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
793 PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
794 PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
795 PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
796 PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
797 PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
798 PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
799 PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
800 PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
801 PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
802 PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
803 PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
804 PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
805 PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
806 PIN_PUPDR_PULLUP(GPIOE_PIN15))
807#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
808 PIN_ODR_HIGH(GPIOE_PIN1) | \
809 PIN_ODR_HIGH(GPIOE_PIN2) | \
810 PIN_ODR_HIGH(GPIOE_PIN3) | \
811 PIN_ODR_HIGH(GPIOE_PIN4) | \
812 PIN_ODR_HIGH(GPIOE_PIN5) | \
813 PIN_ODR_HIGH(GPIOE_PIN6) | \
814 PIN_ODR_HIGH(GPIOE_PIN7) | \
815 PIN_ODR_HIGH(GPIOE_PIN8) | \
816 PIN_ODR_HIGH(GPIOE_PIN9) | \
817 PIN_ODR_HIGH(GPIOE_PIN10) | \
818 PIN_ODR_HIGH(GPIOE_PIN11) | \
819 PIN_ODR_HIGH(GPIOE_PIN12) | \
820 PIN_ODR_HIGH(GPIOE_PIN13) | \
821 PIN_ODR_HIGH(GPIOE_PIN14) | \
822 PIN_ODR_HIGH(GPIOE_PIN15))
823#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
824 PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
825 PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
826 PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
827 PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
828 PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
829 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
830 PIN_AFIO_AF(GPIOE_PIN7, 0U))
831#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
832 PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
833 PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
834 PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
835 PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
836 PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
837 PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
838 PIN_AFIO_AF(GPIOE_PIN15, 0U))
839
840/*
841 * GPIOH setup:
842 *
843 * PH0 - OSC_IN (input floating).
844 * PH1 - OSC_OUT (input floating).
845 * PH2 - PIN2 (input pullup).
846 * PH3 - PIN3 (input pullup).
847 * PH4 - PIN4 (input pullup).
848 * PH5 - PIN5 (input pullup).
849 * PH6 - PIN6 (input pullup).
850 * PH7 - PIN7 (input pullup).
851 * PH8 - PIN8 (input pullup).
852 * PH9 - PIN9 (input pullup).
853 * PH10 - PIN10 (input pullup).
854 * PH11 - PIN11 (input pullup).
855 * PH12 - PIN12 (input pullup).
856 * PH13 - PIN13 (input pullup).
857 * PH14 - PIN14 (input pullup).
858 * PH15 - PIN15 (input pullup).
859 */
860#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \
861 PIN_MODE_INPUT(GPIOH_OSC_OUT) | \
862 PIN_MODE_INPUT(GPIOH_PIN2) | \
863 PIN_MODE_INPUT(GPIOH_PIN3) | \
864 PIN_MODE_INPUT(GPIOH_PIN4) | \
865 PIN_MODE_INPUT(GPIOH_PIN5) | \
866 PIN_MODE_INPUT(GPIOH_PIN6) | \
867 PIN_MODE_INPUT(GPIOH_PIN7) | \
868 PIN_MODE_INPUT(GPIOH_PIN8) | \
869 PIN_MODE_INPUT(GPIOH_PIN9) | \
870 PIN_MODE_INPUT(GPIOH_PIN10) | \
871 PIN_MODE_INPUT(GPIOH_PIN11) | \
872 PIN_MODE_INPUT(GPIOH_PIN12) | \
873 PIN_MODE_INPUT(GPIOH_PIN13) | \
874 PIN_MODE_INPUT(GPIOH_PIN14) | \
875 PIN_MODE_INPUT(GPIOH_PIN15))
876#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \
877 PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \
878 PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
879 PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
880 PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
881 PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
882 PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
883 PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
884 PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
885 PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
886 PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
887 PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
888 PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
889 PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
890 PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
891 PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
892#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \
893 PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \
894 PIN_OSPEED_HIGH(GPIOH_PIN2) | \
895 PIN_OSPEED_HIGH(GPIOH_PIN3) | \
896 PIN_OSPEED_HIGH(GPIOH_PIN4) | \
897 PIN_OSPEED_HIGH(GPIOH_PIN5) | \
898 PIN_OSPEED_HIGH(GPIOH_PIN6) | \
899 PIN_OSPEED_HIGH(GPIOH_PIN7) | \
900 PIN_OSPEED_HIGH(GPIOH_PIN8) | \
901 PIN_OSPEED_HIGH(GPIOH_PIN9) | \
902 PIN_OSPEED_HIGH(GPIOH_PIN10) | \
903 PIN_OSPEED_HIGH(GPIOH_PIN11) | \
904 PIN_OSPEED_HIGH(GPIOH_PIN12) | \
905 PIN_OSPEED_HIGH(GPIOH_PIN13) | \
906 PIN_OSPEED_HIGH(GPIOH_PIN14) | \
907 PIN_OSPEED_HIGH(GPIOH_PIN15))
908#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \
909 PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \
910 PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
911 PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
912 PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
913 PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
914 PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
915 PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
916 PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
917 PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
918 PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
919 PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
920 PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
921 PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
922 PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
923 PIN_PUPDR_PULLUP(GPIOH_PIN15))
924#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \
925 PIN_ODR_HIGH(GPIOH_OSC_OUT) | \
926 PIN_ODR_HIGH(GPIOH_PIN2) | \
927 PIN_ODR_HIGH(GPIOH_PIN3) | \
928 PIN_ODR_HIGH(GPIOH_PIN4) | \
929 PIN_ODR_HIGH(GPIOH_PIN5) | \
930 PIN_ODR_HIGH(GPIOH_PIN6) | \
931 PIN_ODR_HIGH(GPIOH_PIN7) | \
932 PIN_ODR_HIGH(GPIOH_PIN8) | \
933 PIN_ODR_HIGH(GPIOH_PIN9) | \
934 PIN_ODR_HIGH(GPIOH_PIN10) | \
935 PIN_ODR_HIGH(GPIOH_PIN11) | \
936 PIN_ODR_HIGH(GPIOH_PIN12) | \
937 PIN_ODR_HIGH(GPIOH_PIN13) | \
938 PIN_ODR_HIGH(GPIOH_PIN14) | \
939 PIN_ODR_HIGH(GPIOH_PIN15))
940#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \
941 PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \
942 PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
943 PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
944 PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
945 PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
946 PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
947 PIN_AFIO_AF(GPIOH_PIN7, 0U))
948#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
949 PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
950 PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
951 PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
952 PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
953 PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
954 PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
955 PIN_AFIO_AF(GPIOH_PIN15, 0U))
956
957/*===========================================================================*/
958/* External declarations. */
959/*===========================================================================*/
960
961#if !defined(_FROM_ASM_)
962#ifdef __cplusplus
963extern "C" {
964#endif
965 void boardInit(void);
966#ifdef __cplusplus
967}
968#endif
969#endif /* _FROM_ASM_ */
970
971#endif /* BOARD_H */
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.mk b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.mk
new file mode 100644
index 000000000..3231a159d
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/board.mk
@@ -0,0 +1,9 @@
1# List of all the board related files.
2BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_L073RZ/board.c
3
4# Required include directories
5BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_L073RZ
6
7# Shared variables
8ALLCSRC += $(BOARDSRC)
9ALLINC += $(BOARDINC)
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.chcfg b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.chcfg
new file mode 100644
index 000000000..6e8dfc62c
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.chcfg
@@ -0,0 +1,799 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- STM32L0xx board Template -->
3<board
4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5 xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32l0xx_board.xsd">
6 <configuration_settings>
7 <templates_path>resources/gencfg/processors/boards/stm32l0xx/templates</templates_path>
8 <output_path>..</output_path>
9 <hal_version>5.0.x</hal_version>
10 </configuration_settings>
11 <board_name>STMicroelectronics STM32 Nucleo64-L073RZ</board_name>
12 <board_id>ST_NUCLEO64_L073RZ</board_id>
13 <board_functions></board_functions>
14 <subtype>STM32L073xx</subtype>
15 <clocks HSEFrequency="8000000" HSEBypass="true" LSEFrequency="32768"
16 LSEBypass="false" LSEDrive="3 High Drive (default)" />
17 <ports>
18 <GPIOA>
19 <pin0
20 ID="ARD_A0 ACD1_IN0"
21 Type="PushPull"
22 Level="High"
23 Speed="Maximum"
24 Resistor="PullUp"
25 Mode="Input"
26 Alternate="0" />
27 <pin1
28 ID="ARD_A1 ACD1_IN1"
29 Type="PushPull"
30 Level="High"
31 Speed="Maximum"
32 Resistor="PullUp"
33 Mode="Input"
34 Alternate="0" />
35 <pin2
36 ID="ARD_D1 USART2_TX"
37 Type="PushPull"
38 Level="High"
39 Speed="High"
40 Resistor="Floating"
41 Mode="Alternate"
42 Alternate="4" />
43 <pin3
44 ID="ARD_D0 USART2_RX"
45 Type="PushPull"
46 Level="High"
47 Speed="High"
48 Resistor="Floating"
49 Mode="Alternate"
50 Alternate="4"/>
51 <pin4
52 ID="ARD_A2 ACD1_IN4"
53 Type="PushPull"
54 Level="High"
55 Speed="Maximum"
56 Resistor="PullUp"
57 Mode="Input"
58 Alternate="0" />
59 <pin5
60 ID="LED_GREEN ARD_D13"
61 Type="PushPull"
62 Level="Low"
63 Speed="Maximum"
64 Resistor="Floating"
65 Mode="Output"
66 Alternate="0" />
67 <pin6
68 ID="ARD_D12"
69 Type="PushPull"
70 Level="High"
71 Speed="Maximum"
72 Resistor="PullUp"
73 Mode="Input"
74 Alternate="0" />
75 <pin7
76 ID="ARD_D11"
77 Type="PushPull"
78 Level="High"
79 Speed="Maximum"
80 Resistor="PullUp"
81 Mode="Input"
82 Alternate="0" />
83 <pin8
84 ID="ARD_D7"
85 Type="PushPull"
86 Level="High"
87 Speed="Maximum"
88 Resistor="PullUp"
89 Mode="Input"
90 Alternate="0" />
91 <pin9
92 ID="ARD_D8"
93 Type="PushPull"
94 Level="High"
95 Speed="Maximum"
96 Resistor="PullUp"
97 Mode="Input"
98 Alternate="0" />
99 <pin10
100 ID="ARD_D2"
101 Type="PushPull"
102 Level="High"
103 Speed="Maximum"
104 Resistor="PullUp"
105 Mode="Input"
106 Alternate="0" />
107 <pin11
108 ID=""
109 Type="PushPull"
110 Level="High"
111 Speed="Maximum"
112 Resistor="PullUp"
113 Mode="Input"
114 Alternate="0" />
115 <pin12
116 ID=""
117 Type="PushPull"
118 Level="High"
119 Speed="Maximum"
120 Resistor="PullUp"
121 Mode="Input"
122 Alternate="0" />
123 <pin13
124 ID="SWDIO"
125 Type="PushPull"
126 Level="High"
127 Speed="Maximum"
128 Resistor="PullUp"
129 Mode="Alternate"
130 Alternate="0" />
131 <pin14
132 ID="SWCLK"
133 Type="PushPull"
134 Level="High"
135 Speed="Maximum"
136 Resistor="PullDown"
137 Mode="Alternate"
138 Alternate="0" />
139 <pin15
140 ID=""
141 Type="PushPull"
142 Level="High"
143 Speed="Maximum"
144 Resistor="PullUp"
145 Mode="Input"
146 Alternate="0" />
147 </GPIOA>
148 <GPIOB>
149 <pin0
150 ID="ARD_A3 ACD1_IN8"
151 Type="PushPull"
152 Level="High"
153 Speed="Maximum"
154 Resistor="PullUp"
155 Mode="Input"
156 Alternate="0" />
157 <pin1
158 ID=""
159 Type="PushPull"
160 Level="High"
161 Speed="Maximum"
162 Resistor="PullUp"
163 Mode="Input"
164 Alternate="0" />
165 <pin2
166 ID=""
167 Type="PushPull"
168 Level="High"
169 Speed="Maximum"
170 Resistor="PullUp"
171 Mode="Input"
172 Alternate="0" />
173 <pin3
174 ID="SWO ARD_D3"
175 Type="PushPull"
176 Level="High"
177 Speed="Maximum"
178 Resistor="PullUp"
179 Mode="Alternate"
180 Alternate="0" />
181 <pin4
182 ID="ARD_D5"
183 Type="PushPull"
184 Level="High"
185 Speed="Maximum"
186 Resistor="PullUp"
187 Mode="Input"
188 Alternate="0" />
189 <pin5
190 ID="ARD_D4"
191 Type="PushPull"
192 Level="High"
193 Speed="Maximum"
194 Resistor="PullUp"
195 Mode="Input"
196 Alternate="0" />
197 <pin6
198 ID="ARD_D10"
199 Type="PushPull"
200 Level="High"
201 Speed="Maximum"
202 Resistor="PullUp"
203 Mode="Input"
204 Alternate="0" />
205 <pin7
206 ID=""
207 Type="PushPull"
208 Level="High"
209 Speed="Maximum"
210 Resistor="PullUp"
211 Mode="Input"
212 Alternate="0" />
213 <pin8
214 ID="ARD_D15"
215 Type="PushPull"
216 Level="High"
217 Speed="Maximum"
218 Resistor="PullUp"
219 Mode="Input"
220 Alternate="0" />
221 <pin9
222 ID="ARD_D14"
223 Type="PushPull"
224 Level="High"
225 Speed="Maximum"
226 Resistor="PullUp"
227 Mode="Input"
228 Alternate="0" />
229 <pin10
230 ID="ARD_D6"
231 Type="PushPull"
232 Level="High"
233 Speed="Maximum"
234 Resistor="PullUp"
235 Mode="Input"
236 Alternate="0" />
237 <pin11
238 ID=""
239 Type="PushPull"
240 Level="High"
241 Speed="Maximum"
242 Resistor="PullUp"
243 Mode="Input"
244 Alternate="0" />
245 <pin12
246 ID=""
247 Type="PushPull"
248 Level="High"
249 Speed="Maximum"
250 Resistor="PullUp"
251 Mode="Input"
252 Alternate="0" />
253 <pin13
254 ID=""
255 Type="PushPull"
256 Level="High"
257 Speed="Maximum"
258 Resistor="PullUp"
259 Mode="Input"
260 Alternate="0" />
261 <pin14
262 ID=""
263 Type="PushPull"
264 Level="High"
265 Speed="Maximum"
266 Resistor="PullUp"
267 Mode="Input"
268 Alternate="0" />
269 <pin15
270 ID=""
271 Type="PushPull"
272 Level="High"
273 Speed="Maximum"
274 Resistor="PullUp"
275 Mode="Input"
276 Alternate="0" />
277 </GPIOB>
278 <GPIOC>
279 <pin0
280 ID="ARD_A5 ACD1_IN10"
281 Type="PushPull"
282 Level="High"
283 Speed="Maximum"
284 Resistor="PullUp"
285 Mode="Input"
286 Alternate="0" />
287 <pin1
288 ID="ARD_A4 ACD1_IN11"
289 Type="PushPull"
290 Level="High"
291 Speed="Maximum"
292 Resistor="PullUp"
293 Mode="Input"
294 Alternate="0" />
295 <pin2
296 ID=""
297 Type="PushPull"
298 Level="High"
299 Speed="Maximum"
300 Resistor="PullUp"
301 Mode="Input"
302 Alternate="0" />
303 <pin3
304 ID=""
305 Type="PushPull"
306 Level="High"
307 Speed="Maximum"
308 Resistor="PullUp"
309 Mode="Input"
310 Alternate="0" />
311 <pin4
312 ID=""
313 Type="PushPull"
314 Level="High"
315 Speed="Maximum"
316 Resistor="PullUp"
317 Mode="Input"
318 Alternate="0" />
319 <pin5
320 ID=""
321 Type="PushPull"
322 Level="High"
323 Speed="Maximum"
324 Resistor="PullUp"
325 Mode="Input"
326 Alternate="0" />
327 <pin6
328 ID=""
329 Type="PushPull"
330 Level="High"
331 Speed="Maximum"
332 Resistor="PullUp"
333 Mode="Input"
334 Alternate="0" />
335 <pin7
336 ID="ARD_D9"
337 Type="PushPull"
338 Level="High"
339 Speed="Maximum"
340 Resistor="PullUp"
341 Mode="Input"
342 Alternate="0" />
343 <pin8
344 ID=""
345 Type="PushPull"
346 Level="High"
347 Speed="Maximum"
348 Resistor="PullUp"
349 Mode="Input"
350 Alternate="0" />
351 <pin9
352 ID=""
353 Type="PushPull"
354 Level="High"
355 Speed="Maximum"
356 Resistor="PullUp"
357 Mode="Input"
358 Alternate="0" />
359 <pin10
360 ID=""
361 Type="PushPull"
362 Level="High"
363 Speed="Maximum"
364 Resistor="PullUp"
365 Mode="Input"
366 Alternate="0" />
367 <pin11
368 ID=""
369 Type="PushPull"
370 Level="High"
371 Speed="Maximum"
372 Resistor="PullUp"
373 Mode="Input"
374 Alternate="0" />
375 <pin12
376 ID=""
377 Type="PushPull"
378 Level="High"
379 Speed="Maximum"
380 Resistor="PullUp"
381 Mode="Input"
382 Alternate="0" />
383 <pin13
384 ID="BUTTON"
385 Type="PushPull"
386 Level="High"
387 Speed="Maximum"
388 Resistor="Floating"
389 Mode="Input"
390 Alternate="0" />
391 <pin14
392 ID="OSC32_IN"
393 Type="PushPull"
394 Level="High"
395 Speed="Maximum"
396 Resistor="Floating"
397 Mode="Input"
398 Alternate="0" />
399 <pin15
400 ID="OSC32_OUT"
401 Type="PushPull"
402 Level="High"
403 Speed="Maximum"
404 Resistor="Floating"
405 Mode="Input"
406 Alternate="0" />
407 </GPIOC>
408 <GPIOD>
409 <pin0
410 ID=""
411 Type="PushPull"
412 Speed="Maximum"
413 Resistor="PullUp"
414 Level="High"
415 Mode="Input"
416 Alternate="0" />
417 <pin1
418 ID=""
419 Type="PushPull"
420 Speed="Maximum"
421 Resistor="PullUp"
422 Level="High"
423 Mode="Input"
424 Alternate="0" />
425 <pin2
426 ID=""
427 Type="PushPull"
428 Speed="Maximum"
429 Resistor="PullUp"
430 Level="High"
431 Mode="Input"
432 Alternate="0" />
433 <pin3
434 ID=""
435 Type="PushPull"
436 Speed="Maximum"
437 Resistor="PullUp"
438 Level="High"
439 Mode="Input"
440 Alternate="0" />
441 <pin4
442 ID=""
443 Type="PushPull"
444 Speed="Maximum"
445 Resistor="PullUp"
446 Level="High"
447 Mode="Input"
448 Alternate="0" />
449 <pin5
450 ID=""
451 Type="PushPull"
452 Speed="Maximum"
453 Resistor="PullUp"
454 Level="High"
455 Mode="Input"
456 Alternate="0" />
457 <pin6
458 ID=""
459 Type="PushPull"
460 Speed="Maximum"
461 Resistor="PullUp"
462 Level="High"
463 Mode="Input"
464 Alternate="0" />
465 <pin7
466 ID=""
467 Type="PushPull"
468 Speed="Maximum"
469 Resistor="PullUp"
470 Level="High"
471 Mode="Input"
472 Alternate="0" />
473 <pin8
474 ID=""
475 Type="PushPull"
476 Speed="Maximum"
477 Resistor="PullUp"
478 Level="High"
479 Mode="Input"
480 Alternate="0" />
481 <pin9
482 ID=""
483 Type="PushPull"
484 Speed="Maximum"
485 Resistor="PullUp"
486 Level="High"
487 Mode="Input"
488 Alternate="0" />
489 <pin10
490 ID=""
491 Type="PushPull"
492 Speed="Maximum"
493 Resistor="PullUp"
494 Level="High"
495 Mode="Input"
496 Alternate="0" />
497 <pin11
498 ID=""
499 Type="PushPull"
500 Speed="Maximum"
501 Resistor="PullUp"
502 Level="High"
503 Mode="Input"
504 Alternate="0" />
505 <pin12
506 ID=""
507 Type="PushPull"
508 Speed="Maximum"
509 Resistor="PullUp"
510 Level="High"
511 Mode="Input"
512 Alternate="0" />
513 <pin13
514 ID=""
515 Type="PushPull"
516 Speed="Maximum"
517 Resistor="PullUp"
518 Level="High"
519 Mode="Input"
520 Alternate="0" />
521 <pin14
522 ID=""
523 Type="PushPull"
524 Speed="Maximum"
525 Resistor="PullUp"
526 Level="High"
527 Mode="Input"
528 Alternate="0" />
529 <pin15
530 ID=""
531 Type="PushPull"
532 Speed="Maximum"
533 Resistor="PullUp"
534 Level="High"
535 Mode="Input"
536 Alternate="0" />
537 </GPIOD>
538 <GPIOE>
539 <pin0
540 ID=""
541 Type="PushPull"
542 Speed="Maximum"
543 Resistor="PullUp"
544 Level="High"
545 Mode="Input"
546 Alternate="0" />
547 <pin1
548 ID=""
549 Type="PushPull"
550 Speed="Maximum"
551 Resistor="PullUp"
552 Level="High"
553 Mode="Input"
554 Alternate="0" />
555 <pin2
556 ID=""
557 Type="PushPull"
558 Speed="Maximum"
559 Resistor="PullUp"
560 Level="High"
561 Mode="Input"
562 Alternate="0" />
563 <pin3
564 ID=""
565 Type="PushPull"
566 Speed="Maximum"
567 Resistor="PullUp"
568 Level="High"
569 Mode="Input"
570 Alternate="0" />
571 <pin4
572 ID=""
573 Type="PushPull"
574 Speed="Maximum"
575 Resistor="PullUp"
576 Level="High"
577 Mode="Input"
578 Alternate="0" />
579 <pin5
580 ID=""
581 Type="PushPull"
582 Speed="Maximum"
583 Resistor="PullUp"
584 Level="High"
585 Mode="Input"
586 Alternate="0" />
587 <pin6
588 ID=""
589 Type="PushPull"
590 Speed="Maximum"
591 Resistor="PullUp"
592 Level="High"
593 Mode="Input"
594 Alternate="0" />
595 <pin7
596 ID=""
597 Type="PushPull"
598 Speed="Maximum"
599 Resistor="PullUp"
600 Level="High"
601 Mode="Input"
602 Alternate="0" />
603 <pin8
604 ID=""
605 Type="PushPull"
606 Speed="Maximum"
607 Resistor="PullUp"
608 Level="High"
609 Mode="Input"
610 Alternate="0" />
611 <pin9
612 ID=""
613 Type="PushPull"
614 Speed="Maximum"
615 Resistor="PullUp"
616 Level="High"
617 Mode="Input"
618 Alternate="0" />
619 <pin10
620 ID=""
621 Type="PushPull"
622 Speed="Maximum"
623 Resistor="PullUp"
624 Level="High"
625 Mode="Input"
626 Alternate="0" />
627 <pin11
628 ID=""
629 Type="PushPull"
630 Speed="Maximum"
631 Resistor="PullUp"
632 Level="High"
633 Mode="Input"
634 Alternate="0" />
635 <pin12
636 ID=""
637 Type="PushPull"
638 Speed="Maximum"
639 Resistor="PullUp"
640 Level="High"
641 Mode="Input"
642 Alternate="0" />
643 <pin13
644 ID=""
645 Type="PushPull"
646 Speed="Maximum"
647 Resistor="PullUp"
648 Level="High"
649 Mode="Input"
650 Alternate="0" />
651 <pin14
652 ID=""
653 Type="PushPull"
654 Speed="Maximum"
655 Resistor="PullUp"
656 Level="High"
657 Mode="Input"
658 Alternate="0" />
659 <pin15
660 ID=""
661 Type="PushPull"
662 Speed="Maximum"
663 Resistor="PullUp"
664 Level="High"
665 Mode="Input"
666 Alternate="0" />
667 </GPIOE>
668 <GPIOH>
669 <pin0
670 ID="OSC_IN"
671 Type="PushPull"
672 Speed="Maximum"
673 Resistor="Floating"
674 Level="High"
675 Mode="Input"
676 Alternate="0" />
677 <pin1
678 ID="OSC_OUT"
679 Type="PushPull"
680 Speed="Maximum"
681 Resistor="Floating"
682 Level="High"
683 Mode="Input"
684 Alternate="0" />
685 <pin2
686 ID=""
687 Type="PushPull"
688 Speed="Maximum"
689 Resistor="PullUp"
690 Level="High"
691 Mode="Input"
692 Alternate="0" />
693 <pin3
694 ID=""
695 Type="PushPull"
696 Speed="Maximum"
697 Resistor="PullUp"
698 Level="High"
699 Mode="Input"
700 Alternate="0" />
701 <pin4
702 ID=""
703 Type="PushPull"
704 Speed="Maximum"
705 Resistor="PullUp"
706 Level="High"
707 Mode="Input"
708 Alternate="0" />
709 <pin5
710 ID=""
711 Type="PushPull"
712 Speed="Maximum"
713 Resistor="PullUp"
714 Level="High"
715 Mode="Input"
716 Alternate="0" />
717 <pin6
718 ID=""
719 Type="PushPull"
720 Speed="Maximum"
721 Resistor="PullUp"
722 Level="High"
723 Mode="Input"
724 Alternate="0" />
725 <pin7
726 ID=""
727 Type="PushPull"
728 Speed="Maximum"
729 Resistor="PullUp"
730 Level="High"
731 Mode="Input"
732 Alternate="0" />
733 <pin8
734 ID=""
735 Type="PushPull"
736 Speed="Maximum"
737 Resistor="PullUp"
738 Level="High"
739 Mode="Input"
740 Alternate="0" />
741 <pin9
742 ID=""
743 Type="PushPull"
744 Speed="Maximum"
745 Resistor="PullUp"
746 Level="High"
747 Mode="Input"
748 Alternate="0" />
749 <pin10
750 ID=""
751 Type="PushPull"
752 Speed="Maximum"
753 Resistor="PullUp"
754 Level="High"
755 Mode="Input"
756 Alternate="0" />
757 <pin11
758 ID=""
759 Type="PushPull"
760 Speed="Maximum"
761 Resistor="PullUp"
762 Level="High"
763 Mode="Input"
764 Alternate="0" />
765 <pin12
766 ID=""
767 Type="PushPull"
768 Speed="Maximum"
769 Resistor="PullUp"
770 Level="High"
771 Mode="Input"
772 Alternate="0" />
773 <pin13
774 ID=""
775 Type="PushPull"
776 Speed="Maximum"
777 Resistor="PullUp"
778 Level="High"
779 Mode="Input"
780 Alternate="0" />
781 <pin14
782 ID=""
783 Type="PushPull"
784 Speed="Maximum"
785 Resistor="PullUp"
786 Level="High"
787 Mode="Input"
788 Alternate="0" />
789 <pin15
790 ID=""
791 Type="PushPull"
792 Speed="Maximum"
793 Resistor="PullUp"
794 Level="High"
795 Mode="Input"
796 Alternate="0" />
797 </GPIOH>
798 </ports>
799</board>
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.fmpp b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.fmpp
new file mode 100644
index 000000000..b3ba947fb
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_L073RZ/cfg/board.fmpp
@@ -0,0 +1,15 @@
1sourceRoot: ../../../../../tools/ftl/processors/boards/stm32l0xx/templates
2outputRoot: ..
3dataRoot: .
4
5freemarkerLinks: {
6 lib: ../../../../../tools/ftl/libs
7}
8
9data : {
10 doc1:xml (
11 board.chcfg
12 {
13 }
14 )
15}