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>
This commit is contained in:
parent
502e622644
commit
5e8008c0ab
3 changed files with 23 additions and 0 deletions
|
@ -18,4 +18,12 @@
|
||||||
bias-pull-up;
|
bias-pull-up;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
i2c1_default: i2c1_default {
|
||||||
|
group1 {
|
||||||
|
pinmux = <I2C1_SDA_PC1_0>, <I2C1_SCL_PC2_0>;
|
||||||
|
output-high;
|
||||||
|
drive-open-drain;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#include <wch/ch32v0/ch32v003f4p.dtsi>
|
#include <wch/ch32v0/ch32v003f4p.dtsi>
|
||||||
#include "ch32v003evt-pinctrl.dtsi"
|
#include "ch32v003evt-pinctrl.dtsi"
|
||||||
|
|
||||||
|
#include <zephyr/dt-bindings/gpio/gpio.h>
|
||||||
|
#include <zephyr/dt-bindings/i2c/i2c.h>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
model = "ch32v003evt";
|
model = "ch32v003evt";
|
||||||
compatible = "wch,ch32v003";
|
compatible = "wch,ch32v003";
|
||||||
|
@ -53,10 +56,21 @@
|
||||||
clocks = <&pll>;
|
clocks = <&pll>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&gpioc {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
&gpiod {
|
&gpiod {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&i2c1 {
|
||||||
|
status = "okay";
|
||||||
|
clock-frequency = <I2C_BITRATE_STANDARD>;
|
||||||
|
pinctrl-0 = <&i2c1_default>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
};
|
||||||
|
|
||||||
&usart1 {
|
&usart1 {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
|
|
@ -9,3 +9,4 @@ ram: 2
|
||||||
flash: 16
|
flash: 16
|
||||||
supported:
|
supported:
|
||||||
- gpio
|
- gpio
|
||||||
|
- i2c
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue