Skip to content

Commit bde0a78

Browse files
mmahadevan108kartben
authored andcommitted
boards: shields: lpc_par_s035: Add Support to communicate over SPI
Add support for the LCD-PAR display to communicate over the SPI bus which is available on the PMOD connection interface. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 1541174 commit bde0a78

File tree

5 files changed

+113
-5
lines changed

5 files changed

+113
-5
lines changed

boards/shields/lcd_par_s035/Kconfig.shield

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
config SHIELD_LCD_PAR_S035
5-
def_bool $(shields_list_contains,lcd_par_s035_8080)
5+
def_bool $(shields_list_contains,lcd_par_s035_spi) ||\
6+
$(shields_list_contains,lcd_par_s035_8080)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&lcdic {
8+
/* Enable byte swapping */
9+
nxp,swap-bytes;
10+
/* Raise the timer0 ratio to enable longer reset delay */
11+
nxp,timer0-ratio = <15>;
12+
/* Lower timer1 ratio to enable shorter TE delay */
13+
nxp,timer1-ratio = <0>;
14+
};

boards/shields/lcd_par_s035/doc/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ Requirements
1616
************
1717

1818
This shield can only be used with FRDM-X evaluation kits with a parallel LCD
19-
connector or a PMOD connector. Currently only the parallel LCD connector is
20-
enabled.
19+
connector or a PMOD connector.
2120

2221
Programming
2322
***********
2423

25-
Set ``--shield lcd_par_s035_8080`` when you invoke ``west build``. For
26-
example:
24+
Set ``--shield lcd_par_s035_8080`` or ``--shield lcd_par_s035_spi`` when you
25+
invoke ``west build``. For example:
2726

2827
.. zephyr-app-commands::
2928
:zephyr-app: samples/drivers/display
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
8+
#include <zephyr/dt-bindings/spi/spi.h>
9+
10+
/{
11+
chosen {
12+
zephyr,display = &st7796s;
13+
zephyr,touch = &gt911_lcd_par_s035;
14+
};
15+
16+
lvgl_pointer {
17+
compatible = "zephyr,lvgl-pointer-input";
18+
input = <&gt911_lcd_par_s035>;
19+
swap-xy;
20+
invert-y;
21+
};
22+
};
23+
24+
&nxp_pmod_touch_panel_i2c {
25+
status = "okay";
26+
27+
gt911_lcd_par_s035: gt911-lcd_par_s035@5d {
28+
compatible = "goodix,gt911";
29+
reg = <0x5d>;
30+
irq-gpios = <&nxp_lcd_pmod_connector 12 GPIO_ACTIVE_HIGH>;
31+
};
32+
};
33+
34+
&zephyr_mipi_dbi_spi {
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
st7796s: st7796s@0 {
40+
compatible = "sitronix,st7796s";
41+
reg = <0>;
42+
/*
43+
* Display supports minimum write cycle time of 66ns. This
44+
* means we can clock the LCDIC module at 30MHz, as
45+
* the minimum write duration will be 2x the module
46+
* clock. Note that this frequency is too fast for reading
47+
* from the display module
48+
*/
49+
mipi-max-frequency = <30000000>;
50+
mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
51+
duplex = <SPI_HALF_DUPLEX>;
52+
height = <320>;
53+
width = <480>;
54+
invert-mode = "1-dot";
55+
frmctl1 = [80 10];
56+
bpc = [1F 50 00 20];
57+
dfc = [8A 07 3B];
58+
pwr1 = [80 64];
59+
pwr2 = <0x13>;
60+
pwr3 = <0xA7>;
61+
vcmpctl = <0x09>;
62+
doca = [40 8A 00 00 29 19 A5 33];
63+
pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31];
64+
ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32];
65+
madctl = <0x28>;
66+
color-invert;
67+
};
68+
};

dts/bindings/gpio/nxp,lcd-pmod.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
5+
compatible: "nxp,lcd-pmod"
6+
7+
description: |
8+
GPIO pins exposed on NXP LCD pmod interface (e.g., used on LCD-PAR-035 panel).
9+
These pins are exposed on a 12 pin connector. The pins have the
10+
following assignments:
11+
12+
Pin Number Usage
13+
1 VCC
14+
2 VCC
15+
3 GND
16+
4 GND
17+
5 LCD PMOD interface WR pin
18+
6 LCD touch controller I2C SCL
19+
7 LCD PMOD interface D/C pin
20+
8 LCD touch controller I2C SDA
21+
9 LCD PMOD interface MOSI pin
22+
10 LCD and touch reset
23+
11 LCD PMOD interface CS pin
24+
12 LCD touch interrupt
25+
26+
include: [gpio-nexus.yaml, base.yaml]

0 commit comments

Comments
 (0)