Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions boards/arm/atsaml21_xpro/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SAM L21 Xplained Pro board configuration

# Copyright (c) 2021 Argentum Systems Ltd.
# SPDX-License-Identifier: Apache-2.0

config BOARD_ATSAML21_XPRO
bool "SAM L21 Xplained Pro"
depends on SOC_PART_NUMBER_SAML21J18B
8 changes: 8 additions & 0 deletions boards/arm/atsaml21_xpro/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SAM L21 Xplained Pro board configuration

# Copyright (c) 2021 Argentum Systems Ltd.
# SPDX-License-Identifier: Apache-2.0

config BOARD
default "atsaml21_xpro"
depends on BOARD_ATSAML21_XPRO
59 changes: 59 additions & 0 deletions boards/arm/atsaml21_xpro/atsaml21_xpro-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2021 Argentum Systems Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/saml21j-pinctrl.h>

&pinctrl {
tcc0_default: tcc0_default {
group1 {
pinmux = <PB10F_TCC0_WO4>;
};
};

sercom0_default: sercom0_default {
group1 {
pinmux = <PA4D_SERCOM0_PAD0>,
<PA6D_SERCOM0_PAD2>,
<PA7D_SERCOM0_PAD3>;
};
};

sercom1_default: sercom1_default {
group1 {
pinmux = <PA18C_SERCOM1_PAD2>,
<PA19C_SERCOM1_PAD3>;
};
};

sercom2_default: sercom2_default {
group1 {
pinmux = <PA8D_SERCOM2_PAD0>,
<PA9D_SERCOM2_PAD1>;
};
};

sercom3_default: sercom3_default {
group1 {
pinmux = <PA22C_SERCOM3_PAD0>,
<PA23C_SERCOM3_PAD1>;
};
};

sercom4_default: sercom4_default {
group1 {
pinmux = <PB8D_SERCOM4_PAD0>,
<PB9D_SERCOM4_PAD1>;
};
};

sercom5_default: sercom5_default {
group1 {
pinmux = <PB16C_SERCOM5_PAD0>,
<PB22D_SERCOM5_PAD2>,
<PB23D_SERCOM5_PAD3>;
};
};
};
142 changes: 142 additions & 0 deletions boards/arm/atsaml21_xpro/atsaml21_xpro.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* Copyright (c) 2021 Argentum Systems Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <atmel/saml21.dtsi>
#include "atsaml21_xpro-pinctrl.dtsi"

/ {
model = "SAM L21 Xplained Pro";
compatible = "atsaml21,xpro", "atmel,saml21j18b", "atmel,saml21";

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;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&portb 10 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 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "SW0";
};
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&adc {
status = "okay";
};

&tcc0 {
status = "okay";
compatible = "atmel,sam0-tcc-pwm";
/* Gives a maximum period of 1.4s */
prescaler = <4>;
#pwm-cells = <2>;

pinctrl-0 = <&tcc0_default>;
pinctrl-names = "default";
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <0>;
dopo = <1>;
#address-cells = <1>;
#size-cells = <0>;

pinctrl-0 = <&sercom0_default>;
pinctrl-names = "default";
};

&sercom1 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <3>;
txpo = <0>;

pinctrl-0 = <&sercom1_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_default>;
pinctrl-names = "default";
};

&sercom3 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;

pinctrl-0 = <&sercom3_default>;
pinctrl-names = "default";
};

&sercom4 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;

pinctrl-0 = <&sercom4_default>;
pinctrl-names = "default";
};

&sercom5 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <0>;
dopo = <1>;
#address-cells = <1>;
#size-cells = <0>;

pinctrl-0 = <&sercom5_default>;
pinctrl-names = "default";
};

zephyr_udc0: &usb0 {
status = "okay";
};
23 changes: 23 additions & 0 deletions boards/arm/atsaml21_xpro/atsaml21_xpro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2021 Argentum Systems Ltd.
# SPDX-License-Identifier: Apache-2.0
identifier: atsaml21_xpro
name: SAM L21 Xplained Pro
type: mcu
arch: arm
ram: 32
flash: 256
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- counter
- dma
- gpio
- i2c
- pwm
- spi
- usb_cdc
- usb_device
- watchdog
16 changes: 16 additions & 0 deletions boards/arm/atsaml21_xpro/atsaml21_xpro_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2021 Argentum Systems Ltd.
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_SAML21=y
CONFIG_SOC_PART_NUMBER_SAML21J18B=y
CONFIG_BOARD_ATSAML21_XPRO=y
CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_SAM0=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_GPIO=y
CONFIG_GPIO_SAM0=y
CONFIG_SOC_ATMEL_SAML_XOSC32K=y
CONFIG_SOC_ATMEL_SAML_XOSC32K_AS_MAIN=y
4 changes: 4 additions & 0 deletions boards/arm/atsaml21_xpro/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2021 Argentum Systems Ltd.
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading