8#include "roo_threads.h"
9#include "roo_threads/thread.h"
59template <
typename Transport>
90 transport_.beginWriteOnlyTransaction();
96 transport_.endTransaction();
111 writeCommand(
PIXSET, {0x55});
115 writeCommand(
PWCTRL1, {0x08, 0x08});
118 writeCommand(
VMCTRL1, {0x00, 0x00, 0x00, 0x00});
120 writeCommand(
PGAMCTRL, {0x0F, 0x1F, 0x1C, 0x0C, 0x0F, 0x08, 0x48, 0x98,
121 0x37, 0x0A, 0x13, 0x04, 0x11, 0x0D, 0x00});
122 writeCommand(
NGAMCTRL, {0x0F, 0x32, 0x1C, 0x0B, 0x0D, 0x05, 0x50, 0x75,
123 0x37, 0x06, 0x10, 0x03, 0x10, 0x10, 0x00});
126 writeCommand(
MADCTL, {0x48});
145 if (last_x0_ != x0 || last_x1_ != x1) {
148 roo::byte{0},
static_cast<roo::byte
>(x0 >> 8),
149 roo::byte{0},
static_cast<roo::byte
>(x0 >> 0),
150 roo::byte{0},
static_cast<roo::byte
>(x1 >> 8),
151 roo::byte{0},
static_cast<roo::byte
>(x1 >> 0),
153 transport_.writeBytes(
xBin, 8);
157 if (last_y0_ != y0 || last_y1_ != y1) {
160 roo::byte{0},
static_cast<roo::byte
>(y0 >> 8),
161 roo::byte{0},
static_cast<roo::byte
>(y0 >> 0),
162 roo::byte{0},
static_cast<roo::byte
>(y1 >> 8),
163 roo::byte{0},
static_cast<roo::byte
>(y1 >> 0),
165 transport_.writeBytes(
yBin, 8);
193 transport_.cmdBegin();
194 transport_.write16(
c);
198 void writeCommand(
uint8_t c,
const std::initializer_list<uint8_t>&
d) {
203 void sleep_ms(uint32_t ms) {
204 roo::this_thread::sleep_for(roo_time::Millis(ms));
207 Transport transport_;
210 uint16_t last_x0_, last_x1_, last_y0_, last_y1_;
215template <
typename Transport>
Represents the orientation of a display device.
bool isRightToLeft() const
Return whether horizontal direction is right-to-left.
bool isTopToBottom() const
Return whether vertical direction is top-to-bottom.
bool isXYswapped() const
Return whether x maps to the vertical direction.
16-bit RGB565 color mode (opaque).
void ramWrite(const roo::byte *data, size_t pixel_count) __attribute__((always_inline))
void flush() __attribute__((always_inline))
void ramFill(const roo::byte *data, size_t pixel_count) __attribute__((always_inline))
void startRamWrite() __attribute__((always_inline))
Ili9486Target(Transport transport, uint16_t width=kDefaultWidth, uint16_t height=kDefaultHeight)
Ili9486Target(uint16_t width=kDefaultWidth, uint16_t height=kDefaultHeight)
void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) __attribute__((always_inline))
void setOrientation(Orientation orientation)
void ramWriteAsyncBlit(const roo::byte *data, size_t row_stride_bytes, size_t row_bytes, size_t row_count) __attribute__((always_inline))
static constexpr ByteOrder byte_order
SpiSettings< kSpiFrequency, kSpiMsbFirst, kSpiMode0 > DefaultSpiSettings
static const int16_t kDefaultHeight
static const uint32_t kSpiFrequency
static const int16_t kDefaultWidth
Defines 140 opaque HTML named colors.
roo_io::ByteOrder ByteOrder