-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: display_st7789v: obtain parameters from DT, add Waveshare 1.3inch display #20778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b72ae8e
shields: display: Added generic shield for ST7789V
vanwinkeljan bd5290d
samples: display: Use ST7789V generic shield
vanwinkeljan 4ffb5f8
drivers: display_st7789v: fix style, move init function to the bottom
jfischer-no a9d75e2
drivers: display_st7789v: obtain resolution and offsets from DT
jfischer-no 252a337
drivers: display_st7789v: make functions static, cleanup
jfischer-no 682e609
drivers: display_st7789v: obtain panel settings and parameters from DT
jfischer-no bc55686
drivers: display_st7789v: remove obsolete Kconfig options
jfischer-no e34909d
drivers: display_st7789v: remove obsolete display_st7789v_tl019fqv01.c
jfischer-no f8065d4
shields: st7789v_generic: add TL019FQV01 parameter and settings prope…
jfischer-no e3a40f4
shields: st7789v_generic: rename shield to TL019FQV01
jfischer-no c0b8b3b
shields: st7789v_generic: add support for Waveshare 1.3inch display
jfischer-no File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,71 @@ | ||
| .. _st7789v_generic: | ||
|
|
||
| Generic ST7789V Display Shield | ||
| ############################## | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| This is a generic shield for display shields based on ST7789V display | ||
| controller. More information about the controller can be found in | ||
| `ST7789V Datasheet`_. | ||
|
|
||
| Pins Assignment of the Generic ST7789V Display Shield | ||
| ===================================================== | ||
|
|
||
| +-----------------------+---------------------------------------------+ | ||
| | Arduino Connector Pin | Function | | ||
| +=======================+=============================================+ | ||
| | D8 | ST7789V Reset | | ||
| +-----------------------+---------------------------------------------+ | ||
| | D9 | ST7789V DC (Data/Command) | | ||
| +-----------------------+---------------------------------------------+ | ||
| | D10 | SPI SS (Serial Slave Select) | | ||
| +-----------------------+---------------------------------------------+ | ||
| | D11 | SPI MOSI (Serial Data Input) | | ||
| +-----------------------+---------------------------------------------+ | ||
| | D12 | SPI MISO (Serial Data Out) | | ||
| +-----------------------+---------------------------------------------+ | ||
| | D13 | SPI SCK (Serial Clock Input) | | ||
| +-----------------------+---------------------------------------------+ | ||
|
|
||
| Current supported displays | ||
| ========================== | ||
|
|
||
| +----------------------+------------------------------+ | ||
| | Display | Shield Designation | | ||
| | | | | ||
| +======================+==============================+ | ||
| | TL019FQV01 | st7789v_tl019fqv01 | | ||
| | | | | ||
| +----------------------+------------------------------+ | ||
| | Waveshare 240x240 | st7789v_waveshare_240x240 | | ||
| | 1.3inch IPS LCD | | | ||
| +----------------------+------------------------------+ | ||
|
|
||
| Requirements | ||
| ************ | ||
|
|
||
| This shield can only be used with a board that provides a configuration | ||
| for Arduino connectors and defines node aliases for SPI and GPIO interfaces | ||
| (see :ref:`shields` for more details). | ||
|
|
||
| Programming | ||
| *********** | ||
|
|
||
| Set ``-DSHIELD=st7789v_tl019fqv01`` when you invoke ``west build``. For example: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/gui/lvgl | ||
| :board: nrf52840_pca10056 | ||
| :shield: st7789v_tl019fqv01 | ||
| :goals: build | ||
|
|
||
| References | ||
| ********** | ||
|
|
||
| .. target-notes:: | ||
|
|
||
| .. _ST7789V Datasheet: | ||
| https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7789V.pdf | ||
|
|
||
This file contains hidden or 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 @@ | ||
| CONFIG_SPI=y | ||
| CONFIG_DISPLAY=y | ||
| CONFIG_ST7789V=y | ||
|
|
||
| CONFIG_ST7789V_RGB888=y | ||
| CONFIG_LVGL_BITS_PER_PIXEL=24 | ||
| CONFIG_LVGL_HOR_RES=320 | ||
| CONFIG_LVGL_VER_RES=170 | ||
|
|
||
| CONFIG_LVGL_DISPLAY_DEV_NAME="ST7789V" |
This file contains hidden or 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,38 @@ | ||
| /* | ||
| * Copyright (c) 2019 Jan Van Winkel <[email protected]> | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| &arduino_spi { | ||
| status = "okay"; | ||
| cs-gpios = <&arduino_header 16 0>; /* D10 */ | ||
|
|
||
| st7789v@0 { | ||
| compatible = "sitronix,st7789v"; | ||
| label = "ST7789V"; | ||
| spi-max-frequency = <20000000>; | ||
| reg = <0>; | ||
| cmd-data-gpios = <&arduino_header 15 0>; /* D9 */ | ||
| reset-gpios = <&arduino_header 14 0>; /* D8 */ | ||
| width = <320>; | ||
| height = <170>; | ||
| x-offset = <0>; | ||
| y-offset = <35>; | ||
| vcom = <0x2b>; | ||
| gctrl = <0x35>; | ||
| vrhs = <0x0f>; | ||
| vdvs = <0x20>; | ||
| mdac = <0x20>; | ||
| gamma = <0x01>; | ||
| colmod = <0x66>; | ||
| lcm = <0x2c>; | ||
| porch-param = [0c 0c 00 33 33]; | ||
| cmd2en-param = [5a 69 02 01]; | ||
| pwctrl1-param = [52 a1]; | ||
| pvgam-param = [D0 00 02 07 0B 1A 31 54 40 29 12 12 12 17]; | ||
| nvgam-param = [D0 00 02 07 05 15 2D 44 44 1C 18 16 1C 1D]; | ||
| ram-param = [00 F0]; | ||
| rgb-param = [CD 08 14]; | ||
| }; | ||
| }; |
10 changes: 10 additions & 0 deletions
10
boards/shields/st7789v_generic/st7789v_waveshare_240x240.conf
This file contains hidden or 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 @@ | ||
| CONFIG_SPI=y | ||
| CONFIG_DISPLAY=y | ||
| CONFIG_ST7789V=y | ||
|
|
||
| CONFIG_ST7789V_RGB565=y | ||
| CONFIG_LVGL_BITS_PER_PIXEL=16 | ||
| CONFIG_LVGL_HOR_RES=240 | ||
| CONFIG_LVGL_VER_RES=240 | ||
|
|
||
| CONFIG_LVGL_DISPLAY_DEV_NAME="ST7789V" |
39 changes: 39 additions & 0 deletions
39
boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay
This file contains hidden or 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,39 @@ | ||
| /* | ||
| * Copyright (c) 2019 Jan Van Winkel <[email protected]> | ||
| * Copyright (c) 2019 PHYTEC Messtechnik GmbH | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| &arduino_spi { | ||
| status = "okay"; | ||
| cs-gpios = <&arduino_header 16 0>; /* D10 */ | ||
|
|
||
| st7789v@0 { | ||
| compatible = "sitronix,st7789v"; | ||
| label = "ST7789V"; | ||
| spi-max-frequency = <20000000>; | ||
| reg = <0>; | ||
| cmd-data-gpios = <&arduino_header 15 0>; /* D9 */ | ||
| reset-gpios = <&arduino_header 14 0>; /* D8 */ | ||
| width = <240>; | ||
| height = <240>; | ||
| x-offset = <0>; | ||
| y-offset = <0>; | ||
| vcom = <0x19>; | ||
| gctrl = <0x35>; | ||
| vrhs = <0x12>; | ||
| vdvs = <0x20>; | ||
| mdac = <0x00>; | ||
| gamma = <0x01>; | ||
| colmod = <0x05>; | ||
| lcm = <0x2c>; | ||
| porch-param = [0c 0c 00 33 33]; | ||
| cmd2en-param = [5a 69 02 01]; | ||
| pwctrl1-param = [a4 a1]; | ||
| pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; | ||
| nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; | ||
| ram-param = [00 F0]; | ||
| rgb-param = [CD 08 14]; | ||
| }; | ||
| }; |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete extra blank line at the end of the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in #20570