|
ESPHome 2026.8.0-dev
|
Component for rendering LVGL. More...
#include <lvgl_esphome.h>
Public Member Functions | |
| 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) | |
| float | get_setup_priority () const override |
| void | setup () override |
| void | update () override |
| void | loop () override |
| template<typename F > | |
| void | add_on_idle_callback (F &&callback) |
| void | dump_config () override |
| lv_display_t * | get_disp () |
| lv_obj_t * | get_screen_active () |
| void | set_paused (bool paused, bool show_snow) |
| void | set_refresh_interval (uint32_t period) |
| bool | is_paused () const |
| void | maybe_wakeup () |
| void | add_page (LvPageType *page) |
| void | show_page (size_t index, lv_screen_load_anim_t anim, uint32_t time) |
| void | show_next_page (lv_screen_load_anim_t anim, uint32_t time) |
| void | show_prev_page (lv_screen_load_anim_t anim, uint32_t time) |
| void | set_page_wrap (bool wrap) |
| void | set_big_endian (bool big_endian) |
| size_t | get_current_page () const |
| void | set_focus_mark (lv_group_t *group) |
| void | restore_focus_mark (lv_group_t *group) |
| void | set_pause_trigger (Trigger<> *trigger) |
| void | set_resume_trigger (Trigger<> *trigger) |
| void | set_draw_start_trigger (Trigger<> *trigger) |
| void | set_draw_end_trigger (Trigger<> *trigger) |
| void | set_landscape_trigger (Trigger<> *trigger) |
| void | set_portrait_trigger (Trigger<> *trigger) |
| void | set_rotation (display::DisplayRotation rotation) |
| void | set_rotation (int angle) |
| Set the rotation from an angle in degrees. Must be a multiple of 90. | |
| display::DisplayRotation | get_rotation () const |
| void | rotate_coordinates (int32_t &x, int32_t &y) const |
| uint16_t | get_width () const |
| uint16_t | get_height () const |
Public Member Functions inherited from esphome::PollingComponent | |
| PollingComponent () | |
| PollingComponent (uint32_t update_interval) | |
| Initialize this polling component with the given update interval in ms. | |
| void | set_update_interval (uint32_t update_interval) |
| Manually set the update interval in ms for this polling object. | |
| void | call_setup () override |
| virtual uint32_t | get_update_interval () const |
| Get the update interval in ms of this sensor. | |
| void | start_poller () |
| void | stop_poller () |
Public Member Functions inherited from esphome::Component | |
| float | get_actual_setup_priority () const |
| void | set_setup_priority (float priority) |
| void | call () |
| virtual void | on_shutdown () |
| virtual void | on_safe_shutdown () |
| virtual bool | teardown () |
| Called during teardown to allow component to gracefully finish operations. | |
| virtual void | on_powerdown () |
| Called after teardown is complete to power down hardware. | |
| uint8_t | get_component_state () const |
| void | reset_to_construction_state () |
| Reset this component back to the construction state to allow setup to run again. | |
| bool | is_in_loop_state () const |
| Check if this component has completed setup and is in the loop state. | |
| bool | is_idle () const |
| Check if this component is idle. | |
| void | mark_failed () |
| Mark this component as failed. | |
| void | mark_failed (const LogString *message) |
| void | disable_loop () |
| Disable this component's loop. | |
| void | enable_loop () |
| Enable this component's loop. | |
| void | enable_loop_soon_any_context () |
| Thread and ISR-safe version of enable_loop() that can be called from any context. | |
| bool | is_failed () const |
| bool | is_ready () const |
| virtual bool | can_proceed () |
| bool | status_has_warning () const |
| bool | status_has_error () const |
| void | status_set_warning () |
| void | status_set_warning (const char *message) |
| void | status_set_warning (const LogString *message) |
| void | status_set_error () |
| void | status_set_error (const LogString *message) |
| void | status_clear_warning () |
| void | status_clear_error () |
| void | status_momentary_warning (const char *name, uint32_t length=5000) |
| Set warning status flag and automatically clear it after a timeout. | |
| void | status_momentary_error (const char *name, uint32_t length=5000) |
| Set error status flag and automatically clear it after a timeout. | |
| bool | has_overridden_loop () const |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| Get the integration where this component was declared as a LogString for logging. | |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
Static Public Member Functions | |
| static void | static_flush_cb (lv_display_t *disp_drv, const lv_area_t *area, uint8_t *color_p) |
| static lv_point_t | get_touch_relative_to_obj (lv_obj_t *obj) |
| static void | render_end_cb (lv_event_t *event) |
| static void | render_start_cb (lv_event_t *event) |
| static void | esphome_lvgl_init () |
| Initialize the LVGL library and register custom events. | |
| static void | add_event_cb (lv_obj_t *obj, event_callback_t callback, lv_event_code_t event) |
| static void | add_event_cb (lv_obj_t *obj, event_callback_t callback, lv_event_code_t event1, lv_event_code_t event2) |
| static void | add_event_cb (lv_obj_t *obj, event_callback_t callback, lv_event_code_t event1, lv_event_code_t event2, lv_event_code_t event3) |
| static void | lv_obj_set_state_value (lv_obj_t *obj, lv_state_t state, bool value) |
| static void | lv_buttonmatrix_set_button_ctrl_value (lv_obj_t *obj, uint32_t index, lv_buttonmatrix_ctrl_t ctrl, bool value) |
Data Fields | |
| size_t | draw_rounding {2} |
Protected Member Functions | |
| void | set_resolution_ () const |
| void | update_orientation_ () |
| void | draw_end_ () |
| void | draw_start_ () const |
| bool | displays_busy_ () const |
| void | write_random_ () |
| void | draw_buffer_ (const lv_area_t *area, lv_color_data *ptr) |
| bool | ppa_rotate_ (const lv_color_data *src, lv_color_data *dst, uint16_t width, uint16_t height, uint32_t height_rounded) |
| void | flush_cb_ (lv_display_t *disp_drv, const lv_area_t *area, uint8_t *color_p) |
Protected Member Functions inherited from esphome::Component | |
| friend | void::setup () |
| friend | void::original_setup () |
| void | set_component_source_ (uint8_t index) |
| Set where this component was loaded from for some debug messages. | |
| void | call_dump_config_ () |
| void | enable_loop_slow_path_ () |
| void | set_component_state_ (uint8_t state) |
| Helper to set component state (clears state bits and sets new state) | |
| bool | set_status_flag_ (uint8_t flag) |
| Helper to set a status LED flag on both this component and the app. | |
| void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a const char* name. | |
| void | set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a numeric ID (zero heap allocation). | |
| void | set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f) |
| void | set_interval (uint32_t interval, std::function< void()> &&f) |
| bool | cancel_interval (const char *name) |
| Cancel an interval function. | |
| bool | cancel_interval (uint32_t id) |
| bool | cancel_interval (InternalSchedulerID id) |
| void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a const char* name. | |
| void | set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a numeric ID (zero heap allocation). | |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f) |
| void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
| bool | cancel_timeout (const char *name) |
| Cancel a timeout function. | |
| bool | cancel_timeout (uint32_t id) |
| bool | cancel_timeout (InternalSchedulerID id) |
| void | defer (const char *name, std::function< void()> &&f) |
| Defer a callback to the next loop() call with a const char* name. | |
| void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. | |
| void | defer (uint32_t id, std::function< void()> &&f) |
| Defer a callback with a numeric ID (zero heap allocation) | |
| bool | cancel_defer (const char *name) |
| Cancel a defer callback using the specified name, name must not be empty. | |
| bool | cancel_defer (uint32_t id) |
| void | status_clear_warning_slow_path_ () |
| void | status_clear_error_slow_path_ () |
Protected Attributes | |
| std::vector< display::Display * > | displays_ {} |
| size_t | buffer_frac_ {1} |
| bool | full_refresh_ {} |
| bool | resume_on_input_ {} |
| bool | update_when_display_idle_ {} |
| uint8_t * | draw_buf_ {} |
| lv_display_t * | disp_ {} |
| lv_timer_t * | refr_timer_ {} |
| bool | refr_timer_paused_ {} |
| uint32_t | refr_timer_period_ {16} |
| uint16_t | width_ {} |
| uint16_t | height_ {} |
| bool | paused_ {} |
| std::vector< LvPageType * > | pages_ {} |
| size_t | current_page_ {0} |
| bool | show_snow_ {} |
| bool | page_wrap_ {true} |
| bool | big_endian_ {} |
| std::map< lv_group_t *, lv_obj_t * > | focus_marks_ {} |
| CallbackManager< void(uint32_t)> | idle_callbacks_ {} |
| Trigger * | pause_callback_ {} |
| Trigger * | resume_callback_ {} |
| Trigger * | draw_start_callback_ {} |
| Trigger * | draw_end_callback_ {} |
| Trigger * | landscape_callback_ {} |
| Trigger * | portrait_callback_ {} |
| Orientation | orientation_ {Orientation::UNKNOWN} |
| void * | rotate_buf_ {} |
| display::DisplayRotation | rotation_ {display::DISPLAY_ROTATION_0_DEGREES} |
| RotationType | rotation_type_ |
| ppa_client_handle_t | ppa_client_ {} |
Protected Attributes inherited from esphome::PollingComponent | |
| uint32_t | update_interval_ |
Protected Attributes inherited from esphome::Component | |
| uint8_t | component_source_index_ {0} |
| Index into component source PROGMEM lookup table (0 = not set) | |
| uint8_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_CS} |
| Warn threshold in centiseconds (max 2550ms) | |
| uint8_t | component_state_ {0x00} |
| State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion. | |
| volatile bool | pending_enable_loop_ {false} |
| ISR-safe flag for enable_loop_soon_any_context. | |
| ComponentRuntimeStats | runtime_stats_ |
Component for rendering LVGL.
This component renders LVGL widgets on a display. Some initialisation must be done in the constructor since LVGL needs to be initialised before any widgets can be created.
| displays | a list of displays to render onto. All displays must have the same resolution. |
| buffer_frac | the fraction of the display resolution to use for the LVGL draw buffer. A higher value will make animations smoother but also increase memory usage. |
| full_refresh | if true, the display will be fully refreshed on every frame. If false, only changed areas will be updated. |
| draw_rounding | the rounding to use when drawing. A value of 1 will draw without any rounding, a value of 2 will round to the nearest multiple of 2, and so on. |
| resume_on_input | if true, this component will resume rendering when the user presses a key or clicks on the screen. |
| rotation_type | What rotation type to use, if any |
Definition at line 194 of file lvgl_esphome.h.
| esphome::lvgl::LvglComponent::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 ) |
Definition at line 707 of file lvgl_esphome.cpp.
|
static |
Definition at line 211 of file lvgl_esphome.cpp.
|
static |
Definition at line 215 of file lvgl_esphome.cpp.
|
static |
Definition at line 221 of file lvgl_esphome.cpp.
|
inline |
Definition at line 212 of file lvgl_esphome.h.
| void esphome::lvgl::LvglComponent::add_page | ( | LvPageType * | page | ) |
Definition at line 228 of file lvgl_esphome.cpp.
|
protected |
Definition at line 647 of file lvgl_esphome.cpp.
|
protected |
Definition at line 341 of file lvgl_esphome.cpp.
|
protected |
Definition at line 636 of file lvgl_esphome.cpp.
|
inlineprotected |
Definition at line 319 of file lvgl_esphome.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 164 of file lvgl_esphome.cpp.
|
static |
Initialize the LVGL library and register custom events.
Definition at line 198 of file lvgl_esphome.cpp.
|
protected |
Definition at line 416 of file lvgl_esphome.cpp.
| size_t esphome::lvgl::LvglComponent::get_current_page | ( | ) | const |
Definition at line 270 of file lvgl_esphome.cpp.
|
inline |
Definition at line 217 of file lvgl_esphome.h.
|
inline |
Definition at line 309 of file lvgl_esphome.h.
|
inline |
Definition at line 305 of file lvgl_esphome.h.
|
inline |
Definition at line 218 of file lvgl_esphome.h.
|
inlineoverridevirtual |
Reimplemented from esphome::Component.
Definition at line 208 of file lvgl_esphome.h.
|
static |
| obj | A widget |
Definition at line 935 of file lvgl_esphome.cpp.
|
inline |
Definition at line 308 of file lvgl_esphome.h.
|
inline |
Definition at line 230 of file lvgl_esphome.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 835 of file lvgl_esphome.cpp.
|
inlinestatic |
Definition at line 265 of file lvgl_esphome.h.
|
inlinestatic |
Definition at line 251 of file lvgl_esphome.h.
|
inline |
Definition at line 232 of file lvgl_esphome.h.
|
protected |
Definition at line 274 of file lvgl_esphome.cpp.
|
static |
Definition at line 152 of file lvgl_esphome.cpp.
|
static |
Definition at line 157 of file lvgl_esphome.cpp.
|
inline |
Definition at line 287 of file lvgl_esphome.h.
| void esphome::lvgl::LvglComponent::rotate_coordinates | ( | int32_t & | x, |
| int32_t & | y ) const |
Definition at line 112 of file lvgl_esphome.cpp.
|
inline |
Definition at line 284 of file lvgl_esphome.h.
|
inline |
Definition at line 299 of file lvgl_esphome.h.
|
inline |
Definition at line 298 of file lvgl_esphome.h.
|
inline |
Definition at line 286 of file lvgl_esphome.h.
|
inline |
Definition at line 300 of file lvgl_esphome.h.
|
inline |
Definition at line 283 of file lvgl_esphome.h.
|
inline |
Definition at line 296 of file lvgl_esphome.h.
| void esphome::lvgl::LvglComponent::set_paused | ( | bool | paused, |
| bool | show_snow ) |
Definition at line 185 of file lvgl_esphome.cpp.
|
inline |
Definition at line 301 of file lvgl_esphome.h.
|
inline |
Definition at line 223 of file lvgl_esphome.h.
|
protected |
Definition at line 720 of file lvgl_esphome.cpp.
|
inline |
Definition at line 297 of file lvgl_esphome.h.
| void esphome::lvgl::LvglComponent::set_rotation | ( | display::DisplayRotation | rotation | ) |
Definition at line 86 of file lvgl_esphome.cpp.
| void esphome::lvgl::LvglComponent::set_rotation | ( | int | angle | ) |
Set the rotation from an angle in degrees. Must be a multiple of 90.
Definition at line 100 of file lvgl_esphome.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 747 of file lvgl_esphome.cpp.
| void esphome::lvgl::LvglComponent::show_next_page | ( | lv_screen_load_anim_t | anim, |
| uint32_t | time ) |
Definition at line 246 of file lvgl_esphome.cpp.
| void esphome::lvgl::LvglComponent::show_page | ( | size_t | index, |
| lv_screen_load_anim_t | anim, | ||
| uint32_t | time ) |
Definition at line 235 of file lvgl_esphome.cpp.
| void esphome::lvgl::LvglComponent::show_prev_page | ( | lv_screen_load_anim_t | anim, |
| uint32_t | time ) |
Definition at line 258 of file lvgl_esphome.cpp.
|
static |
Definition at line 872 of file lvgl_esphome.cpp.
|
overridevirtual |
Implements esphome::PollingComponent.
Definition at line 827 of file lvgl_esphome.cpp.
|
protected |
Definition at line 736 of file lvgl_esphome.cpp.
|
protected |
Definition at line 657 of file lvgl_esphome.cpp.
|
protected |
Definition at line 355 of file lvgl_esphome.h.
|
protected |
Definition at line 333 of file lvgl_esphome.h.
|
protected |
Definition at line 352 of file lvgl_esphome.h.
|
protected |
Definition at line 339 of file lvgl_esphome.h.
|
protected |
Definition at line 332 of file lvgl_esphome.h.
|
protected |
Definition at line 338 of file lvgl_esphome.h.
|
protected |
Definition at line 362 of file lvgl_esphome.h.
| size_t esphome::lvgl::LvglComponent::draw_rounding {2} |
Definition at line 294 of file lvgl_esphome.h.
|
protected |
Definition at line 361 of file lvgl_esphome.h.
|
protected |
Definition at line 356 of file lvgl_esphome.h.
|
protected |
Definition at line 334 of file lvgl_esphome.h.
|
protected |
Definition at line 349 of file lvgl_esphome.h.
|
protected |
Definition at line 358 of file lvgl_esphome.h.
|
protected |
Definition at line 363 of file lvgl_esphome.h.
|
protected |
Definition at line 365 of file lvgl_esphome.h.
|
protected |
Definition at line 354 of file lvgl_esphome.h.
|
protected |
Definition at line 351 of file lvgl_esphome.h.
|
protected |
Definition at line 359 of file lvgl_esphome.h.
|
protected |
Definition at line 350 of file lvgl_esphome.h.
|
protected |
Definition at line 364 of file lvgl_esphome.h.
|
protected |
Definition at line 370 of file lvgl_esphome.h.
|
protected |
Definition at line 343 of file lvgl_esphome.h.
|
protected |
Definition at line 346 of file lvgl_esphome.h.
|
protected |
Definition at line 347 of file lvgl_esphome.h.
|
protected |
Definition at line 360 of file lvgl_esphome.h.
|
protected |
Definition at line 335 of file lvgl_esphome.h.
|
protected |
Definition at line 366 of file lvgl_esphome.h.
|
protected |
Definition at line 367 of file lvgl_esphome.h.
|
protected |
Definition at line 368 of file lvgl_esphome.h.
|
protected |
Definition at line 353 of file lvgl_esphome.h.
|
protected |
Definition at line 336 of file lvgl_esphome.h.
|
protected |
Definition at line 348 of file lvgl_esphome.h.