Skip to content

Commit 04a0aba

Browse files
committed
boards/common/nucleo144: fix Arduino A0...A5 config for L5, U5 boards
Nucleo144 boards for L5 and U5 have a completely different analog pin configuration. It's a very small change, but due to style changes it seems like a big change. In fact, the configuration has been changed just by adding an #ifdef ... #else ... #end and the six analog pins for L5 and U5 boards.
1 parent 8f903b3 commit 04a0aba

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

boards/common/nucleo144/include/arduino_iomap.h

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,31 @@ extern "C" {
5959
#define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 9)
6060
#define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 8)
6161

62-
#define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3)
63-
#define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 0)
64-
#define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3)
65-
#if defined(CPU_MODEL_STM32F413ZH) || defined(CPU_MODEL_STM32F412ZG) || \
66-
defined(CPU_MODEL_STM32L496ZG)
67-
# define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 1)
68-
# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 4)
69-
# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 5)
70-
#elif defined(CPU_MODEL_STM32F303ZE)
71-
# define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 11)
72-
# define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 12)
73-
# define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 13)
62+
#if defined(CPU_FAM_STM32L5) || defined(CPU_FAM_STM32U5)
63+
# define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3)
64+
# define ARDUINO_PIN_17 GPIO_PIN(PORT_A, 2)
65+
# define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3)
66+
# define ARDUINO_PIN_19 GPIO_PIN(PORT_B, 0)
67+
# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 1)
68+
# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 0)
7469
#else
75-
# define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 3)
76-
# define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5)
77-
# define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 10)
70+
# define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3)
71+
# define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 0)
72+
# define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3)
73+
# if defined(CPU_MODEL_STM32F413ZH) || defined(CPU_MODEL_STM32F412ZG) || \
74+
defined(CPU_FAM_STM32L4)
75+
# define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 1)
76+
# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 4)
77+
# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 5)
78+
# elif defined(CPU_MODEL_STM32F303ZE)
79+
# define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 11)
80+
# define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 12)
81+
# define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 13)
82+
# else
83+
# define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 3)
84+
# define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5)
85+
# define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 10)
86+
# endif
7887
#endif
7988

8089
#define ARDUINO_PIN_LAST 21

0 commit comments

Comments
 (0)