38 const uint8_t* bp =
script();
43 while ((cmd = pgm_read_byte(bp++)) !=
SCRIPTEND) {
44 count = pgm_read_byte(bp++);
67 uint16_t temp =
WIDTH;
101 uint16_t width = image->
WIDTH;
102 uint16_t height = image->
HEIGHT;
110 for (uint16_t i = 0; i < height; i++) {
113 for (uint16_t j = 0; j < width; j += count) {
115 image->
read(buf, count);
118 for (uint16_t k = 0; k < count; k++)
write(buf[k]);
130 uint16_t h = y + length;
152 uint16_t w = x + length;
153 if (w >=
WIDTH)
return;
157 if ((x + length - 1) >=
WIDTH) length =
WIDTH - x;
172 if (
UNLIKELY((width == 0) || (height == 0)))
return;
174 if ((x + width - 1) >=
WIDTH) width =
WIDTH - x;
182 if (width > height) {
183 for (y = 0; y < height; y++)
187 for (x = 0; x < width; x++)
virtual void draw_image(uint16_t x, uint16_t y, Image *image)
uint8_t transfer(uint8_t data)
OutputPin m_dc
Data/Command select pin.
void acquire(Driver *dev)
GDDRAM(uint16_t width, uint16_t height, Board::DigitalPin cs, Board::DigitalPin dc)
static const size_t BUFFER_MAX
bool m_initiated
Initialization state.
color16_t color(uint8_t red, uint8_t green, uint8_t blue)
virtual const uint8_t * script()=0
virtual void fill_rect(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
color16_t get_pen_color() const
virtual void draw_horizontal_line(uint16_t x, uint16_t y, uint16_t length)
virtual uint8_t set_orientation(uint8_t direction)
virtual void draw_vertical_line(uint16_t x, uint16_t y, uint16_t length)
virtual bool read(color16_t *buf, size_t count)=0
void write(uint16_t data)