From 365187e63cfacbcdd4b1f5e4a8046281a1a2b822 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 4 Apr 2024 10:20:14 -0700 Subject: [PATCH] boards: shields: Add nRF9160 DK overlay for arduino_uno_click shield The original Arduino Uno provides the same SCL/SDA on two sets of pins, but the nRF9160 DK maps these pins to two different pairs of GPIO. When using the Arduino Uno Click Shield board with the nRF9160 DK, the P0.18/P0.19 pair must be used. Also, the default pin group for the nRF9160 DK includes RTS/CTS HW flow control, but the Arduino Uno Click Shield board does not connect these pins (only TX/RX are connected on the shield). This keeps RX/TX on the same pins, but just removes RTS/CTS from the pin groups. References: - Arduino Uno R3 pinout: https://docs.arduino.cc/resources/pinouts/A000066-full-pinout.pdf - Arduino Uno R3 schematic: https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf - Arduino UNO click shield schematic: https://download.mikroe.com/documents/add-on-boards/click-shields/arduino-uno/arduino-uno-click-shield-schematic-v101.pdf Signed-off-by: Chris Wilson --- .../boards/nrf9160dk_nrf9160.overlay | 7 +++ ...60dk_nrf9160_arduino_uno_click_common.dtsi | 49 +++++++++++++++++++ .../boards/nrf9160dk_nrf9160_ns.overlay | 7 +++ 3 files changed, 63 insertions(+) create mode 100644 boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160.overlay create mode 100644 boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_arduino_uno_click_common.dtsi create mode 100644 boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_ns.overlay diff --git a/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160.overlay b/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160.overlay new file mode 100644 index 00000000000..539c112fd63 --- /dev/null +++ b/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2024 Golioth, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9160dk_nrf9160_arduino_uno_click_common.dtsi" diff --git a/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_arduino_uno_click_common.dtsi b/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_arduino_uno_click_common.dtsi new file mode 100644 index 00000000000..925a4c41e48 --- /dev/null +++ b/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_arduino_uno_click_common.dtsi @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Golioth, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + /* + * The original Arduino Uno provides the same SCL/SDA on two sets of + * pins, but the nRF9160 DK maps these pins to two different pairs of + * GPIO. When using the Arduino Uno Click Shield board with the nRF9160 + * DK, the P0.18/P0.19 pair must be used. + */ + i2c2_default: i2c2_default { + group1 { + psels = , + ; + }; + }; + + i2c2_sleep: i2c2_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + /* + * The default pin group for the nRF9160 DK includes RTS/CTS HW flow + * control, but the Arduino Uno Click Shield board does not connect + * these pins (only TX/RX are connected on the shield). This keeps RX/TX + * on the same pins, but just removes RTS/CTS from the pin groups. + */ + uart1_default: uart1_default { + group1 { + psels = , + ; + }; + }; + + uart1_sleep: uart1_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_ns.overlay b/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_ns.overlay new file mode 100644 index 00000000000..539c112fd63 --- /dev/null +++ b/boards/shields/arduino_uno_click/boards/nrf9160dk_nrf9160_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2024 Golioth, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9160dk_nrf9160_arduino_uno_click_common.dtsi"