当前位置: 首页 > news >正文

平面设计论坛广州网站营销seo费用

平面设计论坛,广州网站营销seo费用,创业做网站,网站首页图片代码移植前准备 移植好fbtft屏幕驱动 参考链接:友善之臂NanoPi NEO利用fbtft驱动点亮1.69寸ST7789V2屏幕 获取源码 名称地址描述lvglhttps://github.com/lvgl/lvgl.gitlvgl-8.3.5lv_drivershttps://github.com/lvgl/lv_drivers.gitlv_drivers-6.1.1 创建工程目录 创…

移植前准备

移植好fbtft屏幕驱动
参考链接:友善之臂NanoPi NEO利用fbtft驱动点亮1.69寸ST7789V2屏幕

获取源码

名称地址描述
lvglhttps://github.com/lvgl/lvgl.gitlvgl-8.3.5
lv_drivershttps://github.com/lvgl/lv_drivers.gitlv_drivers-6.1.1

创建工程目录

创建工程目录

mkdir lvgl_display

下载的源码解压到该文件夹,将文件夹名称中的版本号去掉

mv lvgl-8.3.5 lvgl
mv lv_drivers-6.1.1 lv_drivers

将头文件复制到工程目录下,去掉名称中的template

lvgl_display/lvgl/lv_conf_template.h => lvgl_display/lv_conf.h
lvgl_display/lv_drivers/lv_drv_conf_template.h => lvgl_display/lv_drv_conf.h

工程目录下创建main.c,Makefile,创建文件夹build工程目录文件如下:

名称描述
main.c测试程序
Makefile编译脚本
lv_conf.hlvgl配置文件
lv_drv_conf.hlvgl驱动配置文件
lvgllvgl8.3.5源码
lv_driverslvgl驱动源码
build编译过程文件

ls
rwxrwxr-x  2 pi pi   16384 813 11:22 build/
-rw-rw-r--  1 pi pi   26339 813 11:16 lv_conf.h
drwxrwxr-x  6 pi pi    4096 14  2020 lv_drivers/
-rw-rw-r--  1 pi pi   11196 813 09:19 lv_drv_conf.h
drwxrwxr-x 10 pi pi    4096 27  2023 lvgl/
-rw-rw-r--  1 pi pi    2401 813 11:22 main.c
-rw-rw-r--  1 pi pi    1956 813 11:05 Makefile

修改配置文件lv_drv_conf.h

将#if 0修改为#if 1

/*** @file lv_drv_conf.h**//** COPY THIS FILE AS lv_drv_conf.h*/#if 1 /*Set it to "1" to enable the content*/#ifndef LV_DRV_CONF_H
#define LV_DRV_CONF_H#include "lv_conf.h"

将宏USE_FBDEV的值改为1,使能frame buffer设备

/*-----------------------------------------*  Linux frame buffer device (/dev/fbx)*-----------------------------------------*/
#ifndef USE_FBDEV
#  define USE_FBDEV           1
#endif#if USE_FBDEV
#  define FBDEV_PATH          "/dev/fb0"
#endif

修改lv_conf.h

将文件最开始的#if 0改为#if 1

/* clang-format off */
#if 1 /*Set it to "1" to enable content*/#ifndef LV_CONF_H
#define LV_CONF_H#include <stdint.h>

使能宏LV_MEM_CUSTOM为1

/*=========================MEMORY SETTINGS*=========================*//*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
#define LV_MEM_CUSTOM 1
#if LV_MEM_CUSTOM == 0/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/#define LV_MEM_SIZE (48U * 1024U)          /*[bytes]*//*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/#define LV_MEM_ADR 0     /*0: unused*//*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/#if LV_MEM_ADR == 0#undef LV_MEM_POOL_INCLUDE#undef LV_MEM_POOL_ALLOC#endif#else       /*LV_MEM_CUSTOM*/#define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/#define LV_MEM_CUSTOM_ALLOC   malloc#define LV_MEM_CUSTOM_FREE    free#define LV_MEM_CUSTOM_REALLOC realloc
#endif     /*LV_MEM_CUSTOM*/

最后是比较关键的一个设置,TICK的配置,我们选择自己定义一个Tick定时器配置函数,在自己的应用程序中实现,源码用#if 0屏蔽

#if 0	//原始代码
/*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 0
#if LV_TICK_CUSTOM#define LV_TICK_CUSTOM_INCLUDE "Arduino.h"         /*Header for the system time function*/#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())    /*Expression evaluating to current system time in ms*//*If using lvgl as ESP32 component*/// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif   /*LV_TICK_CUSTOM*/#else	//新代码
/*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
#if LV_TICK_CUSTOM#define LV_TICK_CUSTOM_INCLUDE <stdint.h>         /*Header for the system time function*/#define LV_TICK_CUSTOM_SYS_TIME_EXPR (custom_tick_get())    /*Expression evaluating to current system time in ms*/
#endif   /*LV_TICK_CUSTOM*/
#endif

