Skip to content
Snippets Groups Projects

enable the Adafruit 2.8 TFT display on Arduino Nano 33 BLE

All threads resolved!
4 files
+ 93
15
Compare changes
  • Side-by-side
  • Inline
Files
4
From eb4cb84d84ca79351eb9f882e7df82034c58a5ae Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
Date: Wed, 16 Mar 2022 10:53:38 +0100
Subject: [PATCH] boards: arm: arduino_nano_33_ble: add support for the
adafruit 2.8 TFT
This is a basic set of changes needed to support the TFT display from
adafruit on Arduino Nano 33 BLE. It's not what ended up upstream as there
were incompatible changes in v3.1 that make 1-to-1 backporting impossible.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
---
.../arduino_nano_33_ble.dts | 4 ++--
.../boards/arduino_nano_33_ble.overlay | 22 +++++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 boards/shields/adafruit_2_8_tft_touch_v2/boards/arduino_nano_33_ble.overlay
diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts
index 7e509086d2..3db0e8203a 100644
--- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts
+++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts
@@ -84,7 +84,7 @@
tx-pin = <35>; //P1.03
rx-pin = <42>; //P1.10
};
-&i2c0 {
+arduino_i2c: &i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-pin = <31>; //P0.31
@@ -97,7 +97,7 @@
scl-pin = <15>; //P0.15
};
// we use SPI2 because SPI1/0 shares conflicts with I2C1/0
-&spi2 {
+arduino_spi: &spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <13>; //P0.13
diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/boards/arduino_nano_33_ble.overlay b/boards/shields/adafruit_2_8_tft_touch_v2/boards/arduino_nano_33_ble.overlay
new file mode 100644
index 0000000000..2f265ace4e
--- /dev/null
+++ b/boards/shields/adafruit_2_8_tft_touch_v2/boards/arduino_nano_33_ble.overlay
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2022 Huawei Inc.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/ {
+ /*
+ * Arduino Nano form factor doesn't really have a Rev3 Arduino header
+ * so this is just a "virtual" mapping for the pins used by the
+ * Adafruit display.
+ */
+ arduino_header: connector {
+ compatible = "arduino-header-r3";
+ #gpio-cells = <2>;
+ gpio-map-mask = <0xffffffff 0xffffffc0>;
+ gpio-map-pass-thru = <0 0x3f>;
+ gpio-map = <10 0 &gpio1 15 0>, // D4
+ <15 0 &gpio1 2 0>, // D10
+ <16 0 &gpio0 27 0>; // D9
+ };
+};
--
2.34.1
Loading