diff --git a/README.md b/README.md index 400b5e6..34c3c41 100644 --- a/README.md +++ b/README.md @@ -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 + 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_device_t dev; +st7567_init(&cfg, &dev); +st7567_set_backlight(&dev, true); + st7567_draw_pixel(&dev, 10, 10); st7567_update_screen(&dev); ``` \ No newline at end of file