voidlv_obj_set_pos(struct_lv_obj_t*obj,lv_coord_tx,lv_coord_ty); voidlv_obj_set_size(struct_lv_obj_t*obj,lv_coord_tw,lv_coord_th); lv_coord_tlv_obj_get_width(conststruct_lv_obj_t*obj); //lv_obj_styles.h voidlv_obj_add_style(struct_lv_obj_t*obj,lv_style_t*style,lv_...
We would need to define LV_USE_USER_DATA_MULTI to 1 and single to 0 to make it really generic (user_data that can be deduced from callback name). Do you plan to change all callbacks in that manner? (a quick search shows get_bitmap and get_width, for example, don't have user_d...
/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/typedefvoid*lv_obj_user_data_t;typedefstruct_lv_obj_t{//Other members#ifLV_USE_USER_DATAlv_obj_user_data_tuser_data;/**< Custom user data for object.*/#endif}lv_obj_t; ...
lv_obj_t* cont =lv_obj_create(lv_scr_act());lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP);lv_obj_set_size(cont,160,180);lv_obj_set_flex_align(cont, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);lv_obj_set_style_base_dir(cont, LV_BASE_DIR_R...
Set the coordinates*/// data->point.x = touchX;// data->point.y = touchY;// Serial.print( "Data x " );// Serial.println( touchX );// Serial.print( "Data y " );// Serial.println( touchY );// }}voidlvgl_user_init(void){lv_init();/*Set the touchscreen calibration data,...
#include<lvgl.h>#include<TFT_eSPI.h>staticconstuint16_tscreenWidth=240;staticconstuint16_tscreenHeight=320;staticlv_disp_draw_buf_tdraw_buf;staticlv_color_tbuf[screenWidth*10];TFT_eSPItft=TFT_eSPI(screenWidth,screenHeight);/* TFT instance */#if LV_USE_LOG != 0/* Serial debugging */...
/*Use a custom tick source that tells the elapsed time in milliseconds.*It removes the need to manually update the tick with `lv_tick_inc()`)*/#define LV_TICK_CUSTOM 1 两个函数 需要定义两个函数给 LVGL 使用,一个是 TFT 屏的描点函数,一个是触摸屏的获取触摸位置的函数。仅需提描点函数给...
lv_run(); } void lv_example_point_task(lv_task_t *task) { lv_point(task->user_data, 200, 200); lv_task_sleep_until_ms(task, 1000); } #endif ``` 这个例子中,我们创建了一个窗口,并在窗口的中心画了一个点。点的颜色是红色,半径为10。©...
该文件其实就是LVGL官方移植文档中所提到的lv_conf.h,它是基于lv_conf_template.h修改而来。值得说明的是,一些模块的开关宏都被删除了,例如: 代码语言:javascript 复制 LV_USE_DRAW_PXPLV_USE_DRAW_DAVE2D…… 这是因为,当我们在RTE配置窗口中勾选对应选项时,cmsis-pack就会自动把对应的宏定义加入到 RTE_Compo...
void lv_example_scroll_1(void) { /*Create an object with the new style*/ lv_obj_t * panel = lv_obj_create(lv_screen_active()); lv_obj_set_size(panel, 200, 200); lv_obj_center(panel); lv_obj_t * child; lv_obj_t * label; ...