ESPHome 2026.8.0-dev
Loading...
Searching...
No Matches
lvgl_esphome.h
Go to the documentation of this file.
1#pragma once
3
4#ifdef USE_BINARY_SENSOR
6#endif // USE_BINARY_SENSOR
7#ifdef USE_IMAGE
9#endif // USE_IMAGE
10#ifdef USE_LVGL_ROTARY_ENCODER
12#endif // USE_LVGL_ROTARY_ENCODER
13
14// required for clang-tidy
15#ifndef LV_CONF_H
16#define LV_CONF_SKIP 1 // NOLINT
17#endif // LV_CONF_H
18
22
23#include <list>
24#include <lvgl.h>
25#include <map>
26#include <utility>
27#include <vector>
28
29#ifdef USE_ESP32_VARIANT_ESP32P4
30#include "driver/ppa.h"
31#endif
32
33#ifdef USE_FONT
35#endif // USE_FONT
36#ifdef USE_TOUCHSCREEN
38#endif // USE_TOUCHSCREEN
39
40#if defined(USE_LVGL_BUTTONMATRIX) || defined(USE_LVGL_KEYBOARD)
42#endif // USE_LVGL_BUTTONMATRIX
43
44namespace esphome::lvgl {
45
46#if LV_COLOR_DEPTH == 16
47using lv_color_data = uint16_t;
48#endif
49#if LV_COLOR_DEPTH == 32
51#endif
52
53extern lv_event_code_t lv_update_event; // NOLINT
54extern std::string lv_event_code_name_for(lv_event_t *event);
55
56lv_obj_t *lv_container_create(lv_obj_t *parent);
57#ifdef USE_LVGL_SCALE
58void lv_scale_draw_event_cb(lv_event_t *e, int16_t range_start, int16_t range_end, lv_color_t color_start,
59 lv_color_t color_end, int width, bool local);
60#endif
61#if LV_COLOR_DEPTH == 16
63#elif LV_COLOR_DEPTH == 32
65#else // LV_COLOR_DEPTH
67#endif // LV_COLOR_DEPTH
68
69#if defined(USE_FONT) && defined(USE_LVGL_FONT)
70inline void lv_obj_set_style_text_font(lv_obj_t *obj, const font::Font *font, lv_style_selector_t part) {
71 lv_obj_set_style_text_font(obj, font->get_lv_font(), part);
72}
73inline void lv_style_set_text_font(lv_style_t *style, const font::Font *font) {
74 lv_style_set_text_font(style, font->get_lv_font());
75}
76#endif
77
78#ifdef USE_IMAGE
79#ifdef USE_LVGL_IMAGE
80// Shortcut / overload, so that the source of an image widget can easily be updated from within a lambda.
81inline void lv_image_set_src(lv_obj_t *obj, image::Image *image) { ::lv_image_set_src(obj, image->get_lv_image_dsc()); }
82
83inline void lv_obj_set_style_bitmap_mask_src(lv_obj_t *obj, image::Image *image, lv_style_selector_t selector) {
85}
86
87inline void lv_obj_set_style_bg_image_src(lv_obj_t *obj, image::Image *image, lv_style_selector_t selector) {
89}
90inline void lv_style_set_bg_image_src(lv_style_t *style, image::Image *image) {
92}
93inline void lv_style_set_bitmap_mask_src(lv_style_t *style, image::Image *image) {
95}
96#endif
97
98#ifdef USE_LVGL_ANIMIMG
99inline void lv_animimg_set_src(lv_obj_t *img, std::vector<image::Image *> images) {
100 auto *dsc = static_cast<std::vector<lv_image_dsc_t *> *>(lv_obj_get_user_data(img));
101 if (dsc == nullptr) {
102 // object will be lazily allocated but never freed.
103 dsc = new std::vector<lv_image_dsc_t *>(images.size()); // NOLINT
104 lv_obj_set_user_data(img, dsc);
105 }
106 dsc->clear();
107 for (auto &image : images) {
108 dsc->push_back(image->get_lv_image_dsc());
109 }
110 lv_animimg_set_src(img, (const void **) dsc->data(), dsc->size());
111}
112#endif // USE_LVGL_ANIMIMG
113#endif // USE_IMAGE
114
115#ifdef USE_LVGL_METER
116int16_t lv_get_needle_angle_for_value(lv_obj_t *obj, int32_t value);
117#endif
118
119#ifdef USE_LVGL_GRADIENT
127lv_color_t lv_grad_calculate_color(const lv_grad_dsc_t *dsc, int32_t pos);
128#endif // USE_LVGL_GRADIENT
129
130// Parent class for things that wrap an LVGL object
132 public:
133 virtual ~LvCompound() = default;
134 virtual void set_obj(lv_obj_t *lv_obj) { this->obj = lv_obj; }
135 lv_obj_t *obj{};
136};
137
138class LvglComponent;
139
140class LvPageType : public Parented<LvglComponent> {
141 public:
143
144 void setup(size_t index) {
145 this->index = index;
146 this->obj = lv_obj_create(nullptr);
147 }
148
149 bool is_showing() const;
150
151 lv_obj_t *obj{};
152 size_t index{};
153 bool skip;
154};
155
156using event_callback_t = void(lv_event_t *);
157
158class LvLambdaComponent final : public Component {
159 public:
160 LvLambdaComponent(void (*callback)()) : callback_(callback) {}
161
162 void setup() override { this->callback_(); }
163 // execute after the LvglComponent is setup
164 float get_setup_priority() const override { return setup_priority::PROCESSOR - 5; }
165
166 protected:
167 void (*callback_)();
168};
169
170template<typename... Ts> class ObjUpdateAction final : public Action<Ts...> {
171 public:
172 explicit ObjUpdateAction(std::function<void(Ts...)> &&lamb) : lamb_(std::move(lamb)) {}
173
174 protected:
175 void play(const Ts &...x) override { this->lamb_(x...); }
176
177 std::function<void(Ts...)> lamb_;
178};
179#ifdef USE_LVGL_ANIMIMG
180void lv_animimg_stop(lv_obj_t *obj);
181#endif // USE_LVGL_ANIMIMG
187
188enum class Orientation : uint8_t {
189 UNKNOWN,
190 LANDSCAPE,
191 PORTRAIT,
192};
193
194class LvglComponent final : public PollingComponent {
195 constexpr static const char *const TAG = "lvgl";
196
197 public:
198 LvglComponent(std::vector<display::Display *> displays, float buffer_frac, bool full_refresh, int draw_rounding,
199 bool resume_on_input, bool update_when_display_idle, RotationType rotation_type);
200 static void static_flush_cb(lv_display_t *disp_drv, const lv_area_t *area, uint8_t *color_p);
206 static lv_point_t get_touch_relative_to_obj(lv_obj_t *obj);
207
208 float get_setup_priority() const override { return setup_priority::PROCESSOR; }
209 void setup() override;
210 void update() override;
211 void loop() override;
212 template<typename F> void add_on_idle_callback(F &&callback) { this->idle_callbacks_.add(std::forward<F>(callback)); }
213
214 static void render_end_cb(lv_event_t *event);
215 static void render_start_cb(lv_event_t *event);
216 void dump_config() override;
217 lv_display_t *get_disp() { return this->disp_; }
218 lv_obj_t *get_screen_active() { return lv_display_get_screen_active(this->disp_); }
219 // Pause or resume the display.
220 // @param paused If true, pause the display. If false, resume the display.
221 // @param show_snow If true, show the snow effect when paused.
222 void set_paused(bool paused, bool show_snow);
224 this->refr_timer_period_ = period;
225 if (this->refr_timer_ != nullptr)
226 lv_timer_set_period(this->refr_timer_, period);
227 }
228
229 // Returns true if the display has been explicitly paused via set_paused().
230 bool is_paused() const { return this->paused_; }
231 // If the display is paused and we have resume_on_input_ set to true, resume the display.
233 if (this->paused_ && this->resume_on_input_) {
234 this->set_paused(false, false);
235 }
236 }
237
241 static void esphome_lvgl_init();
242
243 // Convenience overloads for adding a callback for one or more events
244 static void add_event_cb(lv_obj_t *obj, event_callback_t callback, lv_event_code_t event);
245 static void add_event_cb(lv_obj_t *obj, event_callback_t callback, lv_event_code_t event1, lv_event_code_t event2);
246 static void add_event_cb(lv_obj_t *obj, event_callback_t callback, lv_event_code_t event1, lv_event_code_t event2,
247 lv_event_code_t event3);
248
249 // change the state of a widget and fire an event if changed (only needed for CHECKED)
250
251 static void lv_obj_set_state_value(lv_obj_t *obj, lv_state_t state, bool value) {
252 if (value != lv_obj_has_state(obj, state)) {
253 if (value) {
254 lv_obj_add_state(obj, state);
255 } else {
256 lv_obj_remove_state(obj, state);
257 }
258 if (state == LV_STATE_CHECKED)
259 lv_obj_send_event(obj, lv_update_event, nullptr);
260 }
261 }
262
263 // change the state of a buttonmatrix button and fire an event if changed (only needed for CHECKED)
264#ifdef USE_LVGL_BUTTONMATRIX
265 static void lv_buttonmatrix_set_button_ctrl_value(lv_obj_t *obj, uint32_t index, lv_buttonmatrix_ctrl_t ctrl,
266 bool value) {
267 if (value != lv_buttonmatrix_has_button_ctrl(obj, index, ctrl)) {
268 if (value) {
269 lv_buttonmatrix_set_button_ctrl(obj, index, ctrl);
270 } else {
271 lv_buttonmatrix_clear_button_ctrl(obj, index, ctrl);
272 }
273 if (ctrl == LV_BUTTONMATRIX_CTRL_CHECKED)
274 lv_obj_send_event(obj, lv_update_event, nullptr);
275 }
276 }
277#endif
278
279 void add_page(LvPageType *page);
280 void show_page(size_t index, lv_screen_load_anim_t anim, uint32_t time);
281 void show_next_page(lv_screen_load_anim_t anim, uint32_t time);
282 void show_prev_page(lv_screen_load_anim_t anim, uint32_t time);
283 void set_page_wrap(bool wrap) { this->page_wrap_ = wrap; }
284 void set_big_endian(bool big_endian) { this->big_endian_ = big_endian; }
285 size_t get_current_page() const;
286 void set_focus_mark(lv_group_t *group) { this->focus_marks_[group] = lv_group_get_focused(group); }
287 void restore_focus_mark(lv_group_t *group) {
288 auto *mark = this->focus_marks_[group];
289 if (mark != nullptr) {
290 lv_group_focus_obj(mark);
291 }
292 }
293 // rounding factor to align bounds of update area when drawing
294 size_t draw_rounding{2};
295
296 void set_pause_trigger(Trigger<> *trigger) { this->pause_callback_ = trigger; }
297 void set_resume_trigger(Trigger<> *trigger) { this->resume_callback_ = trigger; }
298 void set_draw_start_trigger(Trigger<> *trigger) { this->draw_start_callback_ = trigger; }
299 void set_draw_end_trigger(Trigger<> *trigger) { this->draw_end_callback_ = trigger; }
300 void set_landscape_trigger(Trigger<> *trigger) { this->landscape_callback_ = trigger; }
301 void set_portrait_trigger(Trigger<> *trigger) { this->portrait_callback_ = trigger; }
304 void set_rotation(int angle);
306 void rotate_coordinates(int32_t &x, int32_t &y) const;
307
308 uint16_t get_width() const { return lv_display_get_horizontal_resolution(this->disp_); }
309 uint16_t get_height() const { return lv_display_get_vertical_resolution(this->disp_); }
310
311 protected:
312 void set_resolution_() const;
313 // Determine the current orientation from the effective resolution and fire the
314 // landscape/portrait trigger if it has changed since the last check.
315 void update_orientation_();
316 void draw_end_();
317 // Not checking for non-null callback since the
318 // LVGL callback that calls it is not set in that case
319 void draw_start_() const { this->draw_start_callback_->trigger(); }
320 // Returns true if update_when_display_idle is enabled and at least one underlying display
321 // component is currently busy (e.g. mid-refresh).
322 bool displays_busy_() const;
323
324 void write_random_();
325 void draw_buffer_(const lv_area_t *area, lv_color_data *ptr);
326#ifdef USE_ESP32_VARIANT_ESP32P4
327 bool ppa_rotate_(const lv_color_data *src, lv_color_data *dst, uint16_t width, uint16_t height,
328 uint32_t height_rounded);
329#endif
330 void flush_cb_(lv_display_t *disp_drv, const lv_area_t *area, uint8_t *color_p);
331
332 std::vector<display::Display *> displays_{};
333 size_t buffer_frac_{1};
337
338 uint8_t *draw_buf_{};
339 lv_display_t *disp_{};
340 // The display's own periodic refresh timer, effectively paused while the display is busy (see
341 // displays_busy_()) so LVGL neither renders nor flushes to it, without losing track of
342 // invalidated areas. Other timers (indev reading, animations, ...) keep running as normal.
343 lv_timer_t *refr_timer_{};
344 // Tracks whether refr_timer_ is currently paused, so loop() can detect the busy -> idle edge
345 // and kick off an immediate refresh instead of waiting for the timer's next natural period.
348 uint16_t width_{};
349 uint16_t height_{};
350 bool paused_{};
351 std::vector<LvPageType *> pages_{};
352 size_t current_page_{0};
354 bool page_wrap_{true};
356 std::map<lv_group_t *, lv_obj_t *> focus_marks_{};
357
366 void *rotate_buf_{};
369#ifdef USE_ESP32_VARIANT_ESP32P4
370 ppa_client_handle_t ppa_client_{};
371#endif
372};
373
374class IdleTrigger final : public Trigger<> {
375 public:
376 explicit IdleTrigger(LvglComponent *parent, TemplatableFn<uint32_t> timeout);
377
378 protected:
380 bool is_idle_{};
381};
382
383template<typename... Ts> class LvglAction final : public Action<Ts...>, public Parented<LvglComponent> {
384 public:
385 explicit LvglAction(std::function<void(LvglComponent *)> &&lamb) : action_(std::move(lamb)) {}
386
387 protected:
388 void play(const Ts &...x) override { this->action_(this->parent_); }
389 std::function<void(LvglComponent *)> action_{};
390};
391
392template<typename Tc, typename... Ts> class LvglCondition final : public Condition<Ts...>, public Parented<Tc> {
393 public:
394 LvglCondition(std::function<bool(Tc *)> &&condition_lambda) : condition_lambda_(std::move(condition_lambda)) {}
395 bool check(const Ts &...x) override { return this->condition_lambda_(this->parent_); }
396
397 protected:
398 std::function<bool(Tc *)> condition_lambda_{};
399};
400
401#ifdef USE_LVGL_TOUCHSCREEN
402class LVTouchListener final : public touchscreen::TouchListener, public Parented<LvglComponent> {
403 public:
404 LVTouchListener(uint16_t long_press_time, uint16_t long_press_repeat_time, LvglComponent *parent);
405 void update(const touchscreen::TouchPoints_t &tpoints) override;
406 void release() override {
407 touch_pressed_ = false;
408 this->parent_->maybe_wakeup();
409 }
410 lv_indev_t *get_drv() { return this->drv_; }
411
412 protected:
413 lv_indev_t *drv_{};
416};
417#endif // USE_LVGL_TOUCHSCREEN
418
419#ifdef USE_LVGL_METER
420
421class IndicatorLine : public LvCompound {
422 public:
423 IndicatorLine() = default;
424
425 void set_obj(lv_obj_t *lv_obj) override;
426
427 void set_value(int value);
428
429 private:
430 void update_length_();
431
432 int16_t angle_{};
433 lv_point_precise_t points_[2]{};
434};
435#endif
436
437#ifdef USE_LVGL_KEY_LISTENER
438class LVEncoderListener final : public Parented<LvglComponent> {
439 public:
440 LVEncoderListener(lv_indev_type_t type, uint16_t long_press_time, uint16_t long_press_repeat_time);
441
442#ifdef USE_BINARY_SENSOR
443 void add_button(binary_sensor::BinarySensor *button, lv_key_t key) {
444 button->add_on_state_callback([this, key](bool state) { this->event(key, state); });
445 }
446#endif
447
448#ifdef USE_LVGL_ROTARY_ENCODER
450 sensor->register_listener([this](int32_t count) { this->set_count(count); });
451 }
452#endif // USE_LVGL_ROTARY_ENCODER
453
454 void event(int key, bool pressed) {
455 if (!this->parent_->is_paused()) {
456 this->pressed_ = pressed;
457 this->key_ = key;
458 } else if (!pressed) {
459 // maybe wakeup on release if paused
460 this->parent_->maybe_wakeup();
461 }
462 }
463
464 void set_count(int32_t count) {
465 if (!this->parent_->is_paused()) {
466 this->count_ = count;
467 } else {
468 this->parent_->maybe_wakeup();
469 }
470 }
471
472 lv_indev_t *get_drv() { return this->drv_; }
473
474 protected:
475 lv_indev_t *drv_{};
476 bool pressed_{};
477 int32_t count_{};
478 int32_t last_count_{};
479 int key_{};
480};
481#endif // USE_LVGL_KEY_LISTENER
482
483#ifdef USE_LVGL_LINE
484class LvLineType : public LvCompound {
485 public:
487 this->points_ = std::move(points);
488 lv_line_set_points(this->obj, this->points_.begin(), this->points_.size());
489 }
490
491 protected:
493};
494#endif
495#if defined(USE_LVGL_DROPDOWN) || defined(LV_USE_ROLLER)
496class LvSelectable : public LvCompound {
497 public:
498 virtual size_t get_selected_index() = 0;
499 virtual void set_selected_index(size_t index, lv_anim_enable_t anim) = 0;
500 void set_selected_text(const std::string &text, lv_anim_enable_t anim);
501 std::string get_selected_text();
502 const std::vector<std::string> &get_options() { return this->options_; }
503 void set_options(std::vector<std::string> options);
504
505 protected:
506 virtual void set_option_string(const char *options) = 0;
507 std::vector<std::string> options_{};
508};
509
510#ifdef USE_LVGL_DROPDOWN
512 public:
513 size_t get_selected_index() override { return lv_dropdown_get_selected(this->obj); }
514 void set_selected_index(size_t index, lv_anim_enable_t anim) override { lv_dropdown_set_selected(this->obj, index); }
515
516 protected:
517 void set_option_string(const char *options) override { lv_dropdown_set_options(this->obj, options); }
518};
519#endif // USE_LVGL_DROPDOWN
520
521#ifdef USE_LVGL_ROLLER
523 public:
524 size_t get_selected_index() override { return lv_roller_get_selected(this->obj); }
525 void set_selected_index(size_t index, lv_anim_enable_t anim) override {
526 lv_roller_set_selected(this->obj, index, anim);
527 }
528 void set_mode(lv_roller_mode_t mode) { this->mode_ = mode; }
529
530 protected:
531 void set_option_string(const char *options) override { lv_roller_set_options(this->obj, options, this->mode_); }
532 lv_roller_mode_t mode_{LV_ROLLER_MODE_NORMAL};
533};
534#endif
535#endif // defined(USE_LVGL_DROPDOWN) || defined(LV_USE_ROLLER)
536
537#ifdef USE_LVGL_BUTTONMATRIX
539 public:
540 void set_obj(lv_obj_t *lv_obj) override;
541 uint16_t get_selected() { return lv_buttonmatrix_get_selected_button(this->obj); }
542 void set_key(size_t idx, uint8_t key) { this->key_map_[idx] = key; }
543
544 protected:
545 std::map<size_t, uint8_t> key_map_{};
546};
547#endif // USE_LVGL_BUTTONMATRIX
548
549#ifdef USE_LVGL_KEYBOARD
551 public:
552 void set_obj(lv_obj_t *lv_obj) override;
553};
554#endif // USE_LVGL_KEYBOARD
555} // namespace esphome::lvgl
BedjetMode mode
BedJet operating mode.
Base class for all automation conditions.
Definition automation.h:438
Fixed-capacity vector - allocates once at runtime, never reallocates This avoids std::vector template...
Definition helpers.h:534
Helper class to easily give an object a parent of type T.
Definition helpers.h:1881
This class simplifies creating components that periodically check a state.
Definition component.h:510
void add_on_state_callback(F &&callback)
Function-pointer-only templatable storage (4 bytes on 32-bit).
Definition automation.h:19
void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE
Inform the parent automation that the event has triggered.
Definition automation.h:461
Base class for all binary_sensor-type classes.
const lv_font_t * get_lv_font() const
Definition font.h:76
lv_image_dsc_t * get_lv_image_dsc()
Definition image.cpp:107
interface for components that provide keypresses
Definition key_provider.h:9
TemplatableFn< uint32_t > timeout_
IdleTrigger(LvglComponent *parent, TemplatableFn< uint32_t > timeout)
void set_obj(lv_obj_t *lv_obj) override
void add_button(binary_sensor::BinarySensor *button, lv_key_t key)
void event(int key, bool pressed)
void set_sensor(rotary_encoder::RotaryEncoderSensor *sensor)
LVEncoderListener(lv_indev_type_t type, uint16_t long_press_time, uint16_t long_press_repeat_time)
LVTouchListener(uint16_t long_press_time, uint16_t long_press_repeat_time, LvglComponent *parent)
touchscreen::TouchPoint touch_point_
void update(const touchscreen::TouchPoints_t &tpoints) override
void set_key(size_t idx, uint8_t key)
std::map< size_t, uint8_t > key_map_
void set_obj(lv_obj_t *lv_obj) override
virtual ~LvCompound()=default
virtual void set_obj(lv_obj_t *lv_obj)
size_t get_selected_index() override
void set_option_string(const char *options) override
void set_selected_index(size_t index, lv_anim_enable_t anim) override
void set_obj(lv_obj_t *lv_obj) override
LvLambdaComponent(void(*callback)())
float get_setup_priority() const override
void set_points(FixedVector< lv_point_precise_t > points)
FixedVector< lv_point_precise_t > points_
void setup(size_t index)
void set_mode(lv_roller_mode_t mode)
void set_option_string(const char *options) override
void set_selected_index(size_t index, lv_anim_enable_t anim) override
size_t get_selected_index() override
const std::vector< std::string > & get_options()
void set_selected_text(const std::string &text, lv_anim_enable_t anim)
void set_options(std::vector< std::string > options)
std::vector< std::string > options_
virtual void set_selected_index(size_t index, lv_anim_enable_t anim)=0
virtual size_t get_selected_index()=0
virtual void set_option_string(const char *options)=0
void play(const Ts &...x) override
LvglAction(std::function< void(LvglComponent *)> &&lamb)
std::function< void(LvglComponent *)> action_
Component for rendering LVGL.
void set_paused(bool paused, bool show_snow)
void set_pause_trigger(Trigger<> *trigger)
void set_landscape_trigger(Trigger<> *trigger)
display::DisplayRotation rotation_
void rotate_coordinates(int32_t &x, int32_t &y) const
std::vector< LvPageType * > pages_
void set_rotation(display::DisplayRotation rotation)
static void add_event_cb(lv_obj_t *obj, event_callback_t callback, lv_event_code_t event)
void set_focus_mark(lv_group_t *group)
bool ppa_rotate_(const lv_color_data *src, lv_color_data *dst, uint16_t width, uint16_t height, uint32_t height_rounded)
void set_draw_end_trigger(Trigger<> *trigger)
static void lv_obj_set_state_value(lv_obj_t *obj, lv_state_t state, bool value)
void set_refresh_interval(uint32_t period)
CallbackManager< void(uint32_t)> idle_callbacks_
void set_portrait_trigger(Trigger<> *trigger)
void set_big_endian(bool big_endian)
void show_next_page(lv_screen_load_anim_t anim, uint32_t time)
void set_resume_trigger(Trigger<> *trigger)
std::vector< display::Display * > displays_
static void esphome_lvgl_init()
Initialize the LVGL library and register custom events.
void show_prev_page(lv_screen_load_anim_t anim, uint32_t time)
static void lv_buttonmatrix_set_button_ctrl_value(lv_obj_t *obj, uint32_t index, lv_buttonmatrix_ctrl_t ctrl, bool value)
ppa_client_handle_t ppa_client_
LvglComponent(std::vector< display::Display * > displays, float buffer_frac, bool full_refresh, int draw_rounding, bool resume_on_input, bool update_when_display_idle, RotationType rotation_type)
static void render_start_cb(lv_event_t *event)
static lv_point_t get_touch_relative_to_obj(lv_obj_t *obj)
void add_on_idle_callback(F &&callback)
void add_page(LvPageType *page)
float get_setup_priority() const override
static void static_flush_cb(lv_display_t *disp_drv, const lv_area_t *area, uint8_t *color_p)
std::map< lv_group_t *, lv_obj_t * > focus_marks_
static void render_end_cb(lv_event_t *event)
void draw_buffer_(const lv_area_t *area, lv_color_data *ptr)
void show_page(size_t index, lv_screen_load_anim_t anim, uint32_t time)
display::DisplayRotation get_rotation() const
void set_draw_start_trigger(Trigger<> *trigger)
void restore_focus_mark(lv_group_t *group)
void flush_cb_(lv_display_t *disp_drv, const lv_area_t *area, uint8_t *color_p)
LvglCondition(std::function< bool(Tc *)> &&condition_lambda)
bool check(const Ts &...x) override
std::function< bool(Tc *)> condition_lambda_
void play(const Ts &...x) override
std::function< void(Ts...)> lamb_
ObjUpdateAction(std::function< void(Ts...)> &&lamb)
uint16_t type
uint8_t options
bool state
Definition fan.h:2
@ DISPLAY_ROTATION_0_DEGREES
Definition display.h:134
void lv_obj_set_style_bitmap_mask_src(lv_obj_t *obj, image::Image *image, lv_style_selector_t selector)
lv_color_t lv_grad_calculate_color(const lv_grad_dsc_t *dsc, int32_t pos)
void lv_style_set_text_font(lv_style_t *style, const font::Font *font)
void lv_animimg_stop(lv_obj_t *obj)
uint16_t lv_color_data
void(lv_event_t *) event_callback_t
void lv_animimg_set_src(lv_obj_t *img, std::vector< image::Image * > images)
void lv_image_set_src(lv_obj_t *obj, image::Image *image)
void lv_style_set_bg_image_src(lv_style_t *style, image::Image *image)
void lv_style_set_bitmap_mask_src(lv_style_t *style, image::Image *image)
void lv_obj_set_style_text_font(lv_obj_t *obj, const font::Font *font, lv_style_selector_t part)
void lv_obj_set_style_bg_image_src(lv_obj_t *obj, image::Image *image, lv_style_selector_t selector)
lv_event_code_t lv_update_event
int16_t lv_get_needle_angle_for_value(lv_obj_t *obj, int32_t value)
lv_obj_t * lv_container_create(lv_obj_t *parent)
std::string lv_event_code_name_for(lv_event_t *event)
void lv_scale_draw_event_cb(lv_event_t *e, int16_t range_start, int16_t range_end, lv_color_t color_start, lv_color_t color_end, int width, bool local)
Function to apply colors to ticks based on position.
constexpr float PROCESSOR
For components that use data from sensors like displays.
Definition component.h:47
std::vector< TouchPoint > TouchPoints_t
Definition touchscreen.h:29
size_t size_t pos
Definition helpers.h:1052
const void * src
Definition hal.h:64
STL namespace.
static void uint32_t
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6