Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 26 additions & 0 deletions components/lcd/esp_lcd_ili9341/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,29 @@ Alternatively, you can create `idf_component.yml`. More is in [Espressif's docum
```

There is an example in ESP-IDF with this LCD controller. Please follow this [link](https://github.com/espressif/esp-idf/tree/master/examples/peripherals/lcd/spi_lcd_touch).

## Predefined init vendor commands

This driver contains various predefined vendor initialization commands which in some cases can improve image quality. Usage is in example below.

Include selected commands:
```c
#include "esp_lcd_ili9341_init_cmds_1.h"
```

Use vendor config structure:
```c
...

ili9341_vendor_config_t vendor_config = {
.init_cmds = ili9341_lcd_init_vendor,
.init_cmds_size = sizeof(ili9341_lcd_init_vendor) / sizeof(ili9341_lcd_init_cmd_t),
};

const esp_lcd_panel_dev_config_t panel_config = {
...
.vendor_config = &vendor_config,
};

...
```
2 changes: 1 addition & 1 deletion components/lcd/esp_lcd_ili9341/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2.0.1"
version: "2.0.2"
description: ESP LCD ILI9341
url: https://github.com/espressif/esp-bsp/tree/master/components/lcd/esp_lcd_ili9341
dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief ESP LCD: ILI9341 Init Commands 1
*/

#pragma once
#include "esp_lcd_ili9341.h"

static const ili9341_lcd_init_cmd_t ili9341_lcd_init_vendor[] = {
// {cmd, { data }, data_size, delay_ms}
/* Power control B */
{0xCF, (uint8_t []){0x00, 0xC1, 0x30}, 3, 0},
/* Power on sequence control */
{0xED, (uint8_t []){0x64, 0x03, 0x12, 0x81}, 4, 0},
/* Driver timing control A */
{0xE8, (uint8_t []){0x85, 0x00, 0x78}, 3, 0},
/* Power control A */
{0xCB, (uint8_t []){0x39, 0x2C, 0x00, 0x34, 0x02}, 5, 0},
/* Pump ratio control */
{0xF7, (uint8_t []){0x20}, 1, 0},
/* Driver timing control */
{0xEA, (uint8_t []){0x00, 0x00}, 2, 0},
/* Power control 1 */
{0xC0, (uint8_t []){0x10}, 1, 0},
/* Power control 2 */
{0xC1, (uint8_t []){0x00}, 1, 0},
/* VCOM control 1 */
{0xC5, (uint8_t []){0x30, 0x30}, 2, 0},
/* VCOM control 2 */
{0xC7, (uint8_t []){0xB7}, 1, 0},
/* Frame rate control */
{0xB1, (uint8_t []){0x00, 0x1A}, 2, 0},
/* Enable 3G */
{0xF2, (uint8_t []){0x00}, 1, 0},
/* Gamma set */
{0x26, (uint8_t []){0x01}, 1, 0},
/* Positive gamma correction */
{0xE0, (uint8_t []){0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00}, 15, 0}, // Adjusted for ILI9341_2_DRIVER
/* Negative gamma correction */
{0xE1, (uint8_t []){0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F}, 15, 0}, // Adjusted for ILI9341_2_DRIVER
/* Entry mode set */
{0xB7, (uint8_t []){0x07}, 1, 0},
/* Display function control */
{0xB6, (uint8_t []){0x08, 0x82, 0x27}, 3, 0},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief ESP LCD: ILI9341 Init Commands 1
*/

#pragma once
#include "esp_lcd_ili9341.h"

static const ili9341_lcd_init_cmd_t ili9341_lcd_init_vendor[] = {
{0xC8, (uint8_t []){0xFF, 0x93, 0x42}, 3, 0},
{0xC0, (uint8_t []){0x0E, 0x0E}, 2, 0},
{0xC5, (uint8_t []){0xD0}, 1, 0},
{0xC1, (uint8_t []){0x02}, 1, 0},
{0xB4, (uint8_t []){0x02}, 1, 0},
{0xE0, (uint8_t []){0x00, 0x03, 0x08, 0x06, 0x13, 0x09, 0x39, 0x39, 0x48, 0x02, 0x0a, 0x08, 0x17, 0x17, 0x0F}, 15, 0},
{0xE1, (uint8_t []){0x00, 0x28, 0x29, 0x01, 0x0d, 0x03, 0x3f, 0x33, 0x52, 0x04, 0x0f, 0x0e, 0x37, 0x38, 0x0F}, 15, 0},

{0xB1, (uint8_t []){00, 0x1B}, 2, 0},
{0x36, (uint8_t []){0x08}, 1, 0},
{0x3A, (uint8_t []){0x55}, 1, 0},
{0xB7, (uint8_t []){0x06}, 1, 0},

{0x11, (uint8_t []){0}, 0x80, 0},
{0x29, (uint8_t []){0}, 0x80, 0},

{0, (uint8_t []){0}, 0xff, 0},
};
Loading