Skip to content

Commit 13808ae

Browse files
squinioukartben
authored andcommitted
boards: stm32h573i_dk: add touch panel support
- The stm32h573i_dk board uses a ft3267 i2c controller for the touchscreen connected on i2c4. - The zephyr driver ft5336 can control it. - Use the I2C STM32 V2 Timing calculation. Signed-off-by: Samuel Quiniou <[email protected]>
1 parent 595fa2b commit 13808ae

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

boards/st/stm32h573i_dk/Kconfig.defconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ endchoice
3131
config REGULATOR
3232
default y
3333

34+
config INPUT
35+
default y if LVGL
36+
37+
config I2C_STM32_V2_TIMING
38+
default y if INPUT
39+
3440
endif # DISPLAY
3541

3642
endif # BOARD_STM32H573I_DK

boards/st/stm32h573i_dk/doc/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ Serial Port
180180
STM32H573I-DK Discovery board has 3 U(S)ARTs. The Zephyr console output is
181181
assigned to USART1. Default settings are 115200 8N1.
182182

183-
TFT LCD screen
184-
--------------
183+
TFT LCD screen and touch panel
184+
------------------------------
185185

186-
The TFT LCD screen is supported for the STM32H573I-DK Discovery board.
187-
It can be tested using :zephyr:code-sample:`display` sample:
186+
The TFT LCD screen and touch panel are supported for the STM32H573I-DK Discovery board.
187+
They can be tested using :zephyr:code-sample:`lvgl` sample:
188188

189189
.. zephyr-app-commands::
190-
:zephyr-app: samples/drivers/display
190+
:zephyr-app: samples/subsys/display/lvgl
191191
:board: stm32h573i_dk
192192
:goals: build
193193

boards/st/stm32h573i_dk/stm32h573i_dk.dts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@
8080
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
8181
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>;
8282
};
83+
84+
lvgl_pointer {
85+
compatible = "zephyr,lvgl-pointer-input";
86+
input = <&ft3267>;
87+
display = <&st7789v>;
88+
invert-y;
89+
};
8390
};
8491

8592
&fmc {
@@ -200,6 +207,20 @@
200207
status = "okay";
201208
};
202209

210+
&i2c4 {
211+
pinctrl-0 = <&i2c4_scl_pb8 &i2c4_sda_pb9>;
212+
pinctrl-names = "default";
213+
clock-frequency = <I2C_BITRATE_FAST>;
214+
status = "okay";
215+
216+
ft3267: ft3267@38 {
217+
compatible = "focaltech,ft5336";
218+
reg = <0x38>;
219+
int-gpios = <&gpiog 7 GPIO_ACTIVE_LOW>;
220+
reset-gpios = <&gpiog 3 GPIO_ACTIVE_LOW>;
221+
};
222+
};
223+
203224
&usart1 {
204225
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
205226
pinctrl-names = "default";

0 commit comments

Comments
 (0)