Adding Custom ili9341 Display to Zephyr Build

I'm attempting to add support for a custom ili9341 display to a project running on a the uBlox Nora dev kit. I'm currently using VS Code with nRF Connect SDK1.9.1. My question is about how to add the correct Devicetree entries so Zephyr selects and uses the ili9341 drivers. I have the ble_peripheral_lbs example built and running properly in VSCode.  I'm looking at the LVGL example in zephyr\samples\subsys\display\lvgl and attempting to do it that way. For simplification I'm adding the changes directly project dts file. I'll break the changes out into overlay files later.  

I've started adding an entry in the DTS file for the display (Clearly many properties are missing.):

xyz_display: xyz_display {
    compatible = "ilitek,ili9341";
    label = "XYZ_DISPLAY";
    height = <240>;
    width = <320>;
};


I've also updated the chosen section with a display entry:

chosen {
    zephyr,sram = &sram0_image;
    zephyr,flash = &flash0;
    zephyr,code-partition = &slot0_partition;
    zephyr,sram-secure-partition = &sram0_s;
    zephyr,sram-non-secure-partition = &sram0_ns;
    zephyr,display = &xyz_display;
};

The sample code kicks off the display initialization with:
display_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));
Which I assume will properly access the Devicetree configuration. 
I'm sure there are other required properties need to be added to the xyz_display entry. My questions are:
- How to specify the SPI port used by the display to the LVGL library. Is that done right in the DTS file?  (I have an entry in the DTS file for the desired SPI port tested and working.)
- Is there documentation or example code for the required ili9341 Devicetree entries?
Thanks in advance.
.

Parents Reply
  • This is great! I can read into all this and sort out the best way to configure the display driver. The part that I wasn't seeing was placing the ILI9340 node as a child inside the SPI device node to assign it to that SPI port. I've seen examples of how to configure it in the code but the more portable (but more complex) way is to shift the entire configuration into Device Tree it it seems like that is what the ILI9340 driver is written for. I'll post back here with more questions when they come up. Thank you.  

Children
No Data
Related