diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.defconfig b/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.defconfig index d6db5f13c45..1bbaece1852 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.defconfig +++ b/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.defconfig @@ -1,7 +1,7 @@ # Copyright (c) 2019 Linaro Limited # SPDX-License-Identifier: Apache-2.0 -if SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 +if SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 || SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2_NANO config GPIO default y diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.shield b/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.shield index dce2faac869..9c1d2e80591 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.shield +++ b/boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.shield @@ -3,3 +3,6 @@ config SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 def_bool $(shields_list_contains,adafruit_2_8_tft_touch_v2) + +config SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2_NANO + def_bool $(shields_list_contains,adafruit_2_8_tft_touch_v2_nano) diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/adafruit_2_8_tft_touch_v2.overlay b/boards/shields/adafruit_2_8_tft_touch_v2/adafruit_2_8_tft_touch_v2.overlay index fe18d1b19e5..c6502bc8705 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/adafruit_2_8_tft_touch_v2.overlay +++ b/boards/shields/adafruit_2_8_tft_touch_v2/adafruit_2_8_tft_touch_v2.overlay @@ -4,53 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - -/ { - chosen { - zephyr,display = &ili9340; - }; -}; - -&arduino_spi { - status = "okay"; - cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>, /* D10 */ - <&arduino_header 10 GPIO_ACTIVE_LOW>; /* D04 */ - - - ili9340: ili9340@0 { - compatible = "ilitek,ili9340"; - label = "ILI9340"; - spi-max-frequency = <15151515>; - reg = <0>; - cmd-data-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ - width = <320>; - height = <240>; - pixel-format = ; - rotation = <90>; - frmctr1 = [00 18]; - pwctrl1 = [23 00]; - vmctrl1 = [3e 28]; - vmctrl2 = [86]; - pgamctrl = [0f 31 2b 0c 0e 08 4e f1 37 07 10 03 0e 09 00]; - ngamctrl = [00 0e 14 03 11 07 31 c1 48 08 0f 0c 31 36 0f]; - }; - - sdhc0: sdhc@1 { - compatible = "zephyr,mmc-spi-slot"; - reg = <1>; - status = "okay"; - label = "SDHC0"; - spi-max-frequency = <24000000>; - }; -}; - -&arduino_i2c { - touch_controller: ft5336@38 { - compatible = "focaltech,ft5336"; - reg = <0x38>; - label = "FT5336"; - /* Uncomment if IRQ line is available (requires to solder jumper) */ - /* int-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; */ /* D7 */ - }; -}; +#include "adafruit_2_8_tft_touch_v2.dtsi" 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/adafruit_2_8_tft_touch_v2_nano.overlay similarity index 70% rename from boards/shields/adafruit_2_8_tft_touch_v2/boards/arduino_nano_33_ble.overlay rename to boards/shields/adafruit_2_8_tft_touch_v2/adafruit_2_8_tft_touch_v2_nano.overlay index f5f8212eb79..067c51c0f16 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/boards/arduino_nano_33_ble.overlay +++ b/boards/shields/adafruit_2_8_tft_touch_v2/adafruit_2_8_tft_touch_v2_nano.overlay @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "adafruit_2_8_tft_touch_v2.dtsi" + / { /* * Arduino Nano form factor doesn't really have a Rev3 Arduino header @@ -14,9 +16,9 @@ #gpio-cells = <2>; gpio-map-mask = <0xffffffff 0xffffffc0>; gpio-map-pass-thru = <0 0x3f>; - gpio-map = <10 0 &arduino_nano_header 4 0>, // D4 - <15 0 &arduino_nano_header 10 0>, // D10 - <16 0 &arduino_nano_header 9 0>; // D9 + gpio-map = <10 0 &arduino_nano_header 4 0>, /* D4 */ + <15 0 &arduino_nano_header 10 0>, /* D10 */ + <16 0 &arduino_nano_header 9 0>; /* D9 */ }; }; diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/doc/index.rst b/boards/shields/adafruit_2_8_tft_touch_v2/doc/index.rst index 26085e4bcc3..330a8ffd11a 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/doc/index.rst +++ b/boards/shields/adafruit_2_8_tft_touch_v2/doc/index.rst @@ -51,8 +51,8 @@ Requirements ************ This shield can only be used with a board which provides a configuration -for Arduino connectors and defines node aliases for SPI and GPIO interfaces -(see :ref:`shields` for more details). +for Arduino or Arduino Nano connectors and defines node aliases for SPI and +GPIO interfaces (see :ref:`shields` for more details). Programming *********** @@ -65,6 +65,15 @@ Set ``-DSHIELD=adafruit_2_8_tft_touch_v2`` when you invoke ``west build``. For e :shield: adafruit_2_8_tft_touch_v2 :goals: build +If the shield is connected to a board which has Arduino Nano connector, +set ``-DSHIELD=adafruit_2_8_tft_touch_v2_nano`` when you invoke ``west build``. + +.. zephyr-app-commands:: + :zephyr-app: samples/subsys/display/lvgl + :board: arduino_nano_33_ble + :shield: adafruit_2_8_tft_touch_v2_nano + :goals: build + References ********** diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi b/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi new file mode 100644 index 00000000000..fe18d1b19e5 --- /dev/null +++ b/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2019 PHYTEC Messtechnik GmbH + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + chosen { + zephyr,display = &ili9340; + }; +}; + +&arduino_spi { + status = "okay"; + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>, /* D10 */ + <&arduino_header 10 GPIO_ACTIVE_LOW>; /* D04 */ + + + ili9340: ili9340@0 { + compatible = "ilitek,ili9340"; + label = "ILI9340"; + spi-max-frequency = <15151515>; + reg = <0>; + cmd-data-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ + width = <320>; + height = <240>; + pixel-format = ; + rotation = <90>; + frmctr1 = [00 18]; + pwctrl1 = [23 00]; + vmctrl1 = [3e 28]; + vmctrl2 = [86]; + pgamctrl = [0f 31 2b 0c 0e 08 4e f1 37 07 10 03 0e 09 00]; + ngamctrl = [00 0e 14 03 11 07 31 c1 48 08 0f 0c 31 36 0f]; + }; + + sdhc0: sdhc@1 { + compatible = "zephyr,mmc-spi-slot"; + reg = <1>; + status = "okay"; + label = "SDHC0"; + spi-max-frequency = <24000000>; + }; +}; + +&arduino_i2c { + touch_controller: ft5336@38 { + compatible = "focaltech,ft5336"; + reg = <0x38>; + label = "FT5336"; + /* Uncomment if IRQ line is available (requires to solder jumper) */ + /* int-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; */ /* D7 */ + }; +};