1/* 2 * Copyright (c) 2022 YuLong Yao <feilongphone@gmail.com> 3 * SPDX-License-Identifier: Apache-2.0 4 */ 5 6/dts-v1/; 7 8#include <gigadevice/gd32vf103Xb.dtsi> 9#include "gd32vf103c_starter-pinctrl.dtsi" 10#include <zephyr/dt-bindings/input/input-event-codes.h> 11 12/ { 13 model = "GigaDevice GD32VF103C-STARTER"; 14 compatible = "gd,gd32vf103c-starter"; 15 16 chosen { 17 zephyr,sram = &sram0; 18 zephyr,flash = &flash0; 19 zephyr,console = &usart0; 20 zephyr,shell-uart = &usart0; 21 zephyr,flash-controller = &fmc; 22 }; 23 24 leds { 25 compatible = "gpio-leds"; 26 led1: led1 { 27 gpios = <&gpioa 7 GPIO_ACTIVE_HIGH>; 28 label = "LED1"; 29 }; 30 }; 31 32 gpio_keys { 33 compatible = "gpio-keys"; 34 key_a: key_a { 35 label = "KEY_A"; 36 gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; 37 zephyr,code = <INPUT_KEY_A>; 38 }; 39 }; 40 41 pwmleds { 42 compatible = "pwm-leds"; 43 44 /* NOTE: pwm_led and led1 are share same pin (PA7). */ 45 /* When CONFIG_PWM=y it can only be controlled using the PWM API. */ 46 pwm_led: pwm_led { 47 pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; 48 }; 49 }; 50 51 aliases { 52 led0 = &led1; 53 sw0 = &key_a; 54 pwm-led0 = &pwm_led; 55 watchdog0 = &fwdgt; 56 }; 57}; 58 59&gpioa { 60 status = "okay"; 61}; 62 63&gpiob { 64 status = "okay"; 65}; 66 67&gpioc { 68 status = "okay"; 69}; 70 71&gpioe { 72 status = "okay"; 73}; 74 75&usart0 { 76 status = "okay"; 77 current-speed = <115200>; 78 pinctrl-0 = <&usart0_default>; 79 pinctrl-names = "default"; 80}; 81 82&timer2 { 83 status = "okay"; 84 prescaler = <128>; 85 86 pwm2: pwm { 87 status = "okay"; 88 pinctrl-0 = <&pwm2_default>; 89 pinctrl-names = "default"; 90 }; 91}; 92 93&fwdgt { 94 status = "okay"; 95}; 96