sh1107 Driver for esp-idf
I used this font file.
ESP-IDF V4.4/V5.x.
Note for ESP32C2.
ESP-IDF V5.0 ESP32C2 i2c driver has a bug.
ESP-IDF V5.1 is required when using i2c of ESP32C2.
Note for ESP32C6.
ESP-IDF V5.1 is required when using ESP32C6.
git clone https://github.com/nopnop2002/esp-idf-sh1107
cd esp-idf-sh1107/TextDemo/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash
You have to set this config value with menuconfig.
- CONFIG_INTERFACE
- CONFIG_SDA_GPIO
- CONFIG_SCL_GPIO
- CONFIG_RESET_GPIO
- CONFIG_MOSI_GPIO
- CONFIG_SCLK_GPIO
- CONFIG_CS_GPIO
- CONFIG_DC_GPIO
Wirering
sh1107 | ESP32 | ESP32-S2/S3 | ESP32-C2/C3/C6 | |
---|---|---|---|---|
CS | -- | GPIO14 | GPIO34 | GPIO3 |
DC | -- | GPIO27 | GPIO37 | GPIO2 |
RESET | -- | GPIO33 | GPIO33 | GPI10 |
MOSI | -- | GPIO23 | GPIO35 | GPIO0 |
SCLK | -- | GPIO18 | GPIO36 | GPIO1 |
GND | -- | GND | GND | GND |
VCC | -- | 3.3V | 3.3V | 3.3V |
You can change it to any pin using menuconfig.
Note
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.
Wirering
sh1107 | ESP32 | ESP32-S2/S3 | ESP32-C2/C3/C6 | |
---|---|---|---|---|
SCL | -- | GPIO22 | GPIO12 | GPIO6 |
SDA | -- | GPIO21 | GPIO11 | GPIO5 |
GND | -- | GND | GND | GND |
VCC | -- | 3.3V | 3.3V | 3.3V |
You can change it to any pin using menuconfig.