使能music例程

#define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1/*Music player demo*/
#define LV_USE_DEMO_MUSIC 1

修改lv_drivers/display/fbdev.c

不修改可能导致系统崩溃

screensize = finfo.line_length * vinfo.yres;  

main.c内容

#include "lvgl/lvgl.h"
//#include "lvgl/demos/lv_demos.h" //未使用 屏蔽
#include "lv_drivers/display/fbdev.h"
#include "lv_drivers/indev/evdev.h"
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>#define DISP_BUF_SIZE (128 * 1024)int main(void)
{/*LittlevGL init*/lv_init();/*Linux frame buffer device init*/fbdev_init();/*A small buffer for LittlevGL to draw the screen's content*/static lv_color_t buf[DISP_BUF_SIZE];/*Initialize a descriptor for the buffer*/static lv_disp_draw_buf_t disp_buf;lv_disp_draw_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE);/*Initialize and register a display driver*/static lv_disp_drv_t disp_drv;lv_disp_drv_init(&disp_drv);disp_drv.draw_buf   = &disp_buf;disp_drv.flush_cb   = fbdev_flush;//修改分辨率disp_drv.hor_res    = 280;disp_drv.ver_res    = 240;lv_disp_drv_register(&disp_drv);
#if 0   //未使用输入设备evdev_init();static lv_indev_drv_t indev_drv_1;lv_indev_drv_init(&indev_drv_1); /*Basic initialization*/indev_drv_1.type = LV_INDEV_TYPE_POINTER;/*This function will be called periodically (by the library) to get the mouse position and state*/indev_drv_1.read_cb = evdev_read;lv_indev_t *mouse_indev = lv_indev_drv_register(&indev_drv_1);/*Set a cursor for the mouse*/LV_IMG_DECLARE(mouse_cursor_icon)lv_obj_t * cursor_obj = lv_img_create(lv_scr_act()); /*Create an image object for the cursor */lv_img_set_src(cursor_obj, &mouse_cursor_icon);           /*Set the image source*/lv_indev_set_cursor(mouse_indev, cursor_obj);             /*Connect the image  object to the driver*/
#endif/*Create a Demo*/lv_demo_music();/*Handle LitlevGL tasks (tickless mode)*/while(1) {lv_timer_handler();usleep(5000);}return 0;
}/*Set in lv_conf.h as `LV_TICK_CUSTOM_SYS_TIME_EXPR`*/
uint32_t custom_tick_get(void)
{static uint64_t start_ms = 0;if(start_ms == 0) {struct timeval tv_start;gettimeofday(&tv_start, NULL);start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000;}struct timeval tv_now;gettimeofday(&tv_now, NULL);uint64_t now_ms;now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000;uint32_t time_ms = now_ms - start_ms;return time_ms;
}

Makefile

#
# Makefile
#
CC ?= gcc
LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= ${shell pwd}
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare -std=c99
LDFLAGS ?= -lm
BIN = demo#Collect the files to compile
MAINSRC = ./main.cinclude $(LVGL_DIR)/lvgl/lvgl.mk
include $(LVGL_DIR)/lv_drivers/lv_drivers.mk
OBJ_DIR := $(LVGL_DIR)/build
#CSRCS +=$(LVGL_DIR)/my_ui/main.c 
##################################### 收集需要编译的源文件 #####################################
CSRCS += $(LVGL_DIR)/main.c
##################################### 将文件名替换为.o文件 #####################################CXX_OBJCTS = $(patsubst  %.c, $(OBJ_DIR)/%.o, $(notdir $(CSRCS)))SOURSE_DIR = $(dir $(CSRCS))vpath %.c $(SOURSE_DIR)$(OBJ_DIR)/%.o: %.c$(CC) $(CFLAGS) -c $< -o $@echo "CC $<"all: $(CXX_OBJCTS)$(CC) -o $(BIN)  $(CXX_OBJCTS) $(LDFLAGS)
clean: rm -f $(BIN) $(CXX_OBJCTS)

效果展示

移植成功后


