This blog post demonstrates how to get a LVGL sample up and running on the nRF9160 DK using Adafruit 1.3" 240x240 Wide Angle TFT LCD Display with MicroSD - ST7789. Follow the wiring guide and the steps in the blog post and get your display going! In an ideal world, we would be able to use the st7789v shield for waveshare 240x240, but since the nRF9160 DK does not have a device tree node label for arduino_spi, we need to implement a workaround. For the details on how the project configuration and overlay files were derived, check out my other blog post.

Important: The display operates with 3.3V logic, so on the nRF9160 DK, you must ensure that a tiny switch, SW9 (which sets VDD IO) is set at 3V!

Following the generic ST7789V shield pin assignment, we wire the connection as such:
| nRF9160 DK pin | Display pin |
| P0.08 | RST |
| P0.09 | D/C |
| P0.10 | TCS |
| P0.11 | SI |
| P0.12 | SO |
| P0.13 | SCK |
| GND | GND |
| 5V | Vin |
After having wired up your DK, we need to perform some steps on the software side!
nRF Connect SDK installation (I used v1.6.0).
This SDK uses LVGL v7.6.1 so this project might not be compatible with builds that were released after Feb 24th (which is when LVGL was updated in Zephyr)
west build from command line)If you want this display to work with your project (let's call it YourProject), you need to:
prj.conf) is in YourProject's config fileboards/nrf9160dk_nrf9160ns.overlay)
YourProject already has an overlay file (nrf9160dk_nrf9160ns.overlay), you could copy-paste the contents of the provided overlay file to YourProject's nrf9160dk_nrf9160ns.overlayYourProject does not have an overlay file, then you could copy the whole file into YourProject folder. This will automatically be detected by CMake when you hit build!device.h, drivers/display.h and lvgl.h in the C-file in which you want to program using LVGL.The source code might not look like ordinary LVGL code (which uses lv_init, lv_disp_draw_buf_init etc) because this part of LVGL is abstracted away by Zephyr, as seen in lvgl.c in Zephyr. The source code is also based on the LVGL sample provided by Zephyr, with changes made so that it works with the nRF9160 DK when following this tutorial.
Top Comments
-
user112694
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
user112694
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children