Skip to content

Commit bcdce1b

Browse files
gmarullMaureenHelm
authored andcommitted
boards: arm: nucleo_h743zi: enable I2C support
Enable I2C support, including for the Arduino R3 connector. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 39b1f6c commit bcdce1b

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

boards/arm/nucleo_h743zi/Kconfig.defconfig

+4
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ config UART_3
1212
default y
1313
depends on UART_CONSOLE
1414

15+
config I2C_1
16+
default y
17+
depends on I2C
18+
1519
endif # BOARD_NUCLEO_H743ZI

boards/arm/nucleo_h743zi/arduino_r3_connector.dtsi

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@
3535
<21 0 &gpiob 8 0>; /* D15 */
3636
};
3737
};
38+
39+
arduino_i2c: &i2c1 {};

boards/arm/nucleo_h743zi/doc/index.rst

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ features:
107107
+-----------+------------+-------------------------------------+
108108
| RTC | on-chip | counter |
109109
+-----------+------------+-------------------------------------+
110+
| I2C | on-chip | i2c |
111+
+-----------+------------+-------------------------------------+
110112

111113
Other hardware features are not yet supported on this Zephyr port.
112114

@@ -126,6 +128,7 @@ and a ST morpho connector. Board is configured as follows:
126128
- LD1 : PB0
127129
- LD2 : PB7
128130
- LD3 : PB14
131+
- I2C : PB8, PB9
129132

130133
System Clock
131134
------------

boards/arm/nucleo_h743zi/nucleo_h743zi.dts

+5
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,8 @@
6060
&rtc {
6161
status = "okay";
6262
};
63+
64+
&i2c1 {
65+
status = "okay";
66+
clock-frequency = <I2C_BITRATE_FAST>;
67+
};

boards/arm/nucleo_h743zi/nucleo_h743zi.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ram: 512
1010
flash: 2048
1111
supported:
1212
- arduino_gpio
13+
- arduino_i2c
1314
- uart
1415
- gpio
1516
- counter
17+
- i2c

boards/arm/nucleo_h743zi/pinmux.c

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ static const struct pin_config pinconf[] = {
1818
{ STM32_PIN_PD8, STM32H7_PINMUX_FUNC_PD8_USART3_TX },
1919
{ STM32_PIN_PD9, STM32H7_PINMUX_FUNC_PD9_USART3_RX },
2020
#endif /* CONFIG_UART_3 */
21+
#ifdef CONFIG_I2C_1
22+
{ STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL },
23+
{ STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA },
24+
#endif /* CONFIG_I2C_1 */
2125
};
2226

2327
static int pinmux_stm32_init(struct device *port)

0 commit comments

Comments
 (0)