Skip to content

levalyukov/ili9341

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ILI9341 Library

Basic library for ILI9341 display on ESP-IDF. The display is connected using the SPI interface.

During the development process, I used the technical documentation (provided below), analyzed the code of working libraries (Adafruit ILI9341, TFT_eSPI) and reddit.com/r/esp32:

Methods

Initializing the display

esp_err_t ili9341_setup(gpio_num_t _cs, gpio_num_t _dc, 
  gpio_num_t _reset, gpio_num_t _miso, gpio_num_t _mosi, gpio_num_t _sclk);

Connecting the display using the SPI interface

esp_err_t ili9341_spi_connect(void);

Sending command on the display

esp_err_t ili9341_write_command(uint16_t cmd);

Sending data on the display

esp_err_t ili9341_write_command(uint16_t cmd);

Hardware reset the display

void ili9341_reset(void);

Setting the rendering window

esp_err_t ili9341_set_address_window(uint16_t x, uint16_t y, uint16_t height, uint16_t width);

Drawing pixel on the display

esp_err_t ili9341_draw_pixel(uint16_t x, uint16_t y, uint16_t color);

Example code

#include "ili9341.h"

void app_main(void) {
  ili9341_setup(33, 4, 12, 32, 19, 23, 18);
  for (int i = 0; i < 32; i++) {
    for (int j = 0; j < 32; j++) {
      ili9341_draw_pixel(i,j,0xF800);
    };
  };
};

Result:

About

Basic library for the ILI9341 display on ESP-IDF.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages