Events
lv_display_add_event_cb(disp, event_cb, LV_EVENT_..., user_data) adds an event handler to a display.
If you added user_data
to the Display, you can retrieve it in an event like this:
lv_display_t * display1;
my_type_t * my_user_data;
display1 = (lv_display_t *)lv_event_get_current_target(e);
my_user_data = lv_display_get_user_data(display1);
The following events are sent for Display (lv_display_t) objects:
LV_EVENT_INVALIDATE_AREA
An area is invalidated (marked for redraw). lv_event_get_param(e) returns a pointer to anlv_area_t
object with the coordinates of the area to be invalidated. The area can be freely modified if needed to adapt it a special requirement of the display. Usually needed with monochrome displays to invalidateN x 8
rows or columns in one pass.LV_EVENT_RESOLUTION_CHANGED
: Sent when the resolution changes due tolv_display_set_resolution()
orlv_display_set_rotation()
.LV_EVENT_COLOR_FORMAT_CHANGED
: Sent as a result of any call to lv_display_set_color_format().LV_EVENT_REFR_REQUEST
: Sent when something happened that requires redraw.LV_EVENT_REFR_START
: Sent before a refreshing cycle starts. Sent even if there is nothing to redraw.LV_EVENT_REFR_READY
: Sent when refreshing has been completed (after rendering and calling Flush Callback). Sent even if no redraw happened.LV_EVENT_RENDER_START
: Sent just before rendering begins.LV_EVENT_RENDER_READY
: Sent after rendering has been completed (before calling Flush Callback)LV_EVENT_FLUSH_START
: Sent before Flush Callback is called.LV_EVENT_FLUSH_FINISH
: Sent after Flush Callback call has returned.LV_EVENT_FLUSH_WAIT_START
: Sent at the beginning of internal call to wait_for_flushing() – happens whether or not any waiting will actually occur. Call returns immediately if disp->flushing == 0.LV_EVENT_FLUSH_WAIT_FINISH
: Sent when the call to wait_for_flushing() is about to return, regardless whether any actual waiting occurred.