From 771584e4e31e05cc1f14fd402c059cc3b636b7d6 Mon Sep 17 00:00:00 2001 From: Jean Pierre Dudey Date: Tue, 3 Nov 2020 15:04:27 +0100 Subject: [PATCH] boards/esp32-wrover-kit: add ILI9341 driver params Signed-off-by: Jean Pierre Dudey --- boards/esp32-wrover-kit/include/board.h | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/boards/esp32-wrover-kit/include/board.h b/boards/esp32-wrover-kit/include/board.h index 55ac148101..c03117118c 100644 --- a/boards/esp32-wrover-kit/include/board.h +++ b/boards/esp32-wrover-kit/include/board.h @@ -97,6 +97,32 @@ #endif /** @} */ +/** + * @name LCD configuration + * + * This configuration cannot be changed. + * @{ + */ +#if MODULE_ILI9341 || DOXYGEN +#define LCD_CS GPIO22 +#define LCD_RST GPIO18 +#define LCD_DC GPIO21 +#define LCD_BACKLIGHT GPIO5 + +#define BACKLIGHT_ON gpio_clear(LCD_BACKLIGHT) +#define BACKLIGHT_OFF gpio_set(LCD_BACKLIGHT) + +#define ILI9341_PARAM_SPI SPI_DEV(1) +#define ILI9341_PARAM_SPI_CLK SPI_CLK_10MHZ +#define ILI9341_PARAM_CS LCD_CS +#define ILI9341_PARAM_DCX LCD_DC +#define ILI9341_PARAM_RST LCD_RST +#define ILi9341_PARAM_RGB 1 +#define ILI9341_PARAM_INVERTED 1 +#endif +/** @} */ + + /* include common board definitions as last step */ #include "board_common.h" @@ -108,6 +134,10 @@ extern "C" { * @brief Initialize the board specific hardware */ static inline void board_init(void) { +#if MODULE_ILI9341 + gpio_init(LCD_BACKLIGHT, GPIO_OUT); +#endif + /* there is nothing special to initialize on this board */ board_init_common(); }