forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: shields: add support for buydisplay 2.8" TFT touch display
Add support for the Buydisplay 2.8" TFT touch display shield for Arduino. Signed-off-by: Gerard Marull-Paretas <[email protected]>
- Loading branch information
1 parent
d1f57be
commit 0b2cb96
Showing
5 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
boards/shields/buydisplay_2_8_tft_touch_arduino/Kconfig.defconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright (c) 2020 Teslabs Engineering S.L. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_BUYDISPLAY_2_8_TFT_TOUCH_ARDUINO | ||
|
||
if DISPLAY | ||
|
||
config SPI | ||
default y | ||
|
||
config ILI9340 | ||
default y | ||
|
||
if KSCAN | ||
|
||
config I2C | ||
default y | ||
|
||
config KSCAN_FT5336 | ||
default y | ||
|
||
# NOTE: Enable if IRQ line is available (requires to solder jumper) | ||
config KSCAN_FT5336_INTERRUPT | ||
default n | ||
|
||
config KSCAN_INIT_PRIORITY | ||
default 60 | ||
|
||
endif # KSCAN | ||
|
||
if LVGL | ||
|
||
config LVGL_DISPLAY_DEV_NAME | ||
default "DISPLAY" | ||
|
||
config LVGL_HOR_RES_MAX | ||
default 320 | ||
|
||
config LVGL_VER_RES_MAX | ||
default 240 | ||
|
||
config LVGL_VDB_SIZE | ||
default 64 | ||
|
||
config LVGL_BITS_PER_PIXEL | ||
default 24 | ||
|
||
config KSCAN | ||
default y | ||
|
||
config LVGL_POINTER_KSCAN | ||
default y | ||
|
||
config LVGL_POINTER_KSCAN_DEV_NAME | ||
default "TOUCH" | ||
|
||
endif # LVGL | ||
|
||
endif # DISPLAY | ||
|
||
endif # SHIELD_BUYDISPLAY_2_8_TFT_TOUCH_ARDUINO |
5 changes: 5 additions & 0 deletions
5
boards/shields/buydisplay_2_8_tft_touch_arduino/Kconfig.shield
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2020 Teslabs Engineering S.L. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_BUYDISPLAY_2_8_TFT_TOUCH_ARDUINO | ||
def_bool $(shields_list_contains,buydisplay_2_8_tft_touch_arduino) |
10 changes: 10 additions & 0 deletions
10
boards/shields/buydisplay_2_8_tft_touch_arduino/boards/nrf52840dk_nrf52840.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* Copyright (c) 2020 Teslabs Engineering S.L. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* NOTE: spi1 MISO pin is used by the display for the cmd/data line */ | ||
&spi1 { | ||
status = "disabled"; | ||
}; |
29 changes: 29 additions & 0 deletions
29
boards/shields/buydisplay_2_8_tft_touch_arduino/buydisplay_2_8_tft_touch_arduino.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2020 Teslabs Engineering S.L. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&arduino_spi { | ||
status = "okay"; | ||
cs-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ | ||
|
||
ili9340@0 { | ||
compatible = "ilitek,ili9340"; | ||
label = "DISPLAY"; | ||
spi-max-frequency = <25000000>; | ||
reg = <0>; | ||
cmd-data-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */ | ||
reset-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ | ||
}; | ||
}; | ||
|
||
&arduino_i2c { | ||
ft5336@38 { | ||
compatible = "focaltech,ft5336"; | ||
reg = <0x38>; | ||
label = "TOUCH"; | ||
/* Uncomment if IRQ line is available (requires to solder jumper) */ | ||
/* int-gpios = <&arduino_header 11 GPIO_ACTIVE_LOW>; */ /* D5 */ | ||
}; | ||
}; |
77 changes: 77 additions & 0 deletions
77
boards/shields/buydisplay_2_8_tft_touch_arduino/doc/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
.. _buydisplay_2_8_tft_touch_arduino: | ||
|
||
Buydisplay 2.8" TFT Touch Shield with Arduino adapter | ||
##################################################### | ||
|
||
Overview | ||
******** | ||
|
||
The Buydisplay 2.8" TFT Touch Shield has a resolution of 320x240 | ||
pixels and is based on the ILI9341 controller. This shield comes with | ||
a capacitive FT6206 controller touchscreen. The Arduino adapter is | ||
required to use this shield. | ||
|
||
More information about the shield and Arduino adapter can be found at | ||
the `Buydisplay 2.8" TFT Touch Shield website`_ and | ||
`Arduino adapter website`_. | ||
|
||
Pin Assignments | ||
=============== | ||
|
||
+-----------------------+---------------------------------------------+ | ||
| Shield Connector Pin | Function | | ||
+=======================+=============================================+ | ||
| D5 | Touch Controller IRQ (see note below) | | ||
+-----------------------+---------------------------------------------+ | ||
| D7 | ILI9341 DC (Data/Command) | | ||
+-----------------------+---------------------------------------------+ | ||
| D10 | ILI9341 Reset | | ||
+-----------------------+---------------------------------------------+ | ||
| D9 | ILI9341 SPI CSn | | ||
+-----------------------+---------------------------------------------+ | ||
| D11 | SPI MOSI (Serial Data Input) | | ||
+-----------------------+---------------------------------------------+ | ||
| D12 | SPI MISO (Serial Data Out) | | ||
+-----------------------+---------------------------------------------+ | ||
| D13 | SPI SCK (Serial Clock Input) | | ||
+-----------------------+---------------------------------------------+ | ||
| SDA | FT6206 SDA | | ||
+-----------------------+---------------------------------------------+ | ||
| SCL | FT6206 SCL | | ||
+-----------------------+---------------------------------------------+ | ||
|
||
.. note:: | ||
Touch controller IRQ line is not connected by default. You will need | ||
to solder the ``5 INT`` jumper to use it. You will also need to | ||
adjust driver configuration and its Device Tree entry to make use of | ||
it. | ||
|
||
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). | ||
|
||
Programming | ||
*********** | ||
|
||
Set ``-DSHIELD=buydisplay_2_8_tft_touch_arduino`` when you invoke | ||
``west build``. For example: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/gui/lvgl | ||
:board: nrf52840dk_nrf52840 | ||
:shield: buydisplay_2_8_tft_touch_arduino | ||
:goals: build | ||
|
||
References | ||
********** | ||
|
||
.. target-notes:: | ||
|
||
.. _Buydisplay 2.8" TFT Touch Shield website: | ||
https://www.buydisplay.com/2-8-inch-tft-touch-shield-for-arduino-w-capacitive-touch-screen-module | ||
|
||
.. _Arduino adapter website: | ||
https://www.buydisplay.com/arduino-shield-for-tft-lcd-with-ili9341-controller-and-arduino-due-mega-uno |