49 lines
1.8 KiB
C
49 lines
1.8 KiB
C
#ifndef OS_GFX_H
|
|
#define OS_GFX_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "os_oled.h"
|
|
#include "os_status.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define STATUS_BAR_HEIGHT 8
|
|
#define ACTION_BAR_HEIGHT 7
|
|
#define VIEWPORT_Y_TOP 8
|
|
#define VIEWPORT_HEIGHT 32
|
|
#define VIEWPORT_FULL_HEIGHT 40
|
|
|
|
esp_err_t sys_gfx_init(void);
|
|
void sys_gfx_clear(void);
|
|
void sys_gfx_clear_viewport(void);
|
|
esp_err_t sys_gfx_flush(void);
|
|
|
|
void sys_gfx_draw_pixel(int16_t x, int16_t y, uint8_t color);
|
|
void sys_gfx_draw_line(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color);
|
|
void sys_gfx_draw_rect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color);
|
|
void sys_gfx_fill_rect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color);
|
|
void sys_gfx_draw_bitmap(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *bitmap, uint8_t color);
|
|
|
|
void sys_gfx_draw_char_5x7(int16_t x, int16_t y, char c, uint8_t color);
|
|
void sys_gfx_draw_str_5x7(int16_t x, int16_t y, const char *str, uint8_t color);
|
|
void sys_gfx_draw_char_3x5(int16_t x, int16_t y, char c, uint8_t color);
|
|
void sys_gfx_draw_str_3x5(int16_t x, int16_t y, const char *str, uint8_t color);
|
|
|
|
void sys_gfx_draw_status_bar(const sys_status_t *status);
|
|
void sys_gfx_draw_action_bar(const char *left_hint, const char *right_hint);
|
|
void sys_gfx_draw_menu(int16_t y_start, const char *items[], size_t count, size_t selected_idx);
|
|
void sys_gfx_draw_progress_bar(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t pct);
|
|
void sys_gfx_draw_sparkline(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *data, size_t count, uint8_t max_val);
|
|
|
|
void sys_gfx_show_toast(const char *msg, uint32_t duration_ms);
|
|
void sys_gfx_render_toast_if_active(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // OS_GFX_H
|