Skip to content

Commit

Permalink
boards: shield: Support touch for the NXP LCD-PAR-S035 LCD on MCXN947
Browse files Browse the repository at this point in the history
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 <pascal.mareau@nxp.com>
Co-authored-by: Guido Roncarolo <guido.roncarolo@nxp.com

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
  • Loading branch information
groncarolonxp committed Aug 1, 2024
1 parent d0474ce commit 82fcb0d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
14 changes: 13 additions & 1 deletion boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,26 @@
status = "disabled";
};
};

nxp_flexio_connector: flexio-connector {
compatible = "gpio-nexus";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <
0 0 &gpio4 6 0 /* Pin 6, INT */
1 0 &gpio4 0 0 /* Pin 0, BOGUS RESET */
>;
};

};

&flexcomm1_lpspi1 {
pinctrl-0 = <&pinmux_flexcomm1_lpspi>;
pinctrl-names = "default";
};

&flexcomm2_lpi2c2 {
flexio_i2c: &flexcomm2_lpi2c2 {
pinctrl-0 = <&pinmux_flexcomm2_lpi2c>;
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_STANDARD>;
Expand Down
5 changes: 5 additions & 0 deletions boards/shields/lcd_par_s035/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
if SHIELD_LCD_PAR_S035
if LVGL

# Configure LVGL to use touchscreen with KSCAN API

config INPUT
default y

# Enable double buffering
config LV_Z_DOUBLE_VDB
default y
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2024, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/


&flexio_i2c {
status = "okay";
gt911_lcd_par_s035: gt911-lcd_par_s035@5d {
compatible = "goodix,gt911";
reg = <0x5d>;
irq-gpios = <&nxp_flexio_connector 0 GPIO_ACTIVE_HIGH>;
/delete-property/ reset-gpios;
alt-addr = <0x14>;
};
};
17 changes: 17 additions & 0 deletions boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
chosen {
zephyr,display = &st7796s;
};

lvgl_pointer {
compatible = "zephyr,lvgl-pointer-input";
input = <&gt911_lcd_par_s035>;
swap-xy;
invert-y;
};
};

&nxp_flexio_lcd {
Expand Down Expand Up @@ -39,3 +46,13 @@
color-invert;
};
};

&flexio_i2c {
status = "okay";
gt911_lcd_par_s035: gt911-lcd_par_s035@5d {
compatible = "goodix,gt911";
reg = <0x5d>;
irq-gpios = <&nxp_flexio_connector 0 GPIO_ACTIVE_HIGH>; // INT
reset-gpios = <&nxp_flexio_connector 1 GPIO_ACTIVE_HIGH>; // RESET
};
};

0 comments on commit 82fcb0d

Please sign in to comment.