1/*
2 * Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com>
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#include <zephyr/dt-bindings/input/input-event-codes.h>
7
8/ {
9	chosen {
10		zephyr,display = &ssd1306_128x64;
11		zephyr,rtc = &pfc8563_rtc;
12	};
13
14	buttons {
15		compatible = "gpio-keys";
16		xiao_button0: button_0 {
17			gpios = <&xiao_d 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
18			label = "SW0";
19			zephyr,code = <INPUT_KEY_0>;
20		};
21	};
22
23	aliases {
24		sw0 = &xiao_button0;
25		rtc = &pfc8563_rtc;
26	};
27};
28
29&xiao_i2c {
30	status = "okay";
31
32	ssd1306_128x64: ssd1306@3c {
33		compatible = "solomon,ssd1306fb";
34		reg = <0x3c>;
35		width = <128>;
36		height = <64>;
37		segment-offset = <0>;
38		page-offset = <0>;
39		display-offset = <0>;
40		multiplex-ratio = <63>;
41		segment-remap;
42		com-invdir;
43		prechargep = <0x22>;
44	};
45
46	pfc8563_rtc: pfc8563@51 {
47		compatible = "nxp,pcf8563";
48		reg = <0x51>;
49		status = "okay";
50	};
51};
52
53&xiao_spi {
54	status = "okay";
55	cs-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>;
56
57	sdhc0: sdhc@0 {
58		compatible = "zephyr,sdhc-spi-slot";
59		reg = <0>;
60		status = "okay";
61		mmc {
62			compatible = "zephyr,sdmmc-disk";
63			disk-name = "SD";
64			status = "okay";
65		};
66		spi-max-frequency = <24000000>;
67	};
68};
69