2022-03-21 17:02:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "drivers/st7789/st7789.hpp"
|
|
|
|
#include "libraries/pico_graphics/pico_graphics.hpp"
|
|
|
|
|
|
|
|
namespace pimoroni {
|
|
|
|
|
|
|
|
class ST7789Generic : public PicoGraphics {
|
|
|
|
private:
|
|
|
|
ST7789 st7789;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ST7789Generic(int width, int height, BG_SPI_SLOT slot, uint16_t *frame_buffer = nullptr);
|
2022-05-12 16:02:56 +01:00
|
|
|
ST7789Generic(int width, int height, uint16_t *frame_buffer = nullptr);
|
2022-03-21 17:02:46 +00:00
|
|
|
ST7789Generic(uint16_t width, uint16_t height, spi_inst_t *spi,
|
|
|
|
uint cs, uint dc, uint sck, uint mosi, uint miso = PIN_UNUSED, uint bl = PIN_UNUSED,
|
|
|
|
uint16_t *frame_buffer = nullptr);
|
|
|
|
|
|
|
|
spi_inst_t* get_spi() const;
|
|
|
|
int get_cs() const;
|
|
|
|
int get_dc() const;
|
|
|
|
int get_sck() const;
|
|
|
|
int get_mosi() const;
|
|
|
|
int get_bl() const;
|
|
|
|
|
|
|
|
void update();
|
|
|
|
void flip();
|
|
|
|
void set_backlight(uint8_t brightness);
|
2022-05-12 12:04:55 +01:00
|
|
|
void configure_display(bool rotate180);
|
2022-03-21 17:02:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|