From f0bc20c815e99fa9436f0ff739484b4cc7026cbd Mon Sep 17 00:00:00 2001 From: "Daniel P. Carvalho" Date: Thu, 21 Sep 2023 10:53:28 -0300 Subject: [PATCH] Fix I2C1 pinout. --- boards/arm/stm32l4/nucleo-l432kc/include/board.h | 8 ++++---- boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/boards/arm/stm32l4/nucleo-l432kc/include/board.h b/boards/arm/stm32l4/nucleo-l432kc/include/board.h index d8ed16e774c..5872e806802 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/include/board.h +++ b/boards/arm/stm32l4/nucleo-l432kc/include/board.h @@ -126,10 +126,10 @@ * but are normally-high GPIOs. */ -#define GPIO_I2C1_D4 \ - (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN7) -#define GPIO_I2C1_D5 \ - (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN6) +#define GPIO_I2C1_A4 \ + (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTA | GPIO_PIN5) +#define GPIO_I2C1_A5 \ + (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTA | GPIO_PIN6) #define GPIO_I2C1_SCL \ (GPIO_I2C1_SCL_1 | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #define GPIO_I2C1_SDA \ diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c index ef95b4ca880..924fbdb715b 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c @@ -80,10 +80,10 @@ int stm32_ina226initialize(const char *devpath) sninfo("Initializing INA226\n"); - /* Configure D4(PA5) and D5(PA6) as input floating */ + /* Configure A4(PA5) and A5(PA6) as input floating */ - stm32l4_configgpio(GPIO_I2C1_D4); - stm32l4_configgpio(GPIO_I2C1_D5); + stm32l4_configgpio(GPIO_I2C1_A4); + stm32l4_configgpio(GPIO_I2C1_A5); /* Get an instance of the I2C1 interface */