|
| 1 | +/* |
| 2 | + * Copyright (c) 2022 Kamil Serwus |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +/dts-v1/; |
| 8 | + |
| 9 | +#include <atmel/samc21x18.dtsi> |
| 10 | +#include "atsamc21n_xpro-pinctrl.dtsi" |
| 11 | + |
| 12 | +/ { |
| 13 | + model = "SAM C21N Xplained Pro"; |
| 14 | + compatible = "atsamc21n,xpro", "atmel,samc21n18a", "atmel,samc21"; |
| 15 | + |
| 16 | + chosen { |
| 17 | + zephyr,console = &sercom4; |
| 18 | + zephyr,shell-uart = &sercom4; |
| 19 | + zephyr,sram = &sram0; |
| 20 | + zephyr,flash = &flash0; |
| 21 | + }; |
| 22 | + |
| 23 | + /* These aliases are provided for compatibility with samples */ |
| 24 | + aliases { |
| 25 | + led0 = &led0; |
| 26 | + pwm-led0 = &pwm_led0; |
| 27 | + sw0 = &user_button; |
| 28 | + i2c-0 = &sercom1; |
| 29 | + }; |
| 30 | + |
| 31 | + leds { |
| 32 | + compatible = "gpio-leds"; |
| 33 | + led0: led_0 { |
| 34 | + gpios = <&portc 05 GPIO_ACTIVE_LOW>; |
| 35 | + label = "Yellow LED"; |
| 36 | + }; |
| 37 | + }; |
| 38 | + |
| 39 | + pwmleds { |
| 40 | + compatible = "pwm-leds"; |
| 41 | + pwm_led0: pwm_led_0 { |
| 42 | + pwms = <&tcc2 1 PWM_MSEC(20)>; |
| 43 | + }; |
| 44 | + }; |
| 45 | + |
| 46 | + buttons { |
| 47 | + compatible = "gpio-keys"; |
| 48 | + user_button: button_0 { |
| 49 | + gpios = <&portb 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; |
| 50 | + label = "User Button"; |
| 51 | + }; |
| 52 | + }; |
| 53 | + |
| 54 | +}; |
| 55 | + |
| 56 | +&cpu0 { |
| 57 | + clock-frequency = <48000000>; |
| 58 | +}; |
| 59 | + |
| 60 | +&adc0 { |
| 61 | + status = "okay"; |
| 62 | + pinctrl-0 = <&adc0_default>; |
| 63 | + pinctrl-names = "default"; |
| 64 | +}; |
| 65 | + |
| 66 | +&adc1 { |
| 67 | + pinctrl-0 = <&adc1_default>; |
| 68 | + pinctrl-names = "default"; |
| 69 | +}; |
| 70 | + |
| 71 | +&tcc2 { |
| 72 | + status = "okay"; |
| 73 | + compatible = "atmel,sam0-tcc-pwm"; |
| 74 | + prescaler = <256>; |
| 75 | + #pwm-cells = <2>; |
| 76 | + |
| 77 | + pinctrl-0 = <&pwm_default>; |
| 78 | + pinctrl-names = "default"; |
| 79 | +}; |
| 80 | + |
| 81 | +&sercom0 { |
| 82 | + status = "okay"; |
| 83 | + compatible = "atmel,sam0-uart"; |
| 84 | + current-speed = <9600>; |
| 85 | + rxpo = <1>; |
| 86 | + txpo = <0>; |
| 87 | + |
| 88 | + pinctrl-0 = <&sercom0_uart_default>; |
| 89 | + pinctrl-names = "default"; |
| 90 | +}; |
| 91 | + |
| 92 | +&sercom1 { |
| 93 | + status = "okay"; |
| 94 | + compatible = "atmel,sam0-i2c"; |
| 95 | + clock-frequency = <I2C_BITRATE_FAST>; |
| 96 | + #address-cells = <1>; |
| 97 | + #size-cells = <0>; |
| 98 | + |
| 99 | + pinctrl-0 = <&sercom1_i2c_default>; |
| 100 | + pinctrl-names = "default"; |
| 101 | +}; |
| 102 | + |
| 103 | +&sercom2 { |
| 104 | + status = "okay"; |
| 105 | + compatible = "atmel,sam0-uart"; |
| 106 | + current-speed = <115200>; |
| 107 | + rxpo = <1>; |
| 108 | + txpo = <0>; |
| 109 | + |
| 110 | + pinctrl-0 = <&sercom2_uart_default>; |
| 111 | + pinctrl-names = "default"; |
| 112 | +}; |
| 113 | + |
| 114 | +&sercom4 { |
| 115 | + status = "okay"; |
| 116 | + compatible = "atmel,sam0-uart"; |
| 117 | + current-speed = <115200>; |
| 118 | + rxpo = <3>; |
| 119 | + txpo = <1>; |
| 120 | + |
| 121 | + pinctrl-0 = <&sercom4_uart_default>; |
| 122 | + pinctrl-names = "default"; |
| 123 | +}; |
| 124 | + |
| 125 | +&sercom5 { |
| 126 | + status = "okay"; |
| 127 | + compatible = "atmel,sam0-spi"; |
| 128 | + dipo = <0>; |
| 129 | + dopo = <2>; |
| 130 | + #address-cells = <1>; |
| 131 | + #size-cells = <0>; |
| 132 | + |
| 133 | + pinctrl-0 = <&sercom5_spi_default>; |
| 134 | + pinctrl-names = "default"; |
| 135 | +}; |
| 136 | + |
| 137 | +&flash0 { |
| 138 | + partitions { |
| 139 | + compatible = "fixed-partitions"; |
| 140 | + #address-cells = <1>; |
| 141 | + #size-cells = <1>; |
| 142 | + |
| 143 | + /* |
| 144 | + * The final 16 KiB is reserved for the application. |
| 145 | + * Storage partition will be used by FCB/LittleFS/NVS |
| 146 | + * if enabled. |
| 147 | + */ |
| 148 | + storage_partition: partition@3c000 { |
| 149 | + label = "storage"; |
| 150 | + reg = <0x0003c000 0x00004000>; |
| 151 | + }; |
| 152 | + }; |
| 153 | +}; |
0 commit comments