new ver
This commit is contained in:
@@ -14,6 +14,9 @@ const gfx_canvas_t canvas = {
|
|||||||
.ctx = &dev,
|
.ctx = &dev,
|
||||||
.draw_pixel_callback = st7567_draw_pixel,
|
.draw_pixel_callback = st7567_draw_pixel,
|
||||||
.clear_pixel_callback = st7567_clear_pixel,
|
.clear_pixel_callback = st7567_clear_pixel,
|
||||||
|
.clear_disp_callback = st7567_clear,
|
||||||
|
.clear_fb_callback = st7567_clear_buffer,
|
||||||
|
.flush_callback = st7567_update_screen
|
||||||
};
|
};
|
||||||
|
|
||||||
const GFXfont *font = &NokiaBig;
|
const GFXfont *font = &NokiaBig;
|
||||||
|
|||||||
@@ -113,4 +113,16 @@ void gfx_draw_bitmap(const gfx_canvas_t *canvas, const uint8_t pos_x, const uint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_flush(const gfx_canvas_t *canvas) {
|
||||||
|
canvas->flush_callback(canvas->ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_clear_disp(const gfx_canvas_t *canvas) {
|
||||||
|
canvas->clear_disp_callback(canvas->ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_clear_fb(const gfx_canvas_t *canvas) {
|
||||||
|
canvas->clear_fb_callback(canvas->ctx);
|
||||||
}
|
}
|
||||||
@@ -34,10 +34,16 @@ typedef struct {
|
|||||||
* @param ctx any context that the draw/clear functions might need, ie display device
|
* @param ctx any context that the draw/clear functions might need, ie display device
|
||||||
* @param draw_pixel_callback function that gets called to draw a pixel
|
* @param draw_pixel_callback function that gets called to draw a pixel
|
||||||
* @param clear_pixel_callback function that gets called to clear a pixel
|
* @param clear_pixel_callback function that gets called to clear a pixel
|
||||||
|
* @param flush_callback function that gets called to flush the buffer to the display, optional
|
||||||
|
* @param clear_disp_callback function to send the clear command to the display, optional
|
||||||
|
* @param clear_fb_callback function that wipes the framebuffer memory of the display, optional
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*draw_pixel_callback)(void *ctx, uint8_t x, uint8_t y);
|
void (*draw_pixel_callback)(void *ctx, uint8_t x, uint8_t y);
|
||||||
void (*clear_pixel_callback)(void *ctx, uint8_t x, uint8_t y);
|
void (*clear_pixel_callback)(void *ctx, uint8_t x, uint8_t y);
|
||||||
|
void (*flush_callback)(void *ctx);
|
||||||
|
void (*clear_disp_callback)(void *ctx);
|
||||||
|
void (*clear_fb_callback)(void *ctx);
|
||||||
void *ctx;
|
void *ctx;
|
||||||
} gfx_canvas_t;
|
} gfx_canvas_t;
|
||||||
|
|
||||||
@@ -49,3 +55,6 @@ void gfx_draw_line(const gfx_canvas_t *canvas, uint8_t start_x, uint8_t start_y,
|
|||||||
void gfx_draw_box(const gfx_canvas_t *canvas, uint8_t pos_x, uint8_t pos_y, uint8_t size_x, uint8_t size_y, bool inverted);
|
void gfx_draw_box(const gfx_canvas_t *canvas, uint8_t pos_x, uint8_t pos_y, uint8_t size_x, uint8_t size_y, bool inverted);
|
||||||
void gfx_fill_box(const gfx_canvas_t *canvas, uint8_t pos_x, uint8_t pos_y, uint8_t size_x, uint8_t size_y, bool inverted);
|
void gfx_fill_box(const gfx_canvas_t *canvas, uint8_t pos_x, uint8_t pos_y, uint8_t size_x, uint8_t size_y, bool inverted);
|
||||||
void gfx_draw_bitmap(const gfx_canvas_t *canvas, uint8_t pos_x, uint8_t pos_y, gfx_bitmap_t bmp, bool inverted);
|
void gfx_draw_bitmap(const gfx_canvas_t *canvas, uint8_t pos_x, uint8_t pos_y, gfx_bitmap_t bmp, bool inverted);
|
||||||
|
void gfx_flush(const gfx_canvas_t *canvas);
|
||||||
|
void gfx_clear_disp(const gfx_canvas_t *canvas);
|
||||||
|
void gfx_clear_fb(const gfx_canvas_t *canvas);
|
||||||
@@ -2,4 +2,4 @@ dependencies:
|
|||||||
idf: '>=5.2'
|
idf: '>=5.2'
|
||||||
description: Simple gfx library for ESP-IDF
|
description: Simple gfx library for ESP-IDF
|
||||||
url: https://git.drath.cc/drath/esp-gfx.git
|
url: https://git.drath.cc/drath/esp-gfx.git
|
||||||
version: "1.1.2"
|
version: "1.2.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user