#pragma once

#include <stdbool.h>
#include <stdint.h>

#include "esp_err.h"

#ifdef __cplusplus
extern "C" {
#endif

#define DISPLAY_WIDTH 320
#define DISPLAY_HEIGHT 240

#define RGB565_BLACK 0x0000
#define RGB565_WHITE 0xFFFF
#define RGB565_RED 0xF800
#define RGB565_GREEN 0x07E0
#define RGB565_BLUE 0x001F
#define RGB565_YELLOW 0xFFE0
#define RGB565_CYAN 0x07FF
#define RGB565_MAGENTA 0xF81F
#define RGB565_DIM_GRAY 0x4208

esp_err_t display_init(void);
esp_err_t display_clear(uint16_t color);
esp_err_t display_fill_rect(int x, int y, int w, int h, uint16_t color);
esp_err_t display_draw_text(int x, int y, const char *text, uint16_t fg, uint16_t bg);
esp_err_t display_draw_text_small(int x, int y, const char *text, uint16_t fg, uint16_t bg);
esp_err_t display_draw_text_centered(int y, const char *text, uint16_t fg, uint16_t bg);
esp_err_t display_draw_text_small_centered(int y, const char *text, uint16_t fg, uint16_t bg);
esp_err_t display_draw_text_inverse(int x, int y, const char *text, uint16_t bg, uint16_t fg);
esp_err_t display_draw_button_status(int btn_id, bool pressed);

#ifdef __cplusplus
}
#endif
