From 07af3b903d7631b0bbffaf6020fbe7507549968e Mon Sep 17 00:00:00 2001 From: cepetr Date: Wed, 20 Nov 2024 16:24:20 +0100 Subject: [PATCH] TEMP - add extra i2c bus for npm1300 test (disc2) --- core/embed/models/D002/boards/stm32u5g9j-dk.h | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/core/embed/models/D002/boards/stm32u5g9j-dk.h b/core/embed/models/D002/boards/stm32u5g9j-dk.h index 3791696691..26587d162d 100644 --- a/core/embed/models/D002/boards/stm32u5g9j-dk.h +++ b/core/embed/models/D002/boards/stm32u5g9j-dk.h @@ -5,7 +5,7 @@ #define DISPLAY_COLOR_MODE DMA2D_OUTPUT_ARGB8888 -#define I2C_COUNT 1 +#define I2C_COUNT 2 #define I2C_INSTANCE_0 I2C5 #define I2C_INSTANCE_0_CLK_EN __HAL_RCC_I2C5_CLK_ENABLE #define I2C_INSTANCE_0_CLK_DIS __HAL_RCC_I2C5_CLK_DISABLE @@ -24,6 +24,26 @@ #define I2C_INSTANCE_0_ER_IRQn I2C5_ER_IRQn #define I2C_INSTANCE_0_GUARD_TIME 0 +#define I2C_INSTANCE_1 I2C2 +#define I2C_INSTANCE_1_CLK_EN __HAL_RCC_I2C2_CLK_ENABLE +#define I2C_INSTANCE_1_CLK_DIS __HAL_RCC_I2C2_CLK_DISABLE +#define I2C_INSTANCE_1_PIN_AF GPIO_AF4_I2C2 +#define I2C_INSTANCE_1_SDA_PORT GPIOF +#define I2C_INSTANCE_1_SDA_PIN GPIO_PIN_0 +#define I2C_INSTANCE_1_SDA_CLK_EN __HAL_RCC_GPIOF_CLK_ENABLE +#define I2C_INSTANCE_1_SCL_PORT GPIOF +#define I2C_INSTANCE_1_SCL_PIN GPIO_PIN_1 +#define I2C_INSTANCE_1_SCL_CLK_EN __HAL_RCC_GPIOF_CLK_ENABLE +#define I2C_INSTANCE_1_RESET_REG &RCC->APB1RSTR1 +#define I2C_INSTANCE_1_RESET_BIT RCC_APB1RSTR1_I2C2RST +#define I2C_INSTANCE_1_EV_IRQHandler I2C2_EV_IRQHandler +#define I2C_INSTANCE_1_ER_IRQHandler I2C2_ER_IRQHandler +#define I2C_INSTANCE_1_EV_IRQn I2C2_EV_IRQn +#define I2C_INSTANCE_1_ER_IRQn I2C2_ER_IRQn +#define I2C_INSTANCE_1_GUARD_TIME 0 + #define TOUCH_I2C_INSTANCE 0 +#define NPM1300_I2C_INSTANCE 1 +#define STWLC38_I2C_INSTANCE 1 #endif // STM32U5A9J_DK_H_