This commit is contained in:
2026-08-20 07:48:24 +02:00
parent 562d4e7148
commit 2ded15091f

View File

@@ -1,11 +1,15 @@
# ST7567 I2C display driver
# ST7567 display driver
For esp-idf, same idea as the st7920 driver
This is the I2C version, also see [SPI version](https://git.drath.cc/drath/esp-st7567-spi)
For both SPI and I2C displays
## Usage
I2C version
```c
#include <st7567/st7567-i2c.h>
i2c_master_bus_config_t bus_cfg = {
.i2c_port = I2C_NUM_0,
.sda_io_num = GPIO_NUM_21,
@@ -27,6 +31,19 @@ st7567_device_t dev;
st7567_init(&cfg, &dev);
st7567_set_backlight(&dev, true);
st7567_draw_pixel(&dev, 10, 10);
st7567_update_screen(&dev);
```
SPI version
```c
#include <st7567/st7567-spi.h>
st7567_device_t dev;
st7567_init(&cfg, &dev);
st7567_set_backlight(&dev, true);
st7567_draw_pixel(&dev, 10, 10);
st7567_update_screen(&dev);
```