6 namespace qspi_amoled {
9 esph_log_config(TAG,
"Setting up QSPI_AMOLED");
33 if (this->
x_low_ % 2 == 1) {
39 if (this->
y_low_ % 2 == 1) {
50 this->x_low_ = this->
width_;
64 uint32_t pos = (y * this->
width_) + x;
69 if (this->
buffer_[pos] != (uint8_t) (new_color >> 8)) {
70 this->
buffer_[pos] = (uint8_t) (new_color >> 8);
74 new_color = new_color & 0xFF;
76 if (this->
buffer_[pos] != new_color) {
126 esph_log_config(TAG,
"QSPI_AMOLED setup complete");
136 put16_be(buf + 2, x2);
139 put16_be(buf + 2, y2);
147 if (w <= 0 || h <= 0)
151 return display::Display::draw_pixels_at(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset,
157 if (x_offset == 0 && x_pad == 0 && y_offset == 0) {
162 auto stride = x_offset + w + x_pad;
163 for (
int y = 0;
y !=
h;
y++) {
164 this->
write_cmd_addr_data(0, 0, 0, 0, ptr + ((
y + y_offset) * stride + x_offset) * 2, w * 2, 4);
171 ESP_LOGCONFIG(
"",
"QSPI AMOLED");
172 ESP_LOGCONFIG(TAG,
" Height: %u", this->
height_);
173 ESP_LOGCONFIG(TAG,
" Width: %u", this->
width_);
174 LOG_PIN(
" CS Pin: ", this->
cs_);
176 ESP_LOGCONFIG(TAG,
" SPI Data rate: %dMHz", (
unsigned) (this->
data_rate_ / 1000000));
virtual void digital_write(bool value)=0
void draw_absolute_pixel_internal(int x, int y, Color color) override
void reset_params_(bool ready=false)
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void dump_config() override
void spi_setup() override
display::ColorOrder color_mode_
void set_timeout(const std::string &name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
void set_addr_window_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
The most significant bit is transmitted/received first.
void write_init_sequence_()
void write_cmd_addr_data(size_t cmd_bits, uint32_t cmd, size_t addr_bits, uint32_t address, const uint8_t *data, size_t length, uint8_t bus_width=1)
void init_internal_(uint32_t buffer_length)
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
int get_width_internal() override
int get_height_internal() override
Implementation of SPI Controller mode.
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 ...
virtual void draw_pixels_at(int x_start, int y_start, int w, int h, const uint8_t *ptr, ColorOrder order, ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad)
Given an array of pixels encoded in the nominated format, draw these into the display's buffer...
void IRAM_ATTR HOT delay(uint32_t ms)