roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
st7789.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
7
8namespace roo_display {
9namespace st7789 {
10
12
13struct Init {
14 template <typename Target>
16 uint16_t yend, bool inverted) const {
17 t.writeCommand(st77xx::SWRESET, {}, 150);
18 t.writeCommand(st77xx::SLPOUT, {}, 500);
19 t.writeCommand(st77xx::COLMOD, {0x55}, 10);
20 t.writeCommand(st77xx::MADCTL, {0x08});
21 t.writeCommand(st77xx::CASET,
22 {(uint8_t)(xstart >> 8), (uint8_t)(xstart & 0xFF),
23 (uint8_t)(xend >> 8), (uint8_t)(xend & 0xFF)});
24 t.writeCommand(st77xx::RASET,
25 {(uint8_t)(ystart >> 8), (uint8_t)(ystart & 0xFF),
26 (uint8_t)(yend >> 8), (uint8_t)(yend & 0xFF)});
27 t.writeCommand(inverted ? st77xx::INVON : st77xx::INVOFF);
28 t.writeCommand(st77xx::NORON, {}, 10);
29 t.writeCommand(st77xx::DISPON, {}, 500);
30 }
31};
32
33} // namespace st7789
34
35template <typename Transport, int16_t display_width, int16_t display_height,
36 int16_t lpad = 0, int16_t tpad = 0, int16_t rpad = lpad,
37 int16_t bpad = tpad>
40 lpad, tpad, rpad, bpad, true>>;
41
42template <int pinCS, int pinDC, int pinRST, int16_t display_width,
44 int16_t rpad = lpad, int16_t bpad = tpad, typename Spi = DefaultSpi,
46 typename Gpio = DefaultGpio>
50
51template <int pinCS, int pinDC, int pinRST, typename Spi = DefaultSpi,
54 St7789spi_Generic<pinCS, pinDC, pinRST, 240, 240, 0, 0, 0, 80, Spi,
56
57template <int pinCS, int pinDC, int pinRST, typename Spi = DefaultSpi,
59 typename Gpio = DefaultGpio>
61 20, 0, 0, Spi, SpiSettings, Gpio>;
62
63template <int pinCS, int pinDC, int pinRST, typename Spi = DefaultSpi,
65 typename Gpio = DefaultGpio>
67 St7789spi_Generic<pinCS, pinDC, pinRST, 172, 320, 34, 0, 34, 0, Spi,
69
70template <int pinCS, int pinDC, int pinRST, typename Spi = DefaultSpi,
72 typename Gpio = DefaultGpio>
74 St7789spi_Generic<pinCS, pinDC, pinRST, 135, 240, 0, 40, 53, 0, Spi,
76
77} // namespace roo_display
SpiSettings< 40000000, kSpiMsbFirst, kSpiMode3 > DefaultSpiSettings
Definition st7789.h:11
Defines 140 opaque HTML named colors.
void init(Target &t, uint16_t xstart, uint16_t xend, uint16_t ystart, uint16_t yend, bool inverted) const
Definition st7789.h:15