#ifndef __ST7789_H__
#define __ST7789_H__

#include <cstdint>
#include "gpio_interface.h"
#include "spi_interface.h"

class St7789
{
public:
    St7789(pinetime::interfaces::SpiInterface &,
           pinetime::interfaces::GpioInterface &,
           pinetime::interfaces::GpioInterface &,
           pinetime::interfaces::GpioInterface &);

    void init();
    void clear(uint16_t Color);

private:
    pinetime::interfaces::SpiInterface & spi;
    pinetime::interfaces::GpioInterface & reset;
    pinetime::interfaces::GpioInterface & data_command;
    pinetime::interfaces::GpioInterface & backlight;

    void send_cmd(uint8_t);
    void send_data(uint8_t);
    void set_windows(uint16_t x_start, uint16_t y_start, uint16_t x_end, uint16_t y_end);
};

#endif