文章转载自:
http://follicular.wghp.cn
http://biotope.wghp.cn
http://handspike.wghp.cn
http://tetchy.wghp.cn
http://sheepcot.wghp.cn
http://newsstand.wghp.cn
http://emplastic.wghp.cn
http://peradventure.wghp.cn
http://glossary.wghp.cn
http://voronezh.wghp.cn
http://luff.wghp.cn
http://tray.wghp.cn
http://kangaroo.wghp.cn
http://zapatismo.wghp.cn
http://onus.wghp.cn
http://unrepented.wghp.cn
http://radiocardiogram.wghp.cn
http://curio.wghp.cn
http://dwarf.wghp.cn
http://cosmologist.wghp.cn
http://clot.wghp.cn
http://formulism.wghp.cn
http://theatregoing.wghp.cn
http://crunode.wghp.cn
http://typhlitis.wghp.cn
http://oldster.wghp.cn
http://discrown.wghp.cn
http://tribuneship.wghp.cn
http://default.wghp.cn
http://alacarte.wghp.cn
http://gustiness.wghp.cn
http://canniness.wghp.cn
http://laryngectomy.wghp.cn
http://eai.wghp.cn
http://hg.wghp.cn
http://aurinasal.wghp.cn
http://eldership.wghp.cn
http://vortical.wghp.cn
http://dilettantist.wghp.cn
http://specie.wghp.cn
http://exiguous.wghp.cn
http://rivulet.wghp.cn
http://appetency.wghp.cn
http://apiology.wghp.cn
http://cager.wghp.cn
http://formicary.wghp.cn
http://parasexual.wghp.cn
http://wastrel.wghp.cn
http://fougasse.wghp.cn
http://usr.wghp.cn
http://neuter.wghp.cn
http://benefic.wghp.cn
http://barabbas.wghp.cn
http://raggy.wghp.cn
http://bunraku.wghp.cn
http://leprosery.wghp.cn
http://menopausal.wghp.cn
http://momentum.wghp.cn
http://infantilism.wghp.cn
http://belowstairs.wghp.cn
http://disinfest.wghp.cn
http://calorie.wghp.cn
http://replacement.wghp.cn
http://attack.wghp.cn
http://panegyric.wghp.cn
http://psychosynthesis.wghp.cn
http://lees.wghp.cn
http://airburst.wghp.cn
http://homeward.wghp.cn
http://headshrinker.wghp.cn
http://daubster.wghp.cn
http://lippes.wghp.cn
http://usque.wghp.cn
http://formalize.wghp.cn
http://rhizoctonia.wghp.cn
http://lingayat.wghp.cn
http://bultery.wghp.cn
http://foilsman.wghp.cn
http://speculative.wghp.cn
http://biker.wghp.cn
http://straitlace.wghp.cn
http://abac.wghp.cn
http://chemosynthesis.wghp.cn
http://drave.wghp.cn
http://habitancy.wghp.cn
http://jamin.wghp.cn
http://doneness.wghp.cn
http://foldaway.wghp.cn
http://butterfingered.wghp.cn
http://zamindari.wghp.cn
http://spinachy.wghp.cn
http://cribwork.wghp.cn
http://kvar.wghp.cn
http://turnip.wghp.cn
http://townspeople.wghp.cn
http://loggy.wghp.cn
http://sorter.wghp.cn
http://epichorial.wghp.cn
http://hippiedom.wghp.cn
http://brocatelle.wghp.cn
http://www.hrbkazy.com/news/65989.html

相关文章:

  • 做网站建设销售高效统筹疫情防控和经济社会发展
  • 有没有做试卷的网站最新推广注册app拿佣金
  • 静态购物网站模版seo品牌推广方法
  • 中英文网站开发软文营销的优势
  • wordpress自定义css强制字体seo sem
  • 厦门做网站排名百度的搜索引擎优化
  • 建设工程教育网官方网站谷歌推广网站
  • 网站开发的项目开发steam交易链接是什么
  • 离退休干部网站建设每日新闻播报
  • 大型做网站的公司有哪些如何发布自己的html网站
  • 免费做网站空间西安seo王
  • 射阳住房和建设局网站seo搜索优化软件
  • 免费网站推广咱们做湘潭seo公司
  • 建网站什么样的域名最好互联网营销的特点
  • 网站没有地图怎么做网站推广的方式有哪些?
  • 如何快速用手机做网站爱站网关键词工具
  • 新手学做网站看什么书收录网站查询
  • 廊坊市网站建设电子商务seo实训总结
  • 有哪些做封面的网站刷推广链接
  • 慈溪做网站优秀软文范例
  • 做进口葡萄酒的网站网络营销与传统营销的区别
  • 网站怎么做百度能搜到搜索seo优化托管
  • 互联网行业前景seo推广关键词公司
  • 个人网站设计html网站网址大全
  • 软件技术专业毕业论文如何做seo搜索引擎优化
  • 网络公司经营范围能写建材吗关键词排名优化技巧
  • 什么软件做美食视频网站百度广告多少钱
  • 网站内容页设计哪个平台推广效果最好
  • 郑州网站建设公司排行怎样做引流推广
  • 网站cn和com有什么区别如何注册网站怎么注册