Skip to content

Commit 5e8008c

Browse files
andrei-edward-popakartben
authored andcommitted
boards: wch: ch32v003evt: enable i2c and define i2c pins
enabled i2c for ch32v003evt added default i2c pins for ch32v003evt added i2c as supported Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
1 parent 502e622 commit 5e8008c

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

boards/wch/ch32v003evt/ch32v003evt-pinctrl.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@
1818
bias-pull-up;
1919
};
2020
};
21+
22+
i2c1_default: i2c1_default {
23+
group1 {
24+
pinmux = <I2C1_SDA_PC1_0>, <I2C1_SCL_PC2_0>;
25+
output-high;
26+
drive-open-drain;
27+
};
28+
};
2129
};

boards/wch/ch32v003evt/ch32v003evt.dts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include <wch/ch32v0/ch32v003f4p.dtsi>
99
#include "ch32v003evt-pinctrl.dtsi"
1010

11+
#include <zephyr/dt-bindings/gpio/gpio.h>
12+
#include <zephyr/dt-bindings/i2c/i2c.h>
13+
1114
/ {
1215
model = "ch32v003evt";
1316
compatible = "wch,ch32v003";
@@ -53,10 +56,21 @@
5356
clocks = <&pll>;
5457
};
5558

59+
&gpioc {
60+
status = "okay";
61+
};
62+
5663
&gpiod {
5764
status = "okay";
5865
};
5966

67+
&i2c1 {
68+
status = "okay";
69+
clock-frequency = <I2C_BITRATE_STANDARD>;
70+
pinctrl-0 = <&i2c1_default>;
71+
pinctrl-names = "default";
72+
};
73+
6074
&usart1 {
6175
status = "okay";
6276
current-speed = <115200>;

boards/wch/ch32v003evt/ch32v003evt.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ ram: 2
99
flash: 16
1010
supported:
1111
- gpio
12+
- i2c

0 commit comments

Comments
 (0)