6 #ifdef USE_POWER_SUPPLY 13 static const uint8_t ST7789_NOP = 0x00;
14 static const uint8_t ST7789_SWRESET = 0x01;
15 static const uint8_t ST7789_RDDID = 0x04;
16 static const uint8_t ST7789_RDDST = 0x09;
17 static const uint8_t ST7789_RDDPM = 0x0A;
18 static const uint8_t ST7789_RDDMADCTL = 0x0B;
19 static const uint8_t ST7789_RDDCOLMOD = 0x0C;
20 static const uint8_t ST7789_RDDIM = 0x0D;
21 static const uint8_t ST7789_RDDSM = 0x0E;
22 static const uint8_t ST7789_RDDSDR = 0x0F;
23 static const uint8_t ST7789_SLPIN = 0x10;
24 static const uint8_t ST7789_SLPOUT = 0x11;
25 static const uint8_t ST7789_PTLON = 0x12;
26 static const uint8_t ST7789_NORON = 0x13;
27 static const uint8_t ST7789_INVOFF = 0x20;
28 static const uint8_t ST7789_INVON = 0x21;
29 static const uint8_t ST7789_GAMSET = 0x26;
30 static const uint8_t ST7789_DISPOFF = 0x28;
31 static const uint8_t ST7789_DISPON = 0x29;
32 static const uint8_t ST7789_CASET = 0x2A;
33 static const uint8_t ST7789_RASET = 0x2B;
34 static const uint8_t ST7789_RAMWR = 0x2C;
35 static const uint8_t ST7789_RAMRD = 0x2E;
36 static const uint8_t ST7789_PTLAR = 0x30;
37 static const uint8_t ST7789_VSCRDEF = 0x33;
38 static const uint8_t ST7789_TEOFF = 0x34;
39 static const uint8_t ST7789_TEON = 0x35;
40 static const uint8_t ST7789_MADCTL = 0x36;
41 static const uint8_t ST7789_VSCSAD = 0x37;
42 static const uint8_t ST7789_IDMOFF = 0x38;
43 static const uint8_t ST7789_IDMON = 0x39;
44 static const uint8_t ST7789_COLMOD = 0x3A;
45 static const uint8_t ST7789_WRMEMC = 0x3C;
46 static const uint8_t ST7789_RDMEMC = 0x3E;
47 static const uint8_t ST7789_STE = 0x44;
48 static const uint8_t ST7789_GSCAN = 0x45;
49 static const uint8_t ST7789_WRDISBV = 0x51;
50 static const uint8_t ST7789_RDDISBV = 0x52;
51 static const uint8_t ST7789_WRCTRLD = 0x53;
52 static const uint8_t ST7789_RDCTRLD = 0x54;
53 static const uint8_t ST7789_WRCACE = 0x55;
54 static const uint8_t ST7789_RDCABC = 0x56;
55 static const uint8_t ST7789_WRCABCMB = 0x5E;
56 static const uint8_t ST7789_RDCABCMB = 0x5F;
57 static const uint8_t ST7789_RDABCSDR = 0x68;
58 static const uint8_t ST7789_RDID1 = 0xDA;
59 static const uint8_t ST7789_RDID2 = 0xDB;
60 static const uint8_t ST7789_RDID3 = 0xDC;
61 static const uint8_t ST7789_RAMCTRL = 0xB0;
62 static const uint8_t ST7789_RGBCTRL = 0xB1;
63 static const uint8_t ST7789_PORCTRL = 0xB2;
64 static const uint8_t ST7789_FRCTRL1 = 0xB3;
65 static const uint8_t ST7789_PARCTRL = 0xB5;
66 static const uint8_t ST7789_GCTRL = 0xB7;
67 static const uint8_t ST7789_GTADJ = 0xB8;
68 static const uint8_t ST7789_DGMEN = 0xBA;
69 static const uint8_t ST7789_VCOMS = 0xBB;
70 static const uint8_t ST7789_LCMCTRL = 0xC0;
71 static const uint8_t ST7789_IDSET = 0xC1;
72 static const uint8_t ST7789_VDVVRHEN = 0xC2;
73 static const uint8_t ST7789_VRHS = 0xC3;
74 static const uint8_t ST7789_VDVS = 0xC4;
75 static const uint8_t ST7789_VCMOFSET = 0xC5;
76 static const uint8_t ST7789_FRCTRL2 = 0xC6;
77 static const uint8_t ST7789_CABCCTRL = 0xC7;
78 static const uint8_t ST7789_REGSEL1 = 0xC8;
79 static const uint8_t ST7789_REGSEL2 = 0xCA;
80 static const uint8_t ST7789_PWMFRSEL = 0xCC;
81 static const uint8_t ST7789_PWCTRL1 = 0xD0;
82 static const uint8_t ST7789_VAPVANEN = 0xD2;
83 static const uint8_t ST7789_CMD2EN = 0xDF;
84 static const uint8_t ST7789_PVGAMCTRL = 0xE0;
85 static const uint8_t ST7789_NVGAMCTRL = 0xE1;
86 static const uint8_t ST7789_DGMLUTR = 0xE2;
87 static const uint8_t ST7789_DGMLUTB = 0xE3;
88 static const uint8_t ST7789_GATECTRL = 0xE4;
89 static const uint8_t ST7789_SPI2EN = 0xE7;
90 static const uint8_t ST7789_PWCTRL2 = 0xE8;
91 static const uint8_t ST7789_EQCTRL = 0xE9;
92 static const uint8_t ST7789_PROMCTRL = 0xEC;
93 static const uint8_t ST7789_PROMEN = 0xFA;
94 static const uint8_t ST7789_NVMSET = 0xFC;
95 static const uint8_t ST7789_PROMACT = 0xFE;
98 static const uint8_t ST7789_MADCTL_MY = 0x80;
99 static const uint8_t ST7789_MADCTL_MX = 0x40;
100 static const uint8_t ST7789_MADCTL_MV = 0x20;
101 static const uint8_t ST7789_MADCTL_ML = 0x10;
102 static const uint8_t ST7789_MADCTL_RGB = 0x00;
103 static const uint8_t ST7789_MADCTL_BGR = 0x08;
104 static const uint8_t ST7789_MADCTL_MH = 0x04;
105 static const uint8_t ST7789_MADCTL_SS = 0x02;
106 static const uint8_t ST7789_MADCTL_GS = 0x01;
108 static const uint8_t ST7789_MADCTL_COLOR_ORDER = ST7789_MADCTL_BGR;
111 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
112 spi::DATA_RATE_20MHZ> {
118 #ifdef USE_POWER_SUPPLY 130 void setup()
override;
143 #ifdef USE_POWER_SUPPLY 164 void draw_filled_rect_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
display::DisplayType get_display_type() override
void set_offset_width(uint16_t offset_width)
float get_setup_priority() const override
void dump_config() override
void write_color_(uint16_t color, uint16_t size)
void set_model_str(const char *model_str)
void draw_absolute_pixel_internal(int x, int y, Color color) override
void write_display_data()
void set_height(uint32_t height)
int get_width_internal() override
The SPIDevice is what components using the SPI will create.
void set_offset_height(uint32_t offset_height)
void draw_filled_rect_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
void write_command_(uint8_t value)
void write_data_(uint8_t value)
void set_parent(PowerSupply *parent)
void set_backlight_pin(GPIOPin *backlight_pin)
void set_width(uint16_t width)
void write_addr_(uint16_t addr1, uint16_t addr2)
void set_power_supply(power_supply::PowerSupply *power_supply)
void set_eightbitcolor(bool eightbitcolor)
void set_dc_pin(GPIOPin *dc_pin)
Implementation of SPI Controller mode.
void set_reset_pin(GPIOPin *reset_pin)
power_supply::PowerSupplyRequester power_
size_t get_buffer_length_()
void backlight_(bool onoff)
int get_height_internal() override