blob: 32b63554b28d8bc1662dc7b9734f4ae28670b8f2 [file] [log] [blame]
/*
* Copyright (c) 2023 Joel Guittet
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <atmel/samd5xx19.dtsi>
#include "wio_terminal-pinctrl.dtsi"
#include "grove_connectors.dtsi"
#include "raspberrypi_40pins_connector.dtsi"
#include <zephyr/dt-bindings/display/ili9xxx.h>
/ {
model = "Wio Terminal";
compatible = "seeed,wio-terminal";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &wio_terminal_console;
zephyr,shell-uart = &wio_terminal_console;
zephyr,code-partition = &code_partition;
zephyr,display = &ili9341;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
sw0 = &user_button_0;
sw1 = &user_button_1;
sw2 = &user_button_2;
i2c0 = &sercom4;
i2c1 = &sercom3;
spi0 = &sercom5;
uart0 = &sercom2;
accel0 = &lis3dh;
sdhc0 = &sdhc0;
};
/* LEDs */
leds {
compatible = "gpio-leds";
led0: led_0 {
label = "LED";
gpios = <&porta 15 GPIO_ACTIVE_HIGH>;
};
};
/* Buttons */
gpio_keys {
compatible = "gpio-keys";
user_button_0: button_0 {
label = "User Button 0";
gpios = <&portc 26 GPIO_ACTIVE_LOW>;
};
user_button_1: button_1 {
label = "User Button 1";
gpios = <&portc 27 GPIO_ACTIVE_LOW>;
};
user_button_2: button_2 {
label = "User Button 2";
gpios = <&portc 28 GPIO_ACTIVE_LOW>;
};
joy_sel: joystick_selection {
label = "joystick selection";
gpios = <&portd 10 GPIO_ACTIVE_LOW>;
};
joy_down: joystick_down {
label = "joystick down";
gpios = <&portd 8 GPIO_ACTIVE_LOW>;
};
joy_up: joystick_up {
label = "joystick up";
gpios = <&portd 20 GPIO_ACTIVE_LOW>;
};
joy_left: joystick_left {
label = "joystick left";
gpios = <&portd 12 GPIO_ACTIVE_LOW>;
};
joy_right: joystick_right {
label = "joystick right";
gpios = <&portd 9 GPIO_ACTIVE_LOW>;
};
};
/* Regulators */
lcd_backlight_en {
compatible = "regulator-fixed";
regulator-name = "lcd_backlight_enable";
enable-gpios = <&portc 5 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
};
rpi_power_3v3_en {
compatible = "regulator-fixed";
regulator-name = "rpi_power_3v3_enable";
enable-gpios = <&portc 15 GPIO_ACTIVE_LOW>;
regulator-boot-on;
};
rpi_power_5v_en {
compatible = "regulator-fixed";
regulator-name = "rpi_power_5v_enable";
enable-gpios = <&portc 14 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
};
usb_power_5v_en {
compatible = "regulator-fixed";
regulator-name = "usb_power_5v_en";
enable-gpios = <&porta 27 GPIO_ACTIVE_LOW>;
};
};
&cpu0 {
clock-frequency = <120000000>;
};
&dmac {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "uf2";
reg = <0x00000000 DT_SIZE_K(16)>;
read-only;
};
code_partition: partition@4000 {
label = "code";
reg = <0x4000 DT_SIZE_K(512-16)>;
read-only;
};
};
};
/* RTL8720D (Wifi/BLE) */
&sercom0 {
status = "okay";
compatible = "atmel,sam0-spi";
#address-cells = <1>;
#size-cells = <0>;
dipo = <2>;
dopo = <0>;
pinctrl-0 = <&sercom0_spi_default>;
pinctrl-names = "default";
cs-gpios = <&portc 25 GPIO_ACTIVE_LOW>;
};
/* RTL8720D (Wifi/BLE) */
&sercom1 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;
pinctrl-0 = <&sercom1_uart_default>;
pinctrl-names = "default";
};
/* UART, Raspberry Pi connector */
&sercom2 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;
pinctrl-0 = <&sercom2_uart_default>;
pinctrl-names = "default";
};
/* I2C1, Raspberry Pi and Groove connectors */
&sercom3 {
status = "okay";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom3_i2c_default>;
pinctrl-names = "default";
};
/* I2C0, LIS3DH, ATECC608, Raspberry Pi connector */
&sercom4 {
status = "okay";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom4_i2c_default>;
pinctrl-names = "default";
/* LIS3DH */
lis3dh: lis3dh@18 {
compatible = "st,lis3dh", "st,lis2dh";
status = "okay";
reg = <0x18>;
irq-gpios = <&portc 21 GPIO_ACTIVE_HIGH>;
};
/* ATECC608A */
atecc608a@6a {
compatible = "atmel,atecc608";
reg = <0x6a>;
};
};
/* SPI, Raspberry Pi connector */
&sercom5 {
status = "okay";
compatible = "atmel,sam0-spi";
#address-cells = <1>;
#size-cells = <0>;
dipo = <2>;
dopo = <0>;
pinctrl-0 = <&sercom5_spi_default>;
pinctrl-names = "default";
cs-gpios = <&portb 1 GPIO_ACTIVE_LOW>;
};
/* microSD Card */
&sercom6 {
status = "okay";
compatible = "atmel,sam0-spi";
#address-cells = <1>;
#size-cells = <0>;
dipo = <2>;
dopo = <0>;
pinctrl-0 = <&sercom6_spi_default>;
pinctrl-names = "default";
cs-gpios = <&portc 19 GPIO_ACTIVE_LOW>;
/* microSD Card */
sdhc0: sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
spi-max-frequency = <24000000>;
mmc {
compatible = "zephyr,sdmmc-disk";
};
};
};
/* LCD */
&sercom7 {
status = "okay";
compatible = "atmel,sam0-spi";
#address-cells = <1>;
#size-cells = <0>;
dipo = <2>;
dopo = <3>;
pinctrl-0 = <&sercom7_spi_default>;
pinctrl-names = "default";
cs-gpios = <&portb 21 GPIO_ACTIVE_LOW>;
/* LCD */
ili9341: ili9341@0 {
compatible = "ilitek,ili9341";
spi-max-frequency = <24000000>;
reg = <0>;
cmd-data-gpios = <&portc 6 GPIO_ACTIVE_LOW>;
reset-gpios = <&portc 7 GPIO_ACTIVE_LOW>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
rotation = <270>;
width = <320>;
height = <240>;
};
};
/* USB */
zephyr_udc0: &usb0 {
status = "okay";
pinctrl-0 = <&usb_dc_default>;
pinctrl-names = "default";
wio_terminal_console: wio_terminal_console {
compatible = "zephyr,cdc-acm-uart";
};
};