Update README.md
This commit is contained in:
16
README.md
16
README.md
@@ -4,4 +4,18 @@ Will draw Adafruit GFX compatible fonts, lines, squares, and it will also fill a
|
||||
|
||||
Made for ST7920 with my own driver library, but it should be pretty universal, it just needs draw and clear functions taking x,y coords of a pixel + some user context.
|
||||
|
||||
Idk why I added a readme, it's pretty self documenting. Maybe i'll break this into it's own git repo and add it as submodule, along with the disp driver.
|
||||
The API is pretty self-explanatory, but just in case
|
||||
|
||||
```c
|
||||
const gfx_canvas_t canvas = {
|
||||
.ctx = &dev,
|
||||
.draw_pixel_callback = st7567_draw_pixel,
|
||||
.clear_pixel_callback = st7567_clear_pixel,
|
||||
};
|
||||
|
||||
const GFXfont *font = &FreeSans9pt7b;
|
||||
st7567_clear(canvas.ctx);
|
||||
gfx_fill_box(&canvas, 40, 40, 8, 8, false);
|
||||
gfx_draw_string(&canvas, font, 0, 16, "Hello", false);
|
||||
st7567_update_screen(canvas.ctx);
|
||||
```
|
||||
Reference in New Issue
Block a user