17using namespace display;
29 bool empty()
const {
return this->count_ == 0; }
30 size_t size()
const {
return this->count_; }
31 static constexpr size_t capacity() {
return N; }
34 if (this->count_ >= N)
36 this->data_[(this->head_ + this->count_) % N] = value;
42 if (this->count_ >= N)
44 this->head_ = (this->head_ + N - 1) % N;
45 this->data_[this->head_] = value;
51 if (this->count_ == 0)
53 this->head_ = (this->head_ + 1) % N;
57 const T &
front()
const {
return this->data_[this->head_]; }
58 T &
front() {
return this->data_[this->head_]; }
72static constexpr size_t OP_QUEUE_SIZE = 32;
141 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
142 spi::DATA_RATE_2MHZ> {
150 void setup()
override;
151 void loop()
override;
204 ColorBitness bitness,
bool big_endian,
int x_offset,
int y_offset,
int x_pad)
override;
227 :
static_cast<uint16_t
>(((
static_cast<uint32_t>(this->
width_) + 15) / 16) * 2);
360 void play(
const Ts &...
x)
override {
361 if (!this->display_->is_ready())
363 if (this->mode_.has_value()) {
364 this->display_->update_mode(this->mode_.value(
x...));
366 this->display_->update();
370 IT8951Display *display_;
BedjetMode mode
BedJet operating mode.
virtual void play(const Ts &...x)=0
Helper class to request loop() to be called as fast as possible.
virtual void set_rotation(DisplayRotation rotation)
Internal method to set the display rotation with.
int get_height() override
uint8_t full_update_every_
void update_mode(UpdateMode mode)
bool use_legacy_dpy_area_
float get_setup_priority() const override
void start_update_(UpdateMode mode)
void spi_write_args_(const uint16_t *args, uint16_t count)
void enqueue_init_temp_()
void enqueue_update_refresh_()
HighFrequencyLoopRequester high_freq_
void reset_dirty_region_()
void set_invert_colors(bool invert_colors)
uint32_t partial_update_count_
int16_t force_temperature_
void set_transform(uint8_t t)
void set_phase_(Phase next)
void spi_cmd_(uint16_t cmd)
UpdateMode default_update_mode_
bool rotate_coordinates_(int &x, int &y)
void dump_config() override
void enqueue_(OpType type, uint16_t a=0, uint16_t b=0)
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) override
void set_reset_pin(GPIOPin *pin)
IT8951Display(const char *name, uint16_t width, uint16_t height)
uint16_t compute_row_width_() const
void spi_write_reg_(uint16_t addr, uint16_t value)
bool force_temperature_set_
void set_force_temperature(int16_t celsius)
void prepend_(OpType type, uint16_t a=0, uint16_t b=0)
void set_update_mode(uint16_t m)
std::vector< GPIOPin * > enable_pins_
int get_height_internal() override
void enqueue_init_dev_info_()
StaticOpQueue< Op, OP_QUEUE_SIZE > queue_
uint32_t phase_started_at_
void set_mono_pixel_(uint16_t x, uint16_t y, bool value) const
void update_effective_transform_()
void enqueue_update_transfer_()
void spi_read_dev_info_()
void set_busy_pin(GPIOPin *pin)
uint8_t dev_info_attempts_
void enqueue_init_vcom_()
void set_enable_pins(std::vector< GPIOPin * > pins)
void set_reset_duration(uint32_t ms)
void set_grayscale(bool g)
uint32_t configured_data_rate_
void enqueue_update_sleep_()
void write_pixel_native_(uint16_t x, uint16_t y, const Color &color) const
uint32_t update_started_at_
void set_rotation(DisplayRotation rotation) override
UpdateMode pending_update_mode_
void apply_transform_(int &x, int &y) const
uint8_t effective_transform_
void enqueue_init_reset_()
void process_op_(const Op &op)
void fill(Color color) override
uint16_t spi_read_word_()
void spi_write_word_(uint16_t value)
void on_safe_shutdown() override
static constexpr uint32_t BUSY_TIMEOUT_MS
void set_vcom(uint16_t vcom_mv)
void set_full_update_every(uint8_t n)
void set_sleep_when_done(bool s)
void set_use_legacy_dpy_area(bool use)
bool prepare_update_region_(UpdateMode &mode)
DisplayType get_display_type() override
void set_dithering(bool d)
void set_gray_pixel_(uint16_t x, uint16_t y, uint8_t nibble) const
void set_vcom_register(uint16_t selector)
uint8_t recovery_attempts_
void op_xfer_area_args_()
void op_check_lut_idle_()
int get_width_internal() override
void draw_pixel_at(int x, int y, Color color) override
IT8951UpdateAction(IT8951Display *display)
bool push_front(const T &value)
bool push_back(const T &value)
static constexpr size_t capacity()
The SPIDevice is what components using the SPI will create.
constexpr float PROCESSOR
For components that use data from sensors like displays.
const char int const __FlashStringHelper va_list args