UI API
Types & Defs
Defines
-
UI_PART_NOT_UPDATE
-
UI_TEMPORARY_STRING_BUFFER_SIZE
-
UI_BAR_PROPERTY_VALUE
-
UI_BAR_PROPERTY_VALUE_WITH_ANIM
-
UI_BASIC_PROPERTY_POSITION_X
-
UI_BASIC_PROPERTY_POSITION_Y
-
UI_BASIC_PROPERTY_WIDTH
-
UI_BASIC_PROPERTY_HEIGHT
-
UI_DROPDOWN_PROPERTY_SELECTED
-
UI_IMAGE_PROPERTY_IMAGE
-
UI_LABEL_PROPERTY_TEXT
-
UI_ROLLER_PROPERTY_SELECTED
-
UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM
-
UI_SLIDER_PROPERTY_VALUE
-
UI_SLIDER_PROPERTY_VALUE_WITH_ANIM
-
UI_MODIFY_FLAG_ADD
-
UI_MODIFY_FLAG_REMOVE
-
UI_MODIFY_FLAG_TOGGLE
-
UI_MODIFY_STATE_ADD
-
UI_MODIFY_STATE_REMOVE
-
UI_MODIFY_STATE_TOGGLE
Typedefs
-
typedef struct ui_anim_user_data_t ui_anim_user_data_t
-
typedef enum camera_mirror_t camera_mirror_t
-
typedef enum target_camera_t target_camera_t
-
typedef enum ui_error ui_error
Enums
-
enum camera_mirror_t
Values:
-
enumerator Disable
-
enumerator Horizontal
-
enumerator Vertical
-
enumerator Both
-
enumerator Disable
-
struct Screen_Preset
-
struct ui_anim_user_data_t
-
struct Screen_Preset_LoadConfig
Engine working
Functions
-
ui_error ui_preset_screen_load(Screen_Preset *preset, Screen_Preset_LoadConfig *config)
load preset with screens
- Parameters:
preset – preset of screen
Screen_Preset_LoadConfig – config for loading preset
- Returns:
ui_error variable
-
ui_error ui_preset_screen_create(Screen_Preset *preset, lv_obj_t *screen_background, lv_obj_t *screen_ico)
create new preset with screens
- Parameters:
preset – preset of screen
screen_background – bacground screen for new preset
screen_ico – icon screen for new preset
- Returns:
ui_error variable
-
ui_error ui_preset_get_active(Screen_Preset *returned_preset)
get last loaded preset
- Parameters:
returned_preset – empy preset to write last active screens
- Returns:
ui_error variable
-
ui_error ui_preset_screen_delete(Screen_Preset *preset)
delete preset
- Parameters:
preset – preset to delete
- Returns:
ui_error variable
-
ui_error ui_engine_render_lock_from_task(void)
stop render task [start working with ui from tasks & etc …]
- Returns:
ui_error variable
-
ui_error ui_engine_render_lock(void)
stop render task [start working with ui from tasks & etc …]
- Returns:
ui_error variable
-
ui_error ui_engine_render_unlock(void)
free render task [end working with ui from tasks & etc …]
- Returns:
ui_error variable
-
ui_error ui_preset_screen_load_config_get_default(Screen_Preset_LoadConfig *config)
set default values to loading config settings:
- Parameters:
config – config for setting in default
- Returns:
animate_ico = true
- Returns:
animate_bg = true
- Returns:
anim_time = 1
- Returns:
anim_type = LV_SCR_LOAD_ANIM_NONE
- Returns:
delay = 0
- Returns:
update_bg = true
- Returns:
update_ico = true
Objects working
Functions
-
void ui_uefi_set_screen(uint8_t screen)
-
int ui_uefi_get_screen()
-
ui_error ui_obj_event_create(lv_obj_t *target, void *callback, lv_event_code_t filter)
create event to object
- Parameters:
target – object
callback – callback function
filter – filter of type event
- Returns:
ui_error variable
-
ui_error ui_obj_event_send(lv_obj_t *target, lv_event_code_t event_type)
send event to object
- Parameters:
target – object
event_type – event to send
- Returns:
ui_error variable
-
ui_error ui_arc_set_value(lv_obj_t *target, int val)
set value to arc
- Parameters:
trg – arc objects
val – new arc value
- Returns:
ui_error variable
-
ui_error ui_set_text_from_with_division_value_arc(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix, uint8_t division)
set text from arc value with division
- Parameters:
trg – text object
src – arc object
prefix – prefix of text
postfix – prefix of text
division – arc division value
- Returns:
ui_error variable
-
ui_error ui_set_text_from_value_arc(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix)
set text from arc val
- Parameters:
trg – text object
src – arc object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_slider_increment(lv_obj_t *target, int val, bool anim)
increment value of slider
- Parameters:
trg – text object
val – new slider value
anim – enable anim? [true/false]
- Returns:
ui_error variable
-
ui_error ui_set_text_from_value_slider(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix)
set text from slider value
- Parameters:
trg – text object
src – slider object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_slider_set_property(lv_obj_t *target, bool anim, int val)
set value on slider
- Parameters:
target – object whose value will be changed
anim – enable anim? [true/false]
val – new value of slider
- Returns:
ui_error variable
-
ui_error ui_set_text_from_bar_value(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix)
set text from slider value
- Parameters:
trg – text object
src – bar object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_bar_set_property(lv_obj_t *target, bool anim, int val)
set bar value
- Parameters:
trg – bar object
anim – enable anim? [true/false]
val – new value
- Returns:
ui_error variable
-
ui_error ui_set_text_from_variable(lv_obj_t *trg, int value, const char *prefix, const char *postfix)
set text from variable value
- Parameters:
trg – text object
value – (int) variable
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_opacity_set(lv_obj_t *target, int val)
set opa (alpha) to object
- Parameters:
target – the object on which the opa (alpha) will be changed
val – new lvl of opacity (alpha) [0 … 255]
- Returns:
ui_error variable
-
ui_error ui_set_value_dropdown(lv_obj_t *target, int val)
set dropdown selected value
- Parameters:
target – dropdown object
val – new
selectedvalue
- Returns:
ui_error variable
-
ui_error ui_roller_set_property(lv_obj_t *target, bool anim, int val)
set value on roller
- Parameters:
target – object whose value will be changed
anim – enable anim? [true/false]
val – new value of slider
- Returns:
ui_error variable
-
ui_error ui_keyboard_set_target(lv_obj_t *keyboard, lv_obj_t *textarea)
set/unset flag from object
- Parameters:
keyboard – keyboard object
textarea –
textareaobject to which you want to bind the keyboard
- Returns:
ui_error variable
-
ui_error ui_flag_modify(lv_obj_t *target, int32_t flag, int value)
set/unset flag from object
- Parameters:
target – object whose flag will be changed
state – flag for change
value – type of interaction with flag
- Returns:
ui_error variable
-
ui_error ui_state_modify(lv_obj_t *target, int32_t state, int value)
set/unset state from object
- Parameters:
target – object whose state will be changed
state – state for change
value – type of interaction with state
- Returns:
ui_error variable
-
ui_error ui_state_clear(lv_obj_t *target, int32_t state)
clear state from object
- Parameters:
target – object whose state will be changed
state – state for clear [remove]
- Returns:
ui_error variable
-
ui_error ui_state_add(lv_obj_t *target, int32_t state)
add state to object
- Parameters:
target – object whose state will be changed
state – state for add
- Returns:
ui_error variable
-
ui_error ui_flag_clear(lv_obj_t *target, int32_t flag)
clear flag from object
- Parameters:
target – object whose state will be changed
flag – flag for clear [remove]
- Returns:
ui_error variable
-
ui_error ui_flag_add(lv_obj_t *target, int32_t flag)
add flag to object
- Parameters:
target – object whose state will be changed
flag – flag for add
- Returns:
ui_error variable
-
ui_error ui_checked_state_set_text_value(lv_obj_t *trg, lv_obj_t *src, const char *txt_on, const char *txt_off)
-
void ui_anim_callback_free_user_data(lv_anim_t *a)
set cb free of objects after anim
- Parameters:
a – animation
-
void ui_anim_callback_set_x(lv_anim_t *a, int32_t v)
set x pos of objects with anim
- Parameters:
a – animation
v – new
xposition of object
-
void ui_anim_callback_set_y(lv_anim_t *a, int32_t v)
set y pos of objects with anim
- Parameters:
a – animation
v – new
yposition of object
-
void ui_anim_callback_set_width(lv_anim_t *a, int32_t v)
set width of objects with anim
- Parameters:
a – animation
v – new width
-
void ui_anim_callback_set_height(lv_anim_t *a, int32_t v)
set height of objects with anim
- Parameters:
a – animation
v – new height
-
void ui_anim_callback_set_opacity(lv_anim_t *a, int32_t v)
set opacity of objects with anim
- Parameters:
a – animation
v – new opacity
-
void ui_anim_callback_set_image_zoom(lv_anim_t *a, int32_t v)
set image zoom lvl of objects with anim
- Parameters:
a – animation
v – new image zoom
-
void ui_anim_callback_set_image_angle(lv_anim_t *a, int32_t v)
set image angle of objects with anim
- Parameters:
a – animation
v – new image angle
-
void ui_anim_callback_set_image_frame(lv_anim_t *a, int32_t v)
set frame steps of objects with anim
- Parameters:
a – animation
v – num of frame
-
int32_t ui_anim_callback_get_x(lv_anim_t *a)
get x pos of objects with anim
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_y(lv_anim_t *a)
get y pos of objects with anim
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_width(lv_anim_t *a)
change width of object in animation
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_height(lv_anim_t *a)
change height of object in animation
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_opacity(lv_anim_t *a)
change opa (alpha) of object in animation
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_image_zoom(lv_anim_t *a)
change change image zoom of object in animation
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_image_angle(lv_anim_t *a)
change image angle of object in animation
- Parameters:
a – animation
-
int32_t ui_anim_callback_get_image_frame(lv_anim_t *a)
get image frame to object from animation
- Parameters:
a – animation
-
void ui_camera_enable(bool enable, bool ui_engine_lock)
-
void ui_camera_select(uint8_t camera)
-
void ui_camera_mirror(camera_mirror_t mode)
-
ui_error ui_set_time_text_from_rtc(lv_obj_t *trg, const char *prefix, const char *postfix, bool tick)
set time from rtc module (recommended)
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: hour minute
prefix – prefix of text
postfix – prefix of text
tick – add
:to time text
- Returns:
ui_error variable
-
ui_error ui_set_date_text_from_rtc(lv_obj_t *trg, const char *prefix, const char *postfix)
set date from rtc module (recommended)
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: day month year
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_set_timedate_text_from_rtc(lv_obj_t *trg, const char *prefix, const char *postfix)
set time & date from rtc module (not recommended, better use separate functions with date & time)
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: day month year hour minute second
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_set_time_text_from_rtc_plus_seconds(lv_obj_t *trg, const char *prefix, const char *postfix, bool tick)
set time from rtc module
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: hour minute second
prefix – prefix of text
postfix – prefix of text
tick – add
:to time text
- Returns:
ui_error variable
-
ui_error ui_set_image(lv_obj_t *target, uint8_t *val)
set image on object
- Parameters:
target – object whose image will be changed
val – image
- Returns:
ui_error variable
-
int ui_get_speed_gps(void)
get speed from gps to
intvariable- Returns:
speed from gps
Objects working (os safed)
Functions
-
void ui_uefi_set_screen_from_task(uint8_t screen)
-
int ui_uefi_get_screen_from_task()
-
ui_error ui_obj_event_send_from_task(lv_obj_t *target, lv_event_code_t event_type)
send event to object
- Parameters:
target – object
event_type – event to send
- Returns:
ui_error variable
-
ui_error ui_arc_set_value_from_task(lv_obj_t *target, int val)
set value to arc
- Parameters:
trg – arc objects
val – new arc value
- Returns:
ui_error variable
-
ui_error ui_set_text_from_with_division_value_arc_from_task(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix, uint8_t division)
set text from arc value with division
- Parameters:
trg – text object
src – arc object
prefix – prefix of text
postfix – prefix of text
division – arc division value
- Returns:
ui_error variable
-
ui_error ui_set_text_from_value_arc_from_task(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix)
set text from arc val
- Parameters:
trg – text object
src – arc object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_slider_increment_from_task(lv_obj_t *target, int val, bool anim)
increment value of slider
- Parameters:
trg – text object
val – new slider value
anim – enable anim? [true/false]
- Returns:
ui_error variable
-
ui_error ui_set_text_from_value_slider_from_task(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix)
set text from slider value
- Parameters:
trg – text object
src – slider object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_slider_set_property_from_task(lv_obj_t *target, bool anim, int val)
set value on slider
- Parameters:
target – object whose value will be changed
anim – enable anim? [true/false]
val – new value of slider
- Returns:
ui_error variable
-
ui_error ui_set_text_from_bar_value_from_task(lv_obj_t *trg, lv_obj_t *src, const char *prefix, const char *postfix)
set text from slider value
- Parameters:
trg – text object
src – bar object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_bar_set_property_from_task(lv_obj_t *target, bool anim, int val)
set bar value
- Parameters:
trg – bar object
anim – enable anim? [true/false]
val – new value
- Returns:
ui_error variable
-
ui_error ui_set_text_from_variable_from_task(lv_obj_t *trg, int value, const char *prefix, const char *postfix)
set text from variable value
- Parameters:
trg – text object
value – (int) variable
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_opacity_set_from_task(lv_obj_t *target, int val)
set opa (alpha) to object
- Parameters:
target – the object on which the opa (alpha) will be changed
val – new lvl of opacity (alpha) [0 … 255]
- Returns:
ui_error variable
-
ui_error ui_set_value_dropdown_from_task(lv_obj_t *target, int val)
set dropdown selected value
- Parameters:
target – dropdown object
val – new
selectedvalue
- Returns:
ui_error variable
-
ui_error ui_roller_set_property_from_task(lv_obj_t *target, bool anim, int val)
set value on roller
- Parameters:
target – object whose value will be changed
anim – enable anim? [true/false]
val – new value of slider
- Returns:
ui_error variable
-
ui_error ui_keyboard_set_target_from_task(lv_obj_t *keyboard, lv_obj_t *textarea)
set/unset flag from object
- Parameters:
keyboard – keyboard object
textarea –
textareaobject to which you want to bind the keyboard
- Returns:
ui_error variable
-
ui_error ui_flag_modify_from_task(lv_obj_t *target, int32_t flag, int value)
set/unset flag from object
- Parameters:
target – object whose flag will be changed
state – flag for change
value – type of interaction with flag
- Returns:
ui_error variable
-
ui_error ui_state_modify_from_task(lv_obj_t *target, int32_t state, int value)
set/unset state from object
- Parameters:
target – object whose state will be changed
state – state for change
value – type of interaction with state
- Returns:
ui_error variable
-
ui_error ui_state_clear_from_task(lv_obj_t *target, int32_t state)
clear state from object
- Parameters:
target – object whose state will be changed
state – state for clear [remove]
- Returns:
ui_error variable
-
ui_error ui_state_add_from_task(lv_obj_t *target, int32_t state)
add state to object
- Parameters:
target – object whose state will be changed
state – state for add
- Returns:
ui_error variable
-
ui_error ui_flag_clear_from_task(lv_obj_t *target, int32_t flag)
clear flag from object
- Parameters:
target – object whose state will be changed
flag – flag for clear [remove]
- Returns:
ui_error variable
-
ui_error ui_flag_add_from_task(lv_obj_t *target, int32_t flag)
add flag to object
- Parameters:
target – object whose state will be changed
flag – flag for add
- Returns:
ui_error variable
-
ui_error ui_checked_state_set_text_value_from_task(lv_obj_t *trg, lv_obj_t *src, const char *txt_on, const char *txt_off)
-
ui_error ui_set_time_text_from_rtc_from_task(lv_obj_t *trg, const char *prefix, const char *postfix, bool tick)
set time from rtc module (recommended)
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: hour minute
prefix – prefix of text
postfix – prefix of text
tick – add
:to time text
- Returns:
ui_error variable
-
ui_error ui_set_date_text_from_rtc_from_task(lv_obj_t *trg, const char *prefix, const char *postfix)
set date from rtc module (recommended)
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: day month year
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_set_timedate_text_from_rtc_from_task(lv_obj_t *trg, const char *prefix, const char *postfix)
set time & date from rtc module (not recommended, better use separate functions with date & time)
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: day month year hour minute second
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable
-
ui_error ui_set_time_text_from_rtc_plus_seconds_from_task(lv_obj_t *trg, const char *prefix, const char *postfix, bool tick)
set time from rtc module
- Parameters:
trg – object label, the text of which is replaced with time and designations in the format: hour minute second
prefix – prefix of text
postfix – prefix of text
tick – add
:to time text
- Returns:
ui_error variable
-
ui_error ui_set_image(lv_obj_t *target, uint8_t *val)
set image on object
- Parameters:
target – object whose image will be changed
val – image
- Returns:
ui_error variable
-
int ui_get_speed_gps(void)
get speed from gps to
intvariable- Returns:
speed from gps
-
ui_error ui_set_arc_value_from_speed_gps(lv_obj_t *target)
get speed from gps and set to arc object
- Parameters:
target – the arc to which the speed value transmitted by the GPS will be set
- Returns:
ui_error variable
-
ui_error ui_set_text(lv_obj_t *trg, const char *text, const char *prefix, const char *postfix)
set text
- Parameters:
trg – text object
prefix – prefix of text
postfix – prefix of text
- Returns:
ui_error variable