Skip to content

Commit 82fcb0d

Browse files
committed
boards: shield: Support touch for the NXP LCD-PAR-S035 LCD on MCXN947
NXP LCD-PAR-S035 LCD supports touch: enable it The reset pin of the LCD and the touch controller are shared so we set alt-addr to select GT911 I2C address by probing Co-authored-by: Pascal Mareau <[email protected]> Co-authored-by: Guido Roncarolo <[email protected] Signed-off-by: Guido Roncarolo <[email protected]>
1 parent d0474ce commit 82fcb0d

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,26 @@
5252
status = "disabled";
5353
};
5454
};
55+
56+
nxp_flexio_connector: flexio-connector {
57+
compatible = "gpio-nexus";
58+
#gpio-cells = <2>;
59+
gpio-map-mask = <0xffffffff 0xffffffc0>;
60+
gpio-map-pass-thru = <0 0x3f>;
61+
gpio-map = <
62+
0 0 &gpio4 6 0 /* Pin 6, INT */
63+
1 0 &gpio4 0 0 /* Pin 0, BOGUS RESET */
64+
>;
65+
};
66+
5567
};
5668

5769
&flexcomm1_lpspi1 {
5870
pinctrl-0 = <&pinmux_flexcomm1_lpspi>;
5971
pinctrl-names = "default";
6072
};
6173

62-
&flexcomm2_lpi2c2 {
74+
flexio_i2c: &flexcomm2_lpi2c2 {
6375
pinctrl-0 = <&pinmux_flexcomm2_lpi2c>;
6476
pinctrl-names = "default";
6577
clock-frequency = <I2C_BITRATE_STANDARD>;

boards/shields/lcd_par_s035/Kconfig.defconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
if SHIELD_LCD_PAR_S035
55
if LVGL
66

7+
# Configure LVGL to use touchscreen with KSCAN API
8+
9+
config INPUT
10+
default y
11+
712
# Enable double buffering
813
config LV_Z_DOUBLE_VDB
914
default y
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2024, NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
8+
&flexio_i2c {
9+
status = "okay";
10+
gt911_lcd_par_s035: gt911-lcd_par_s035@5d {
11+
compatible = "goodix,gt911";
12+
reg = <0x5d>;
13+
irq-gpios = <&nxp_flexio_connector 0 GPIO_ACTIVE_HIGH>;
14+
/delete-property/ reset-gpios;
15+
alt-addr = <0x14>;
16+
};
17+
};

boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
chosen {
1111
zephyr,display = &st7796s;
1212
};
13+
14+
lvgl_pointer {
15+
compatible = "zephyr,lvgl-pointer-input";
16+
input = <&gt911_lcd_par_s035>;
17+
swap-xy;
18+
invert-y;
19+
};
1320
};
1421

1522
&nxp_flexio_lcd {
@@ -39,3 +46,13 @@
3946
color-invert;
4047
};
4148
};
49+
50+
&flexio_i2c {
51+
status = "okay";
52+
gt911_lcd_par_s035: gt911-lcd_par_s035@5d {
53+
compatible = "goodix,gt911";
54+
reg = <0x5d>;
55+
irq-gpios = <&nxp_flexio_connector 0 GPIO_ACTIVE_HIGH>; // INT
56+
reset-gpios = <&nxp_flexio_connector 1 GPIO_ACTIVE_HIGH>; // RESET
57+
};
58+
};

0 commit comments

Comments
 (0)