kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Added portrait mode (building with the work from hamid-elaosta:portrait)
rodzic
baf16fc332
commit
1993d403e5
|
@ -58,6 +58,10 @@ namespace pimoroni {
|
|||
madctl[0] = 0x70;
|
||||
}
|
||||
|
||||
if(width == 135 && height == 240) {
|
||||
madctl[0] = 0x00;
|
||||
}
|
||||
|
||||
command(reg::MADCTL, 1, madctl); // row/column addressing order - rgb pixel order
|
||||
command(reg::TEON, 1, "\x00"); // enable frame sync signal if used
|
||||
command(reg::COLMOD, 1, "\x05"); // 16 bits per pixel
|
||||
|
@ -78,6 +82,11 @@ namespace pimoroni {
|
|||
command(reg::RASET, 4, "\x00\x35\x00\xbb"); // 53 .. 187 (135 rows)
|
||||
command(reg::CASET, 4, "\x00\x28\x01\x17"); // 40 .. 279 (240 columns)
|
||||
}
|
||||
|
||||
if(width == 135 && height == 240) {
|
||||
command(reg::CASET, 4, "\x00\x34\x00\xba"); // 52 .. 186 (135 rows)
|
||||
command(reg::RASET, 4, "\x00\x28\x01\x17"); // 40 .. 279 (240 columns)
|
||||
}
|
||||
}
|
||||
|
||||
// the dma transfer works but without vsync it's not that useful as you could
|
||||
|
|
|
@ -17,6 +17,11 @@ namespace pimoroni {
|
|||
__fb = buf;
|
||||
}
|
||||
|
||||
PicoDisplay::PicoDisplay(uint16_t *buf, int width, int height)
|
||||
: PicoGraphics(width, height, buf), screen(width, height, buf) {
|
||||
__fb = buf;
|
||||
}
|
||||
|
||||
void PicoDisplay::init() {
|
||||
// setup the rgb led for pwm control
|
||||
pwm_config cfg = pwm_get_default_config();
|
||||
|
|
|
@ -9,6 +9,8 @@ namespace pimoroni {
|
|||
public:
|
||||
static const int WIDTH = 240;
|
||||
static const int HEIGHT = 135;
|
||||
static const int PORTRAIT_WIDTH = 135;
|
||||
static const int PORTRAIT_HEIGHT = 240;
|
||||
static const uint8_t A = 12;
|
||||
static const uint8_t B = 13;
|
||||
static const uint8_t X = 14;
|
||||
|
@ -20,6 +22,7 @@ namespace pimoroni {
|
|||
|
||||
public:
|
||||
PicoDisplay(uint16_t *buf);
|
||||
PicoDisplay(uint16_t *buf, int width, int height);
|
||||
|
||||
void init();
|
||||
void update();
|
||||
|
|
Ładowanie…
Reference in New Issue