13constexpr static const char *
const TAG =
"display.mipi_spi";
14static const uint8_t SW_RESET_CMD = 0x01;
15static const uint8_t SLEEP_OUT = 0x11;
16static const uint8_t NORON = 0x13;
17static const uint8_t INVERT_OFF = 0x20;
18static const uint8_t INVERT_ON = 0x21;
19static const uint8_t ALL_ON = 0x23;
20static const uint8_t WRAM = 0x24;
21static const uint8_t MIPI = 0x26;
22static const uint8_t DISPLAY_ON = 0x29;
23static const uint8_t RASET = 0x2B;
24static const uint8_t CASET = 0x2A;
25static const uint8_t WDATA = 0x2C;
26static const uint8_t TEON = 0x35;
27static const uint8_t MADCTL_CMD = 0x36;
28static const uint8_t PIXFMT = 0x3A;
29static const uint8_t BRIGHTNESS = 0x51;
30static const uint8_t SWIRE1 = 0x5A;
31static const uint8_t SWIRE2 = 0x5B;
32static const uint8_t PAGESEL = 0xFE;
34static const uint8_t MADCTL_MY = 0x80;
35static const uint8_t MADCTL_MX = 0x40;
36static const uint8_t MADCTL_MV = 0x20;
37static const uint8_t MADCTL_RGB = 0x00;
38static const uint8_t MADCTL_BGR = 0x08;
39static const uint8_t MADCTL_XFLIP = 0x02;
40static const uint8_t MADCTL_YFLIP = 0x01;
42static const uint8_t DELAY_FLAG = 0xFF;
44static inline void put16_be(uint8_t *buf, uint16_t value) {
55 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
56 spi::DATA_RATE_1MHZ> {
66 void setup()
override;
102 if (this->
buffer_ ==
nullptr) {
116 void write_to_display_(
int x_start,
int y_start,
int w,
int h,
const uint8_t *ptr,
int x_offset,
int y_offset,
virtual void mark_failed()
Mark this component as failed.
void init_internal_(uint32_t buffer_length)
void set_model(const char *model)
void dump_config() override
void set_init_sequence(const std::vector< uint8_t > &sequence)
MipiSpi(size_t width, size_t height, int16_t offset_width, int16_t offset_height, display::ColorBitness color_depth)
bool can_proceed() override
void set_brightness(uint8_t brightness)
void set_enable_pins(std::vector< GPIOPin * > enable_pins)
std::vector< uint8_t > init_sequence_
void set_addr_window_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
display::ColorOrder get_color_mode()
int get_width_internal() override
void set_reset_pin(GPIOPin *reset_pin)
void set_dc_pin(GPIOPin *dc_pin)
void write_18_from_16_bit_(const uint16_t *ptr, size_t w, size_t h, size_t stride)
int get_height_internal() override
void write_to_display_(int x_start, int y_start, int w, int h, const uint8_t *ptr, int x_offset, int y_offset, int x_pad)
void set_draw_rounding(unsigned rounding)
optional< uint8_t > brightness_
void set_spi_16(bool spi_16)
void draw_absolute_pixel_internal(int x, int y, Color color) override
display::ColorBitness color_depth_
void write_command_(uint8_t cmd, const uint8_t *bytes, size_t len)
the RM67162 in quad SPI mode seems to work like this (not in the datasheet, this is deduced from the ...
std::vector< GPIOPin * > enable_pins_
void write_18_from_8_bit_(const uint8_t *ptr, size_t w, size_t h, size_t stride)
void write_16_from_8_bit_(const uint8_t *ptr, size_t w, size_t h, size_t stride)
void write_command_(uint8_t cmd)
display::DisplayType get_display_type() override
void write_init_sequence_()
void write_command_(uint8_t cmd, uint8_t data)
void draw_pixels_at(int x_start, int y_start, int w, int h, const uint8_t *ptr, display::ColorOrder order, display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) override
void set_invert_colors(bool invert_colors)
void fill(Color color) override
void set_draw_from_origin(bool draw_from_origin)
The SPIDevice is what components using the SPI will create.
Providing packet encoding functions for exchanging data with a remote host.