Commit c683b044 authored by Benjamin Cabé's avatar Benjamin Cabé Committed by Benjamin Cabé
Browse files

shields: devicetree: use arduino-header-r3.h constants in all shields



Make shield overlays less error prone and easier to maintain by
switching to GPIO pin constants defined in arduino-header-r3.h.

Signed-off-by: default avatarBenjamin Cabé <benjamin@zephyrproject.org>
parent 7feddfa2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
 */

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

/ {
	chosen {
@@ -23,7 +24,7 @@
	adafruit_2_8_tft_touch_v2_mipi_dbi: adafruit_2_8_tft_touch_v2_mipi_dbi {
		compatible = "zephyr,mipi-dbi-spi";
		spi-dev = <&arduino_spi>;
		dc-gpios = <&arduino_header 15 GPIO_ACTIVE_HIGH>;	/* D9 */
		dc-gpios = <&arduino_header ARDUINO_HEADER_R3_D9 GPIO_ACTIVE_HIGH>;
		write-only;
		#address-cells = <1>;
		#size-cells = <0>;
@@ -48,8 +49,8 @@

&arduino_spi {
	status = "okay";
	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>,	/* D10 */
		   <&arduino_header 10 GPIO_ACTIVE_LOW>;	/* D04 */
	cs-gpios = <&arduino_header ARDUINO_HEADER_R3_D10 GPIO_ACTIVE_LOW>,
		   <&arduino_header ARDUINO_HEADER_R3_D4 GPIO_ACTIVE_LOW>;

	adafruit_2_8_tft_touch_v2_sdhc: sdhc@1 {
		compatible = "zephyr,sdhc-spi-slot";
@@ -69,6 +70,6 @@
		compatible = "focaltech,ft5336";
		reg = <0x38>;
		/* Uncomment if IRQ line is available (requires to solder jumper) */
		/* int-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; */ /* D7 */
		/* int-gpios = <&arduino_header ARDUINO_HEADER_R3_D7 GPIO_ACTIVE_LOW>; */
	};
};
+7 −4
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
 * SPDX-License-Identifier: Apache-2.0
 */

 #include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

/ {
	aliases {
		rtc = &rtc0_adafruit_data_logger;
@@ -16,7 +18,7 @@
		 * pins "L1" and "Digital I/O 3".
		 */
		green_led_adafruit_data_logger: led_1__adafruit_data_logger {
			gpios = <&arduino_header 9 GPIO_ACTIVE_HIGH>; /* D3 */
			gpios = <&arduino_header ARDUINO_HEADER_R3_D3 GPIO_ACTIVE_HIGH>;
			label = "User LED1";
		};
		/*
@@ -24,7 +26,7 @@
		 * pins "L2" and "Digital I/O 4".
		 */
		red_led_adafruit_data_logger: led_2_adafruit_data_logger {
			gpios = <&arduino_header 10 GPIO_ACTIVE_HIGH>; /* D4 */
			gpios = <&arduino_header ARDUINO_HEADER_R3_D4 GPIO_ACTIVE_HIGH>;
			label = "User LED2";
		};
	};
@@ -33,7 +35,7 @@

&arduino_spi {
	status = "okay";
	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
	cs-gpios = <&arduino_header ARDUINO_HEADER_R3_D10 GPIO_ACTIVE_LOW>;

	sdhc0_adafruit_data_logger: sdhc@0 {
		compatible = "zephyr,sdhc-spi-slot";
@@ -61,7 +63,8 @@
		 * Interrupt connection must be manually established using a jumper wire between
		 * pins "SQ" and "Digital I/O 7".
		 */
		int1-gpios = <&arduino_header 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* D7 */
		int1-gpios = <&arduino_header ARDUINO_HEADER_R3_D7
			      (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
		status = "okay";
	};
};
+6 −4
Original line number Diff line number Diff line
@@ -4,17 +4,19 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

&arduino_spi {
	status = "okay";
	cs-gpios = <&arduino_header 16 0>;			/* D10 */
	cs-gpios = <&arduino_header ARDUINO_HEADER_R3_D10 0>;

	winc1500_adafruit_winc1500: winc1500@0 {
		status = "ok";
		compatible = "atmel,winc1500";
		reg = <0x0>;
		spi-max-frequency = <4000000>;
		irq-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>;	/* D7 */
		reset-gpios = <&arduino_header 11 GPIO_ACTIVE_LOW>;	/* D5 */
		enable-gpios = <&arduino_header 12 0>;			/* D6 */
		irq-gpios = <&arduino_header ARDUINO_HEADER_R3_D7 GPIO_ACTIVE_LOW>;
		reset-gpios = <&arduino_header ARDUINO_HEADER_R3_D5 GPIO_ACTIVE_LOW>;
		enable-gpios = <&arduino_header ARDUINO_HEADER_R3_D6 0>;
	};
};
+3 −2
Original line number Diff line number Diff line
@@ -4,14 +4,15 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

&arduino_i2c {
	status = "okay";

	amg88xx_amg88xx_eval_kit: amg88xx@68 {
		compatible = "panasonic,amg88xx";
		reg = <0x68>;
		/* Pin D6 from Arduino Connector */
		int-gpios = <&arduino_header 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
		int-gpios = <&arduino_header ARDUINO_HEADER_R3_D6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
		status = "okay";
	};
};
+3 −2
Original line number Diff line number Diff line
@@ -3,13 +3,14 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

&arduino_i2c {
	status = "okay";
	amg88xx_amg88xx_grid_eye_eval_shield: amg88xx@68 {
		compatible = "panasonic,amg88xx";
		reg = <0x68>;
		/* Pin D2 from Arduino Connector */
		int-gpios = <&arduino_header 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
		int-gpios = <&arduino_header ARDUINO_HEADER_R3_D2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
		status = "okay";
	};
};
Loading