Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be defining a custom compatible for the flexio connector, and adding a pin map in the dt binding. See here for an example for the 6 pin FPC touch connector present on NXP RT10xx EVKs:

following assignments:

Also, should we be defining additional pins beyond the INT and RESET? The FlexIO connector is 28 pins in total, and many can be used as GPIOs, right?

Generally the approach taken is to define all pins for the interface in the binding file, and only define the pins that are actually in use as GPIOs in the devicetree for the board. A good example of this would be the 40 pin parallel LCD connector on the RT10xx boards:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion!
duly applied

#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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Configure LVGL to use touchscreen with KSCAN API
# Configure LVGL to use touchscreen with INPUT 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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to duplicate the full definition here, you can just delete the reset-gpios property and add alt-addr, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping here- still need to drop these extra properties. We really just need something like this:

&gt911_lcd_par_s035 {
    /delete-property/ reset-gpios;
    alt-addr = <0x14>;
};

Copy link

@groncarolo groncarolo Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Daniel,

I think that these commits
b38a4cc Dominik Lau Fri Sep 27 10:17:05 2024 +0200 boards: added touch controller to the /chosen node
f8f70c2 Daniel DeGrasse Mon Aug 26 15:58:32 2024 +0000 boards: shields: lcd_par_s035: enable reset gpio within input module
3604aba Daniel DeGrasse Mon Sep 23 09:29:43 2024 -0500 shields: lcd_par_s035: rename nxp_flexio_lcd to zephyr_mipi_dbi_parallel

already introduce the touch on S035 LCD so this PR might not be very relevant anymore

I tested on 4.0.0 tag
west build -b frdm_mcxn947/mcxn947/cpu0 zephyr/samples/subsys/input/input_dump -- -DSHIELD=lcd_par_s035_8080
input_dump works OK

Input sample started
I: input event: dev=gt911-lcd_par_s035@5d     type= 3 code=  0 value=27
I: input event: dev=gt911-lcd_par_s035@5d     type= 3 code=  1 value=28

But lvgl demo

west build -b frdm_mcxn947/mcxn947/cpu0 zephyr/samples/subsys/display/lvgl -- -DSHIELD=lcd_par_s035_8080
has a button that is not clickable

I suspect, as we had tried the prio trick too, that when both display and touch are used it does not
work as espected.
Could you please test and confirm, to rule out I am doing something stupid ? :)

Thnaks !!

g.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally when I build and flash samples/subsys/display/lvgl on 4.0.0 like so: west build -p always -b frdm_mcxn947/mcxn947/cpu0 samples/subsys/display/lvgl --shield=lcd_par_s035_8080, I see a button and can click it.

Maybe check what cmake prints for your Zephyr version?

Zephyr version: 4.0.0 (/home/danieldegrasse/zephyr/zephyrproject/zephyr)

is what I see.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Daniel!

I changed display and it indeed works :)

Thnaks so much

I think we can close this PR here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'm going to leave it up to @groncarolonxp to close the PR (which I assume is also you- just for future reference, please try to engage with just one github account, it makes things easier to follow)

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong irq-gpios is an phandle-array now the 2nd assignment overrules the first one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right!

reset-gpios = <&nxp_flexio_connector 1 GPIO_ACTIVE_HIGH>; // RESET
};
};