Commit 230280e0 authored by TOKITA Hiroshi's avatar TOKITA Hiroshi Committed by Benjamin Cabé
Browse files

boards: arduino: uno_r4: Add ADC, PWM, I2C, SPI, and TRNG

Add support for basic peripherals.

Signed-off-by: default avatarTOKITA Hiroshi <tokita.hiroshi@gmail.com>
parent 380494af
Loading
Loading
Loading
Loading
+28 −0
Changes for boards/arduino/uno_r4/arduino_uno_r4-pinctrl.dtsi: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,4 +16,32 @@
			psels = <RA_PSEL(RA_PSEL_SCI_2, 3, 1)>;
		};
	};

	iic1_default: iic1_default {
		group1 {
			/* SCL1 SDA1 */
			psels = <RA_PSEL(RA_PSEL_I2C, 1, 0)>,
				<RA_PSEL(RA_PSEL_I2C, 1, 1)>;
			drive-strength = "medium";
		};
	};

	adc0_default: adc0_default {
		group1 {
			/* input */
			psels = <RA_PSEL(RA_PSEL_ADC, 0,  9)>,
				<RA_PSEL(RA_PSEL_ADC, 0,  0)>,
				<RA_PSEL(RA_PSEL_ADC, 0,  1)>,
				<RA_PSEL(RA_PSEL_ADC, 0,  2)>;
			renesas,analog-enable;
		};
	};

	pwm7_default: pwm7_default {
		group1 {
			/* GTIOC7A GTIOC7B */
			psels = <RA_PSEL(RA_PSEL_GPT1, 3, 4)>,
				<RA_PSEL(RA_PSEL_GPT1, 3, 3)>;
		};
	};
};
+31 −1
Changes for boards/arduino/uno_r4/arduino_uno_r4.dts: 31 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
		zephyr,shell-uart = &uart2;
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zephyr,entropy = &trng;
		zephyr,code-partition = &code_partition;
	};
};
@@ -28,7 +29,7 @@
	status = "okay";
	pinctrl-0 = <&sci2_default>;
	pinctrl-names = "default";
	interrupts = <4 1>, <5 1>, <6 1>, <7 1>;
	interrupts = <0 1>, <1 1>, <2 1>, <3 1>;
	interrupt-names = "rxi", "txi", "tei", "eri";

	uart2: uart {
@@ -41,6 +42,12 @@
	status = "okay";
};

&adc0 {
	status = "okay";
	pinctrl-0 = <&adc0_default>;
	pinctrl-names = "default";
};

&port_irq0 {
	interrupts = <27 12>;
	status = "okay";
@@ -51,6 +58,29 @@
	status = "okay";
};

&trng {
	status = "okay";
};

&pwm7 {
	pinctrl-0 = <&pwm7_default>;
	pinctrl-names = "default";
	interrupts = <8 1>, <9 1>;
	interrupt-names = "gtioca", "overflow";
	status = "okay";
};

&iic1 {
	pinctrl-0 = <&iic1_default>;
	pinctrl-names = "default";
	#address-cells = <1>;
	#size-cells = <0>;
	clock-frequency = <DT_FREQ_M(1)>;
	interrupts = <10 1>, <11 1>, <12 1>, <13 1>;
	interrupt-names = "rxi", "txi", "tei", "eri";
	status = "okay";
};

&flash0 {
	partitions {
		compatible = "fixed-partitions";
+17 −0
Changes for boards/arduino/uno_r4/arduino_uno_r4_minima-pinctrl.dtsi: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*
 * Copyright (c) 2023 TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */

&pinctrl {
	spi1_default: spi1_default {
		group1 {
			/* MOSI MISO RSPCK SSL */
			psels = <RA_PSEL(RA_PSEL_SPI, 1,  9)>,
				<RA_PSEL(RA_PSEL_SPI, 1, 10)>,
				<RA_PSEL(RA_PSEL_SPI, 1, 11)>,
				<RA_PSEL(RA_PSEL_SPI, 1, 12)>;
		};
	};
};
+26 −0
Changes for boards/arduino/uno_r4/arduino_uno_r4_minima.overlay: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#include "arduino_uno_r4_minima-pinctrl.dtsi"

#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/pwm/ra_pwm.h>

/ {
	model = "Arduino Uno R4 Minima";

@@ -14,8 +19,18 @@
		};
	};

	pwm_leds {
		compatible = "pwm-leds";
		status = "disabled";
		pwm_led: pwm_led {
			pwms = <&pwm3 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>;
			label = "PWM_LED";
		};
	};

	aliases {
		led0 = &led;
		pwm-led0 = &pwm_led;
	};

	arduino_header: connector {
@@ -47,3 +62,14 @@
			   <21 0 &ioport1 0 0>;   /* D15 */
	};
};

&spi1 {
	pinctrl-0 = <&spi1_default>;
	pinctrl-names = "default";
	interrupts = <28 1>, <29 1>, <30 1>, <31 1>;
	interrupt-names = "rxi", "txi", "tei", "eri";
	status = "okay";
};

arduino_i2c: &iic1 {};
arduino_spi: &spi1 {};
+3 −0
Changes for boards/arduino/uno_r4/arduino_uno_r4_minima.yaml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,5 +7,8 @@ toolchain:
  - gnuarmemb
ram: 32
supported:
  - adc
  - gpio
  - pwm
  - spi
  - uart
Loading