// lvgl 初始化lv_init();// 初始化显示器和创建用于绘图的缓冲区lv_port_disp_init();//找到 LittelvGL 支持的输入设备lv_port_indev_init(); 然后我们就可以,写我们第一个LVGL的应用“Hello world”: /*更改活动屏幕的背景颜色*/lv_obj_set_style_bg_color(lv_scr_act(),lv_color_hex(0x003...
■ LVGL-基础对象(lv_obj_t)就是一个矩形 ■ LVGL-(lv_obj_t)基本属性 ■ LVGL-(lv_obj_t)大小 ■ LVGL-(lv_obj_t)位置 ■ LVGL-(lv_obj_t)对齐 ■ LVGL-(lv_obj_t)样式 ■ 设置样式函数 ■ 设置样式枚举 ■ 设置样式(大小,位置,背景,轮廓,边框,阴影,其他) ■ 设置控件子控件样式 ■ LVGL...
lv_port_disp.c是屏幕驱动接口,是移植重点,可以拷贝lvgl / env_support / rt_thread / lv_rt_thread_port.h进行修改 如下所示: 只有一个put_px()函数需要自己根据屏幕类型去实现,即画点函数 1/**2* @file lv_port_disp_templ.c3*4*/56/*Copy this file as "lv_port_disp.c" and set this valu...
voidlv_obj_align(lv_obj_t* obj,lv_align_talign,lv_coord_tx_ofs,lv_coord_ty_ofs); align指定了控件的对齐方式,可以检查枚举类型lv_align_t来获取支持的对齐方式。x_ofs和y_ofs是对齐后的额外偏移量,正值表示额外向右下偏移。 LVGL 包含了许多枚举类型,如果不知道该如何传值,可以查看头文件包含的枚举...
static void touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { static lv_coord_t last_x = 0; static lv_coord_t last_y = 0; /*Save the pressed coordinates and the state*/ // if(touchpad_is_pressed()) { ...
typedef int32_t lv_coord_t;#elsetypedef int16_t lv_coord_t;#endif 默认不开启大尺寸(在lv_conf.h定义),因此是int16_t类型,-32768~32767,一般也不会有超过这么大尺寸的屏幕或者虚拟屏幕。 另外一个重要的类型是颜色,即lv_color_t。 typedefLV_CONCAT3(lv_color,LV_COLOR_DEPTH,_t)lv_color_t; ...
lv_coord_t ext_click_pad成员表示控件的点击扩展板,因为有时候点击的位置可能在控件的边缘而不起作用,那么通过扩展点击的有效区域就可以解决这个问题,也就是往四周延伸一些有效距离,比如函数lv_obj_get_click_area就是通过控件的区域coords扩展ext_click_pad来实现的。
LV_EVENT_COVER_CHECK, /**< Check if the object fully covers an area. The event parameter is `lv_cover_check_info_t *`.*/ LV_EVENT_REFR_EXT_DRAW_SIZE, /**< Get the required extra draw area around the object (e.g. for shadow). The event parameter is `lv_coord_t *` to stor...
lv_coord_tsrc_new_line_step_byte=src_new_line_step_px*LV_IMG_PX_SIZE_ALPHA_BYTE; lv_coord_tdest_h=lv_area_get_height(dest_area); lv_coord_tdest_w=lv_area_get_width(dest_area); for(y=0;y<dest_h;y++) { for(x=0;x<dest_w;x++) { ...
#define LV_COLOR_DEPTH 32 1. 2. 2.显示功能移植 To register a display for LVGL, alv_disp_draw_buf_tand alv_disp_drv_tvariable have to be initialized. lv_disp_draw_buf_tcontains internal graphic buffer(s) called draw buffer(s). ...