/esp-idf-st7565

ST7565 Driver for esp-idf

Primary LanguageCMIT LicenseMIT

esp-idf-st7565

ST7565 Driver for esp-idf

st7565-11 st7565-19

Software requirements

esp-idf v4.4 or later.
This is because this version supports ESP32-C3.

Hardware requirements

ST7565 Graphic LCD Module with SPI interface.
I bought it on AliExpress.
The chip resistor behind it allows you to change the interface to parallel and SPI.

st7565-1

Installation

git clone https://github.com/nopnop2002/esp-idf-st7565
cd esp-idf-st7565/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c3}
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

config-1

config-2

Wireing

ST7565 ESP32 ESP32S2/S3 ESP32C3
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.

st7565-12 st7565-13 st7565-14 st7565-15 st7565-16 st7565-17 st7565-18

Font File

I am using this font.