1/*
2 * Copyright 2024 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8
9#include <nxp/nxp_mcxc242.dtsi>
10#include "frdm_mcxc242-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "NXP FRDM-MCXC242 board";
15	compatible = "nxp,mcxc242", "nxp,mcx";
16
17	aliases {
18		led0 = &red_led;
19		led1 = &green_led;
20		led2 = &blue_led;
21		pwm-led0 = &red_pwm_led;
22		pwm-led1 = &green_pwm_led;
23		pwm-led2 = &blue_pwm_led;
24		red-pwm-led = &red_pwm_led;
25		green-pwm-led = &green_pwm_led;
26		blue-pwm-led = &blue_pwm_led;
27		sw0 = &user_button_2;
28		sw1 = &user_button_3;
29		accel0 = &fxls8974;
30		pwm-0 = &tpm1;
31	};
32
33	chosen {
34		zephyr,sram = &sram0;
35		zephyr,flash = &flash0;
36		zephyr,console = &lpuart0;
37		zephyr,shell-uart = &lpuart0;
38	};
39
40	leds {
41		compatible = "gpio-leds";
42		red_led: led_0 {
43			gpios = <&gpiob 18 GPIO_ACTIVE_LOW>;
44			label = "Red LED";
45		};
46		green_led: led_1 {
47			gpios = <&gpiob 19 GPIO_ACTIVE_LOW>;
48			label = "Green LED";
49		};
50		blue_led: led_2 {
51			gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
52			label = "Blue LED";
53		};
54	};
55
56	pwmleds {
57		compatible = "pwm-leds";
58		status = "disabled";
59		red_pwm_led: pwm_led_0 {
60			pwms = <&tpm2 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
61			label = "PWM Red LED";
62		};
63		green_pwm_led: pwm_led_1 {
64			pwms = <&tpm2 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
65			label = "PWM Green LED";
66		};
67		blue_pwm_led: pwm_led_2 {
68			pwms = <&tpm1 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
69			label = "PWM Blue LED";
70		};
71	};
72
73	gpio_keys {
74		compatible = "gpio-keys";
75		user_button_2: button_2 {
76			label = "User SW2";
77			gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
78			zephyr,code = <INPUT_KEY_0>;
79		};
80		user_button_3: button_3 {
81			label = "User SW3";
82			gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
83			zephyr,code = <INPUT_KEY_1>;
84		};
85	};
86};
87
88&sim {
89	pllfll-select = <KINETIS_SIM_PLLFLLSEL_MCGPLLCLK>;
90	er32k-select = <KINETIS_SIM_ER32KSEL_OSC32KCLK>;
91};
92
93&cpu0 {
94	clock-frequency = <48000000>;
95};
96
97&osc {
98	clock-frequency = <32768>;
99	mode = "low-power";
100};
101
102&gpioa {
103	status = "okay";
104};
105
106&gpiob {
107	status = "okay";
108};
109
110&gpioc {
111	status = "okay";
112};
113
114&gpioe {
115	status = "okay";
116};
117
118&lpuart0 {
119	status = "okay";
120	current-speed = <115200>;
121	pinctrl-0 = <&pinmux_lpuart0>;
122	pinctrl-names = "default";
123};
124
125&uart2 {
126	status = "disabled";
127	current-speed = <115200>;
128	pinctrl-0 = <&pinmux_uart2>;
129	pinctrl-names = "default";
130};
131
132i2c1: &i2c1 {
133	status = "okay";
134	pinctrl-0 = <&pinmux_i2c1>;
135	pinctrl-names = "default";
136
137	fxls8974: fxls8974@18 {
138		status = "okay";
139		compatible = "nxp,fxls8974";
140		reg = <0x18>;
141		int1-gpios = <&gpioc 2 GPIO_ACTIVE_LOW>;
142		int2-gpios = <&gpioc 3 GPIO_ACTIVE_LOW>;
143	};
144};
145
146zephyr_udc0: &usb {
147	status = "okay";
148	num-bidir-endpoints = <8>;
149};
150
151&tpm1 {
152	status = "okay";
153	pinctrl-0 = <&pinmux_tpm1>;
154	pinctrl-names = "default";
155};
156
157&tpm2 {
158	status = "okay";
159	pinctrl-0 = <&pinmux_tpm2>;
160	pinctrl-names = "default";
161};
162
163&adc0 {
164	status = "okay";
165	pinctrl-0 = <&pinmux_adc0>;
166	pinctrl-names = "default";
167};
168
169&lptmr0 {
170	status = "okay";
171};
172
173&rtc {
174	status = "okay";
175};
176
177&pit0 {
178	status = "okay";
179};
180
181&pit0_channel0 {
182	status = "okay";
183};
184
185&pit0_channel1 {
186	status = "okay";
187};
188