Peripheral Configuration
The ST7789 display is driven by the nRF54L15's high-speed SPI00 peripheral, capable of operating at 32 MHz. A critical aspect of configuring SPI00 is ensuring the correct pins and drive strength are used.
First, the GPIO pins must be from the P2 port. Second, the high-drive mode must be enabled to ensure reliable signal integrity at high speeds.
&pinctrl {
spi00_config: spi00_config {
group1 {
psels = <nrf_psel>,
<nrf_psel>,
<nrf_psel>;
nordic,drive-strength = <nrf_drive_h0h1>;
};
};
spi00_sleep: spi00_sleep {
group1 {
psels = <nrf_psel>,
<nrf_psel>,
<nrf_psel>;
low-power-enable;
};
};
}
</nrf_psel></nrf_psel></nrf_psel></nrf_drive_h0h1></nrf_psel></nrf_psel></nrf_psel>
Device Tree Modifications
The implementation starts with the Zephyr OS LVGL sample application. The primary task is to modify the device tree (DTS) to declare the SPI controller and the ST7789 display.
The follwoing DTS snippet shows the necessary additions and changes.
/ {
chosen {
zephyr,display = &display_st7789;
};
display_controller {
compatible = "zephyr,mipi-dbi-spi";
bus = <&spi00>;
dc-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
write-only;
display_st7789: display_st7789@0 {
compatible = "sitronix,st7789v";
reg = <0>;
mipi-max-frequency = <32000000>;
mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
width = <240>;
height = <320>;
x-offset = <0>;
y-offset = <0>;
vcom = <0x3f>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x00>;
gamma = <0x01>;
colmod = <0x05>; /* 16-bit RGB565 */
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];
};
};
control_pins {
compatible = "dev-gpios";
backlight: backlight {
gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
label = "backlight control";
};
};
};
&spi00 {
cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi00_config>;
pinctrl-1 = <&spi00_sleep>;
status = "okay";
max-frequency = <dt_freq_m>;
};
</dt_freq_m>
Performance Consideration
Testing on a 320x240 display revealed a relative low refresh rate. For larger displays, utilizing the nRF54L15's QSPI interface is recommended to acheive higher performance.