SSD1306/SH1106 driver for esp-idf
I used this repository as a reference.
I used this font file.
esp-idf v4.4/v5.0/v5.1.
Note for ESP32C2.
ESP-IDF V5.0 ESP32C2 i2c driver has a bug.
ESP-IDF V5.1 is required when using ESP32C2.
git clone https://github.com/nopnop2002/esp-idf-ssd1306
cd esp-idf-ssd1306/TextDemo/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3}
idf.py menuconfig
idf.py flash
Note for ESP32C3
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.
You have to set this config value with menuconfig.
- CONFIG_INTERFACE
- CONFIG_PANEL
- CONFIG_OFFSETX
- CONFIG_FLIP
- CONFIG_SDA_GPIO
- CONFIG_SCL_GPIO
- CONFIG_RESET_GPIO
- CONFIG_MOSI_GPIO
- CONFIG_SCLK_GPIO
- CONFIG_CS_GPIO
- CONFIG_DC_GPIO
Hardware scroll Not support
Left:1.3 inch SH1106
Right:0.96 inch SSD1306
Unlike other ESP32 development boards, the RTC_CLOCK crystal on this board uses a 26MHz one.
You need to change the RTC CLOCK frequency to 26MHz using menuconfig.
D0 is SCLK.
D1 is MOSI.
Hardware scroll Not support
Left:1.3 inch SH1106
Right:0.96 inch SSD1306
The ESP32 series has three SPI BUSs.
SPI1_HOST is used for communication with Flash memory.
You can use SPI2_HOST and SPI3_HOST freely.
When you use SDSPI(SD Card via SPI), SDSPI uses SPI2_HOST BUS.
When using this module at the same time as SDSPI or other SPI device using SPI2_HOST, it needs to be changed to SPI3_HOST.
When you don't use SDSPI, both SPI2_HOST and SPI3_HOST will work.
Previously it was called HSPI_HOST / VSPI_HOST, but now it is called SPI2_HOST / SPI3_HOST.