136 lines
2.4 KiB
Plaintext
136 lines
2.4 KiB
Plaintext
/*
|
|
* Copyright (c) 2018 Bryan O'Donoghue
|
|
* Copyright (c) 2024 Gerson Fernando Budke <nandojve@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/dts-v1/;
|
|
#include <freq.h>
|
|
#include <atmel/samd21.dtsi>
|
|
#include <atmel/samx2xx18.dtsi>
|
|
#include "samd21_xpro-pinctrl.dtsi"
|
|
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
|
|
|
/ {
|
|
model = "SAM D21 Xplained Pro";
|
|
compatible = "samd21,xpro", "atmel,samd21j18a", "atmel,samd21";
|
|
|
|
chosen {
|
|
zephyr,console = &sercom3;
|
|
zephyr,shell-uart = &sercom3;
|
|
zephyr,sram = &sram0;
|
|
zephyr,flash = &flash0;
|
|
};
|
|
|
|
/* These aliases are provided for compatibility with samples */
|
|
aliases {
|
|
led0 = &led0;
|
|
pwm-led0 = &pwm_led0;
|
|
sw0 = &user_button;
|
|
i2c-0 = &sercom2;
|
|
};
|
|
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
led0: led_0 {
|
|
gpios = <&portb 30 GPIO_ACTIVE_LOW>;
|
|
label = "Yellow LED";
|
|
};
|
|
};
|
|
|
|
pwmleds {
|
|
compatible = "pwm-leds";
|
|
pwm_led0: pwm_led_0 {
|
|
pwms = <&tcc0 0 PWM_MSEC(20)>;
|
|
};
|
|
};
|
|
|
|
buttons {
|
|
compatible = "gpio-keys";
|
|
user_button: button_0 {
|
|
gpios = <&porta 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
|
|
label = "SW0";
|
|
zephyr,code = <INPUT_KEY_0>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&cpu0 {
|
|
clock-frequency = <DT_FREQ_M(48)>;
|
|
};
|
|
|
|
&tcc0 {
|
|
status = "okay";
|
|
compatible = "atmel,sam0-tcc-pwm";
|
|
/* Gives a maximum period of 1.4s */
|
|
prescaler = <4>;
|
|
#pwm-cells = <2>;
|
|
|
|
pinctrl-0 = <&pwm_default>;
|
|
pinctrl-names = "default";
|
|
};
|
|
|
|
&sercom0 {
|
|
status = "okay";
|
|
compatible = "atmel,sam0-uart";
|
|
current-speed = <9600>;
|
|
rxpo = <3>;
|
|
txpo = <1>;
|
|
|
|
pinctrl-0 = <&sercom0_uart_default>;
|
|
pinctrl-names = "default";
|
|
};
|
|
|
|
&sercom1 {
|
|
status = "okay";
|
|
compatible = "atmel,sam0-uart";
|
|
current-speed = <115200>;
|
|
rxpo = <3>;
|
|
txpo = <0>;
|
|
|
|
pinctrl-0 = <&sercom1_uart_default>;
|
|
pinctrl-names = "default";
|
|
};
|
|
|
|
&sercom2 {
|
|
status = "okay";
|
|
compatible = "atmel,sam0-i2c";
|
|
clock-frequency = <I2C_BITRATE_FAST>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
pinctrl-0 = <&sercom2_i2c_default>;
|
|
pinctrl-names = "default";
|
|
};
|
|
|
|
&sercom3 {
|
|
status = "okay";
|
|
compatible = "atmel,sam0-uart";
|
|
current-speed = <115200>;
|
|
rxpo = <1>;
|
|
txpo = <0>;
|
|
|
|
pinctrl-0 = <&sercom3_uart_default>;
|
|
pinctrl-names = "default";
|
|
};
|
|
|
|
&sercom5 {
|
|
status = "okay";
|
|
compatible = "atmel,sam0-spi";
|
|
dipo = <0>;
|
|
dopo = <2>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
pinctrl-0 = <&sercom5_spi_default>;
|
|
pinctrl-names = "default";
|
|
};
|
|
|
|
zephyr_udc0: &usb0 {
|
|
status = "okay";
|
|
|
|
pinctrl-0 = <&usb_dc_default>;
|
|
pinctrl-names = "default";
|
|
};
|