Sparklet as Library
Overview
Sparklet is a graphics engine library that transforms embedded hardware into a user experience console. It performs well with any supported hardware and offers an intuitive user experience with its optimized rendering & hardware acceleration.
As mentioned earlier, the Flint builder processes files, validates them and converts them to a binary format that can be read by the Sparklet engine.
srec file loaded into the external flash using the Eflash Loader tool. Sparklet consumes the binary file from external flash and updates the hardware.
![]()
Process Flow
The High-Level APIs used in User Software are as below:
API |
Functionality |
---|---|
int sgui_app_report_error (int error_code, int sub_code, void *ptr_extra_info) |
The error callback from Sparklet which needs to be handled by user application |
int sgui_cb_is_point_for_touch (INT16U uw_id, INT16S s16_x, INT16S s16_y) |
To let know the Sparklet whether to process the mouse events for a particular widget. |
int rs_data_info_write_user_callback (RS_DATA_ID detail, void *ptr_value) |
A callback thrown from Sparklet before writing to any data bridge/ data info variables |
int32_t rs_sgui_ctrl_set_ui_state (uint32_t u32_ctrl_id, int32_t s32_ui_state) |
This function is used to set the self UI state of the widget. |
int32_t rs_sgui_ctrl_set_internal_state (uint32_t u32_ctrl_id, int32_t s32_internal_state) |
This function is used to set the Internal state of the widget. |
int32_t rs_hsm_get_current_state(uint32_t id) |
This function is used to get the current state of HSM |
int32_t rs_sgui_widget_show(uint32_t u32_ctrl_id, int show) |
This function is used to show or hide the widget. |
int32_t rs_sgui_widget_enable(uint32_t u32_ctrl_id, int enble) |
This function is used to enable or disable the widget. |
int32_t rs_sgui_post_key_event (uint16_t key) int32_t rs_user_action_callback(uint32_t u32_event, uint32_t u32_id, void *ptr_value2, void *ptr_value3) |
This API is used to send a key event to machine A callback from Sparklet for State change, button actions, swipe actions, custom event completion, etc |
int32_t rs_sgui _ctrl_get_internal_state(uint32_t u32_ctrl_id) |
This function is used to get the current internal state of the widget. |
int32_t rs_send_custom_event (uint16_t u16_event_id) |
This function is used to send a custom event to Sparklet |
int is_3d_widget (int uw_id) |
To let the Sparklet know which are the controls to be drawn in 3D |
int32_t rs_sgui_widget_redraw(uint32_t u32_ctrl_id) |
This function is used to redraw the image. |
int32_t rs_sgui_placeholder_show_view (int32_t view_holder_id, int32_t view_id) |
This API is used to set which view to be mapped to the placeholder |
int32_t rs_sgui_send _key_down_to_control(uint16_t u16_id, char gch_key) |
To send a key up/down/left/right event to scrollview |
void sgui_force _pending_transition_completion (void) |
This API is used to achieve the end state of any on-going or upcoming transitions immediately |
void sgui_reset _force_transition_completion (void) |
This API is used to enable normal event flow for upcoming transitions |
int sgui_validate_image (void *start_addr, int img_type, int validation_type) |
This API is used to validate the available image with start and end or CRC check |
int rs_data_read_to_mem_for_type (RS_DATA_ID data_id, void *ptr_value, int target_type) |
This API is used to read value from data bridge |
void sgui_get_image_version (INT32U *ptr_major, INT32U *ptr_minor, INT32U *ptr_level) |
This API is used to get the image version |
To access comprehensive information about Sparklet API’s and the compilation process, please follow this link: https://www.embien.com/documentation/sparklet-gui-library/