From 821f49fbb4947c8b1fd9ffce4e5c4d4d62978d58 Mon Sep 17 00:00:00 2001 From: Konstantinos Papadopoulos Date: Mon, 3 Jan 2022 15:28:02 +0200 Subject: [PATCH] boards: stm32f769i_disc0: add touchscreen support Add support for the touchscreen controller on STM32F769I-DISC0(MB1166). The touchscreen uses Focaltech FT6202 which is compatible with FT5336. Tested with kscan_touch sample application. Signed-off-by: Konstantinos Papadopoulos --- boards/arm/stm32f769i_disco/Kconfig.defconfig | 6 ++++++ boards/arm/stm32f769i_disco/doc/index.rst | 5 +++++ boards/arm/stm32f769i_disco/stm32f769i_disco.dts | 15 +++++++++++++++ boards/arm/stm32f769i_disco/stm32f769i_disco.yaml | 1 + 4 files changed, 27 insertions(+) diff --git a/boards/arm/stm32f769i_disco/Kconfig.defconfig b/boards/arm/stm32f769i_disco/Kconfig.defconfig index ae76044e9e5..700c65ae4a7 100644 --- a/boards/arm/stm32f769i_disco/Kconfig.defconfig +++ b/boards/arm/stm32f769i_disco/Kconfig.defconfig @@ -12,6 +12,12 @@ config SPI_STM32_INTERRUPT default y depends on SPI +config I2C + default y if KSCAN + +config KSCAN_FT5336 + default y if KSCAN + if NETWORKING config NET_L2_ETHERNET diff --git a/boards/arm/stm32f769i_disco/doc/index.rst b/boards/arm/stm32f769i_disco/doc/index.rst index e1371c11ffe..01dc7473dba 100644 --- a/boards/arm/stm32f769i_disco/doc/index.rst +++ b/boards/arm/stm32f769i_disco/doc/index.rst @@ -118,6 +118,10 @@ The Zephyr stm32f769i_disco board configuration supports the following hardware +-----------+------------+-------------------------------------+ | QSPI NOR | on-chip | flash | +-----------+------------+-------------------------------------+ +| FMC | on-chip | memc (SDRAM) | ++-----------+------------+-------------------------------------+ +| TOUCH | off-chip | ft5336(FT6202) | ++-----------+------------+-------------------------------------+ Other hardware features are not yet supported on Zephyr porting. @@ -138,6 +142,7 @@ Default Zephyr Peripheral Mapping: - UART_1 TX/RX : PA9/PA10 (ST-Link Virtual Port Com) - UART_6 TX/RX : PC6/PC7 (Arduino Serial) - I2C1 SCL/SDA : PB8/PB9 (Arduino I2C) +- I2C4 SCL/SDA : PD12/PB7 (Touchscreen FT6202, PI13 Interrupt Pin) - SPI2 SCK/MISO/MOSI : PA12/PB14/PB15 (Arduino SPI) - ETH : PA1, PA2, PA7, PC1, PC4, PC5, PG11, PG13, PG14 - LD1 : PJ13 diff --git a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts index b1da8c049ea..f1b0cd41a87 100644 --- a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts +++ b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts @@ -63,6 +63,7 @@ led2 = &green_led_3; led3 = &red_led_4; sw0 = &user_button; + kscan0 = &touch_controller; }; }; @@ -113,6 +114,20 @@ arduino_serial: &usart6 {}; clock-frequency = ; }; +&i2c4 { + pinctrl-0 = <&i2c4_scl_pd12 &i2c4_sda_pb7>; + pinctrl-names = "default"; + status = "okay"; + clock-frequency = ; + + touch_controller: ft6202@2a { + compatible = "focaltech,ft5336"; + reg = <0x2a>; + label = "FT6202"; + int-gpios = <&gpioi 13 0>; + }; +}; + &spi2 { pinctrl-0 = <&spi2_nss_pa11 &spi2_sck_pa12 &spi2_miso_pb14 &spi2_mosi_pb15>; pinctrl-names = "default"; diff --git a/boards/arm/stm32f769i_disco/stm32f769i_disco.yaml b/boards/arm/stm32f769i_disco/stm32f769i_disco.yaml index 520d6437ef5..0377147bf83 100644 --- a/boards/arm/stm32f769i_disco/stm32f769i_disco.yaml +++ b/boards/arm/stm32f769i_disco/stm32f769i_disco.yaml @@ -17,3 +17,4 @@ supported: - arduino_gpio - netif:eth - memc + - kscan:touch