2021-04-23 00:44:27 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-05-13 12:06:01 +01:00
|
|
|
#include "drivers/st7789/st7789.hpp"
|
|
|
|
#include "libraries/pico_graphics/pico_graphics.hpp"
|
2021-05-14 18:12:37 +01:00
|
|
|
#include "common/pimoroni_common.hpp"
|
2021-04-23 00:44:27 +01:00
|
|
|
|
|
|
|
namespace pimoroni {
|
|
|
|
|
|
|
|
class BreakoutColourLCD240x240 : public PicoGraphics {
|
|
|
|
//--------------------------------------------------
|
|
|
|
// Constants
|
|
|
|
//--------------------------------------------------
|
|
|
|
public:
|
|
|
|
static const int WIDTH = 240;
|
|
|
|
static const int HEIGHT = 240;
|
|
|
|
|
|
|
|
//--------------------------------------------------
|
|
|
|
// Variables
|
|
|
|
//--------------------------------------------------
|
|
|
|
public:
|
|
|
|
uint16_t *__fb;
|
|
|
|
private:
|
|
|
|
ST7789 screen;
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------
|
|
|
|
// Constructors/Destructor
|
|
|
|
//--------------------------------------------------
|
|
|
|
public:
|
|
|
|
BreakoutColourLCD240x240(uint16_t *buf);
|
|
|
|
BreakoutColourLCD240x240(uint16_t *buf, spi_inst_t *spi,
|
2021-05-17 11:08:23 +01:00
|
|
|
uint cs, uint dc, uint sck, uint mosi, uint miso = PIN_UNUSED, uint bl = PIN_UNUSED);
|
2021-04-20 10:54:10 +01:00
|
|
|
BreakoutColourLCD240x240(uint16_t *buf, BG_SPI_SLOT slot);
|
2021-04-23 00:44:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------
|
|
|
|
// Methods
|
|
|
|
//--------------------------------------------------
|
|
|
|
public:
|
|
|
|
void init();
|
|
|
|
|
|
|
|
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 set_backlight(uint8_t brightness);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|