lv_draw_unit_t

Struct lv_draw_unit_t 

Source
#[repr(C)]
pub struct lv_draw_unit_t { pub next: *mut lv_draw_unit_t, pub target_layer: *mut lv_layer_t, pub clip_area: *const lv_area_t, pub dispatch_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t, layer: *mut lv_layer_t) -> i32>, pub evaluate_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t, task: *mut lv_draw_task_t) -> i32>, pub wait_for_finish_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t) -> i32>, pub delete_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t) -> i32>, }

Fields§

§next: *mut lv_draw_unit_t§target_layer: *mut lv_layer_t

The target_layer on which drawing should happen

§clip_area: *const lv_area_t§dispatch_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t, layer: *mut lv_layer_t) -> i32>

Called to try to assign a draw task to itself. lv_draw_get_next_available_task can be used to get an independent draw task. A draw task should be assign only if the draw unit can draw it too @param draw_unit pointer to the draw unit @param layer pointer to a layer on which the draw task should be drawn @return >=0: The number of taken draw task: 0 means the task has not yet been completed. 1 means a new task has been accepted. -1: The draw unit wanted to work on a task but couldn’t do that due to some errors (e.g. out of memory). It signals that LVGL should call the dispatcher later again to let draw unit try to start the rendering again.

§evaluate_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t, task: *mut lv_draw_task_t) -> i32>

@param draw_unit @param task @return

§wait_for_finish_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t) -> i32>

Called to signal the unit to complete all tasks in order to return their ready status. This callback can be implemented in case of asynchronous task processing. Below is an example to show the difference between synchronous and asynchronous:

Synchronous: LVGL thread DRAW thread HW

task1 –> submit –> Receive task1 wait_for_finish() <– task1->state = READY <– Complete task1 task2 –> submit –> Receive task2 wait_for_finish() task2->state = READY <– Complete task2 task3 –> submit –> Receive task3 wait_for_finish() <– task3->state = READY <– Complete task3 task4 –> submit –> Receive task4 wait_for_finish() <– task4->state = READY <– Complete task4 NO MORE TASKS

Asynchronous: LVGL thread DRAW thread HW is IDLE task1 –> queue task1 submit –> Receive task1 task2 –> queue task2 is BUSY (with task1) task3 –> queue task3 still BUSY (with task1) task4 –> queue task4 becomes IDLE <– task1->state = READY <– Complete task1 submit –> Receive task2, task3, task4 NO MORE TASKS wait_for_finish_cb() wait_for_finish() <– Complete task2, task3, task4 <– task2->state = READY <– <– task3->state = READY <– <– task4->state = READY <–

@param draw_unit @return

§delete_cb: Option<unsafe extern "C" fn(draw_unit: *mut lv_draw_unit_t) -> i32>

Called to delete draw unit. @param draw_unit @return

Trait Implementations§

Source§

impl Clone for lv_draw_unit_t

Source§

fn clone(&self) -> lv_draw_unit_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for lv_draw_unit_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for lv_draw_unit_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.