1/* 2 * Copyright (c) 2018 Bryan O'Donoghue 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7/dts-v1/; 8#include <freq.h> 9#include <atmel/samd21.dtsi> 10#include <atmel/samx2xx18.dtsi> 11#include "atsamd21_xpro-pinctrl.dtsi" 12#include <zephyr/dt-bindings/input/input-event-codes.h> 13 14/ { 15 model = "SAM D21 Xplained Pro"; 16 compatible = "atsamd21,xpro", "atmel,samd21j18a", "atmel,samd21"; 17 18 chosen { 19 zephyr,console = &sercom3; 20 zephyr,shell-uart = &sercom3; 21 zephyr,sram = &sram0; 22 zephyr,flash = &flash0; 23 }; 24 25 /* These aliases are provided for compatibility with samples */ 26 aliases { 27 led0 = &led0; 28 pwm-led0 = &pwm_led0; 29 sw0 = &user_button; 30 i2c-0 = &sercom2; 31 }; 32 33 leds { 34 compatible = "gpio-leds"; 35 led0: led_0 { 36 gpios = <&portb 30 GPIO_ACTIVE_LOW>; 37 label = "Yellow LED"; 38 }; 39 }; 40 41 pwmleds { 42 compatible = "pwm-leds"; 43 pwm_led0: pwm_led_0 { 44 pwms = <&tcc0 0 PWM_MSEC(20)>; 45 }; 46 }; 47 48 buttons { 49 compatible = "gpio-keys"; 50 user_button: button_0 { 51 gpios = <&porta 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; 52 label = "SW0"; 53 zephyr,code = <INPUT_KEY_0>; 54 }; 55 }; 56}; 57 58&cpu0 { 59 clock-frequency = <DT_FREQ_M(48)>; 60}; 61 62&tcc0 { 63 status = "okay"; 64 compatible = "atmel,sam0-tcc-pwm"; 65 /* Gives a maximum period of 1.4s */ 66 prescaler = <4>; 67 #pwm-cells = <2>; 68 69 pinctrl-0 = <&pwm_default>; 70 pinctrl-names = "default"; 71}; 72 73&sercom0 { 74 status = "okay"; 75 compatible = "atmel,sam0-uart"; 76 current-speed = <9600>; 77 rxpo = <3>; 78 txpo = <1>; 79 80 pinctrl-0 = <&sercom0_uart_default>; 81 pinctrl-names = "default"; 82}; 83 84&sercom1 { 85 status = "okay"; 86 compatible = "atmel,sam0-uart"; 87 current-speed = <115200>; 88 rxpo = <3>; 89 txpo = <0>; 90 91 pinctrl-0 = <&sercom1_uart_default>; 92 pinctrl-names = "default"; 93}; 94 95&sercom2 { 96 status = "okay"; 97 compatible = "atmel,sam0-i2c"; 98 clock-frequency = <I2C_BITRATE_FAST>; 99 #address-cells = <1>; 100 #size-cells = <0>; 101 102 pinctrl-0 = <&sercom2_i2c_default>; 103 pinctrl-names = "default"; 104}; 105 106&sercom3 { 107 status = "okay"; 108 compatible = "atmel,sam0-uart"; 109 current-speed = <115200>; 110 rxpo = <1>; 111 txpo = <0>; 112 113 pinctrl-0 = <&sercom3_uart_default>; 114 pinctrl-names = "default"; 115}; 116 117&sercom5 { 118 status = "okay"; 119 compatible = "atmel,sam0-spi"; 120 dipo = <0>; 121 dopo = <2>; 122 #address-cells = <1>; 123 #size-cells = <0>; 124 125 pinctrl-0 = <&sercom5_spi_default>; 126 pinctrl-names = "default"; 127}; 128 129zephyr_udc0: &usb0 { 130 status = "okay"; 131 132 pinctrl-0 = <&usb_dc_default>; 133 pinctrl-names = "default"; 134}; 135