This component prvides an implementation of the ILI9342(C) LCD driver using the esp_lcd component API, adapted from Espressif's own ILI9341 component.
| LCD controller | Communication interface | Component name | Link to datasheet |
|---|---|---|---|
| ILI9342 | SPI (half-duplex)* | esp_lcd_ili9342 | Specification |
- As an ESP-IDF component, via
idf.py add-dependency:
idf.py add-dependency "jbrilha/esp_lcd_ili9342^1.1.1"-
Or including in it
idf_component.yml- As a dependency:
dependencies: jbrilha/esp_lcd_ili9342: "^1.1.1"- As a direct repository
dependencies: esp_lcd_ili9342: git: https://github.com/jbrilha/esp_lcd_ili9342.git
This display driver uses half-duplex communication, so instead of the usual MOSI/MISO separation, it uses a single SDA line.
This means that SPI does not require a MISO pin, like below:
void init_lcd_spi() {
spi_bus_config_t bus_cfg = {
.sclk_io_num = LCD_CLK_PIN,
.mosi_io_num = LCD_MOSI_PIN,
.miso_io_num = -1, // set to -1
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.max_transfer_sz = 0;
ESP_ERROR_CHECK(spi_bus_initialize(LCD_HOST, &bus_cfg, SPI_DMA_CH_AUTO));
}If you intend to use other devices that require MISO in the same SPI bus, the bus config should it include it normally.
Only tested on an M5Stack Core Basic (v2.7) as it is its embedded display, but should work with other ESP32 variants as well
An example is present in the examples directory, using LVGL