esp-idf-st7565

ST7565 Driver for esp-idf

MIT License

Stars
6

esp-idf-st7565

ST7565 Driver for esp-idf

Software requirements

ESP-IDF V4.4/V5.x. ESP-IDF V5.0 is required when using ESP32-C2. ESP-IDF V5.1 is required when using ESP32-C6.

Hardware requirements

ST7565 Graphic LCD Module with SPI interface. I bought it on AliExpress. You can change the interface to Parallel and SPI by changing the chip resistor on the back, but for this project we will use SPI.

Installation

git clone https://github.com/nopnop2002/esp-idf-st7565
cd esp-idf-st7565/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash

Note for ESP32-C3 For some reason, there are development boards that cannot use GPIO06, GPIO08, GPIO09, GPIO19 for SPI clock pins. According to the ESP32C3 specifications, these pins can also be used as SPI clocks. I used a raw ESP-C3-13 to verify that these pins could be used as SPI clocks.

Configuration

You have to set this config value with menuconfig.

  • CONFIG_WIDTH
  • CONFIG_HEIGHT
  • CONFIG_MOSI_GPIO
  • CONFIG_SCLK_GPIO
  • CONFIG_CS_GPIO
  • CONFIG_DC_GPIO
  • CONFIG_RESET_GPIO
  • CONFIG_BL_GPIO
  • CONFIG_FLIP
  • CONFIG_INVERSION

Wireing

ST7565 ESP32 ESP32S2/S3 ESP32C2/C3/C6
DB0 -- N/C N/C N/C
DB1 -- N/C N/C N/C
DB2 -- N/C N/C N/C
DB3 -- N/C N/C N/C
DB4 -- N/C N/C N/C
DB5 -- N/C N/C N/C
DB6(=SCLK) -- GPIO18(*) GPIO36(*) GPIO1(*)
DB7(=MOSI) -- GPIO23(*) GPIO35(*) GPIO0(*)
VDD -- 3.3V 3.3V 3.3V
VSS -- GND GND GND
LEDA -- GPIO32(*) GPIO33(*) GPIO4(*)
/CS -- GPIO5(*) GPIO34(*) GPIO5(*)
/RES -- GPIO33(*) GPIO41(*) GPIO3(*)
A0 -- GPIO27(*) GPIO40(*) GPIO2(*)
/WR -- N/C N/C N/C
/RD -- N/C N/C N/C

For SPI interfaces, DB6 is the SPI CLOCK. For SPI interfaces, DB7 is the SPI MOSI.

(*) You can change any GPIO using menuconfig.

Font File

I am using this font.