LVGL使用记 - 数据更新显示
·
介绍一下界面数据显示方法
- 关键API:
/**
* Set a an event handler function for an object.
* Used by the user to react on event which happens with the object.
* @param obj pointer to an object
* @param event_cb the new event function
*/
void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb)/*对象事件回调设置函数*/
{
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
obj->event_cb = event_cb;
}
/**
* Send an event to the object
* @param obj pointer to an object
* @param event the type of the event from `lv_event_t`
* @param data arbitrary data depending on the object type and the event. (Usually `NULL`)
* @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event
*/
lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data)/*对象事件发送函数*/
{
if(obj == NULL) return LV_RES_OK;
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
lv_res_t res;
res = lv_event_send_func(obj->event_cb, obj, event, data);
return res;
}
-事件对象初始化绑定事件对象

-更新回调函数编写
- 在其他任务中,数据更新送

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)