2021-03-30 13:51:00 +01:00
|
|
|
#include "breakout_roundlcd.hpp"
|
|
|
|
|
|
|
|
namespace pimoroni {
|
|
|
|
|
|
|
|
BreakoutRoundLCD::BreakoutRoundLCD(uint16_t *buf)
|
2022-05-12 18:40:37 +01:00
|
|
|
: PicoGraphics(WIDTH, HEIGHT, buf), screen(WIDTH, HEIGHT, true, buf,
|
|
|
|
PIMORONI_SPI_DEFAULT_INSTANCE, SPI_BG_FRONT_CS, SPI_DEFAULT_MISO, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, SPI_BG_FRONT_PWM) {
|
2021-03-30 13:51:00 +01:00
|
|
|
__fb = buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
BreakoutRoundLCD::BreakoutRoundLCD(uint16_t *buf, spi_inst_t *spi,
|
2022-05-12 18:40:37 +01:00
|
|
|
uint cs, uint dc, uint sck, uint mosi, uint bl)
|
|
|
|
: PicoGraphics(WIDTH, HEIGHT, buf), screen(WIDTH, HEIGHT, true, buf, spi, cs, dc, sck, mosi, bl) {
|
2021-04-19 16:36:31 +01:00
|
|
|
__fb = buf;
|
|
|
|
}
|
|
|
|
|
2022-05-12 18:40:37 +01:00
|
|
|
BreakoutRoundLCD::BreakoutRoundLCD(uint16_t *buf, BG_SPI_SLOT slot)
|
|
|
|
: PicoGraphics(WIDTH, HEIGHT, buf), screen(WIDTH, HEIGHT, true, buf,
|
|
|
|
PIMORONI_SPI_DEFAULT_INSTANCE, screen.get_slot_cs(slot), SPI_DEFAULT_MISO, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, screen.get_slot_bl(slot)) {
|
2021-03-30 13:51:00 +01:00
|
|
|
__fb = buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BreakoutRoundLCD::init() {
|
|
|
|
}
|
|
|
|
|
2021-03-30 15:15:13 +01:00
|
|
|
spi_inst_t* BreakoutRoundLCD::get_spi() const {
|
|
|
|
return screen.get_spi();
|
|
|
|
}
|
2021-03-30 13:51:00 +01:00
|
|
|
|
2021-03-30 15:15:13 +01:00
|
|
|
int BreakoutRoundLCD::get_cs() const {
|
|
|
|
return screen.get_cs();
|
|
|
|
}
|
2021-03-30 13:51:00 +01:00
|
|
|
|
2021-03-30 15:15:13 +01:00
|
|
|
int BreakoutRoundLCD::get_dc() const {
|
|
|
|
return screen.get_dc();
|
|
|
|
}
|
2021-03-30 13:51:00 +01:00
|
|
|
|
2021-03-30 15:15:13 +01:00
|
|
|
int BreakoutRoundLCD::get_sck() const {
|
|
|
|
return screen.get_sck();
|
|
|
|
}
|
2021-03-30 13:51:00 +01:00
|
|
|
|
2021-03-30 15:15:13 +01:00
|
|
|
int BreakoutRoundLCD::get_mosi() const {
|
|
|
|
return screen.get_mosi();
|
|
|
|
}
|
2021-03-30 13:51:00 +01:00
|
|
|
|
2021-03-30 15:15:13 +01:00
|
|
|
int BreakoutRoundLCD::get_bl() const {
|
|
|
|
return screen.get_bl();
|
|
|
|
}
|
2021-03-30 13:51:00 +01:00
|
|
|
|
|
|
|
void BreakoutRoundLCD::update() {
|
|
|
|
screen.update();
|
|
|
|
}
|
|
|
|
|
|
|
|
void BreakoutRoundLCD::set_backlight(uint8_t brightness) {
|
|
|
|
screen.set_backlight(brightness);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|