From fef50d428ed621065af642d1c83d469bbc647035 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Wed, 9 Aug 2023 10:46:37 +0200 Subject: [PATCH] boards/stm32l496g-disco: enable touch panel --- boards/stm32l496g-disco/board.c | 3 ++- boards/stm32l496g-disco/include/board.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/boards/stm32l496g-disco/board.c b/boards/stm32l496g-disco/board.c index 5451529b5b..27f8efff5a 100644 --- a/boards/stm32l496g-disco/board.c +++ b/boards/stm32l496g-disco/board.c @@ -23,7 +23,8 @@ void board_init(void) #if MODULE_ST77XX /* initialize the pin for the HIGH active LCD_BL signal */ gpio_init(BACKLIGHT_PIN, GPIO_OUT); - +#endif +#if MODULE_ST77XX || MODULE_FT5X06 /* enable VDD_LCD by the LOW active LCD_PWR_ON signal connected to PH0 */ gpio_init(LCD_DISP_PIN, GPIO_OUT); gpio_clear(LCD_DISP_PIN); diff --git a/boards/stm32l496g-disco/include/board.h b/boards/stm32l496g-disco/include/board.h index ec9d1d4c60..656450fa19 100644 --- a/boards/stm32l496g-disco/include/board.h +++ b/boards/stm32l496g-disco/include/board.h @@ -124,6 +124,21 @@ extern "C" { #define ST77XX_PARAM_RGB_CHANNELS LCD_SCREEN_WIDTH /**< ST77xx number of channels */ /** @} */ +/** + * @name Touch panel configuration + * + * The board uses a FT6236 touch panel driver IC. + * + * @{ + */ +#define FT5X06_PARAM_I2C_DEV I2C_DEV(1) /**< I2C device */ +#define FT5X06_PARAM_INT_PIN GPIO_PIN(PORT_G, 14) /**< Interrupt pin */ +#define FT5X06_PARAM_XMAX LCD_SCREEN_WIDTH /**< Max width */ +#define FT5X06_PARAM_YMAX LCD_SCREEN_HEIGHT /**< Max height */ +#define FT5X06_PARAM_TYPE FT5X06_TYPE_FT6X36 /**< Device type */ +#define FT5X06_PARAM_XYCONV FT5X06_SWAP_XY | FT5X06_MIRROR_Y /**< Swap XY, then mirror Y */ +/** @} */ + /** * @name LED pin definitions and handlers *