blob: 84289f32a92ec38ce4f603fbdf5e44a7791a35d7 [file] [log] [blame]
/*
* Copyright (c) 2024 Michael Hope <michaelh@juju.nz>
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <wch/ch32v0/ch32v003f4p.dtsi>
#include "ch32v003evt-pinctrl.dtsi"
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/i2c/i2c.h>
/ {
model = "ch32v003evt";
compatible = "wch,ch32v003";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &usart1;
zephyr,shell-uart = &usart1;
};
leds {
compatible = "gpio-leds";
/*
* Please connect the unconnected LED on the WCH CH32V003EVT
* board to a suitable GPIO pin (like PD4) and then change
* this status to "okay".
*/
status = "disabled";
red_led: led0 {
gpios = <&gpiod 4 GPIO_ACTIVE_HIGH>;
};
};
pwmleds: pwmleds {
compatible = "pwm-leds";
status = "disabled";
red_pwm: red_pwm0 {
pwms = <&pwm2 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
label = "Red LED";
};
};
aliases {
led0 = &red_led;
pwm-led0 = &red_pwm;
};
};
&clk_hse {
clock-frequency = <DT_FREQ_M(24)>;
status = "okay";
};
&pll {
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
};
&exti {
status = "okay";
};
&gpioc {
status = "okay";
};
&gpiod {
status = "okay";
};
&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c1_default>;
pinctrl-names = "default";
};
&usart1 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&usart1_default>;
pinctrl-names = "default";
};