#pragma once

#include <stdint.h>

#include "esp_err.h"

#define ILI9341_COLOR_BLACK 0x0000
#define ILI9341_COLOR_WHITE 0xFFFF
#define ILI9341_COLOR_RED   0xF800
#define ILI9341_COLOR_GREEN 0x07E0
#define ILI9341_COLOR_BLUE  0x001F

esp_err_t ili9341_init(void);
void ili9341_fill_screen(uint16_t color);
esp_err_t ili9341_draw_pixel(uint16_t x, uint16_t y, uint16_t color);
esp_err_t ili9341_blit_rgb565(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint8_t *rgb565_be);
void ili9341_draw_text(int x, int y, const char *text, uint16_t fg, uint16_t bg);
