1/*
2 * Copyright (c) 2022, Teslabs Engineering S.L.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7
8#include <arm/gd/gd32e50x/gd32e507xe.dtsi>
9#include "gd32e507z_eval-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "GigaDevice GD32E507Z-EVAL";
14	compatible = "gd,gd32e507z-eval";
15
16	chosen {
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19		zephyr,console = &usart0;
20		zephyr,shell-uart = &usart0;
21	};
22
23	leds {
24		compatible = "gpio-leds";
25		led1: led1 {
26			gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
27		};
28		led2: led2 {
29			gpios = <&gpiog 11 GPIO_ACTIVE_HIGH>;
30		};
31		led3: led3 {
32			gpios = <&gpiog 12 GPIO_ACTIVE_HIGH>;
33		};
34		led4: led4 {
35			gpios = <&gpiog 13 GPIO_ACTIVE_HIGH>;
36		};
37	};
38
39	gpio_keys {
40		compatible = "gpio-keys";
41		key_a: key_a {
42			label = "KEY_A";
43			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
44			zephyr,code = <INPUT_KEY_A>;
45		};
46		key_b: key_b {
47			label = "KEY_B";
48			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
49			zephyr,code = <INPUT_KEY_B>;
50		};
51		key_c: key_c {
52			label = "KEY_C";
53			gpios = <&gpiof 13 GPIO_ACTIVE_LOW>;
54			zephyr,code = <INPUT_KEY_C>;
55		};
56		key_d: key_d {
57			label = "KEY_D";
58			gpios = <&gpiof 14 GPIO_ACTIVE_LOW>;
59			zephyr,code = <INPUT_KEY_D>;
60		};
61		key_cet: key_cet {
62			label = "KEY_CET";
63			gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
64			zephyr,code = <INPUT_KEY_0>;
65		};
66	};
67
68	pwmleds {
69		compatible = "pwm-leds";
70
71		/* NOTE: bridge TIMER0_CH0 (PA8) and LED1 (PG10)*/
72		pwm_led: pwm_led {
73			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
74		};
75	};
76
77	aliases {
78		led0 = &led1;
79		sw0 = &key_a;
80		pwm-led0 = &pwm_led;
81	};
82};
83
84&gpioa {
85	status = "okay";
86};
87
88&gpioc {
89	status = "okay";
90};
91
92&gpiof {
93	status = "okay";
94};
95
96&gpiog {
97	status = "okay";
98};
99
100&usart0 {
101	status = "okay";
102	current-speed = <115200>;
103	pinctrl-0 = <&usart0_default>;
104	pinctrl-names = "default";
105};
106
107&timer0 {
108	status = "okay";
109	prescaler = <256>;
110
111	pwm0: pwm {
112		status = "okay";
113		pinctrl-0 = <&pwm0_default>;
114		pinctrl-names = "default";
115	};
116};
117