#define LV_USE_THEME_MATERIAL 1 /*Flat theme with bold colors and light shadows*/
#define LV_USE_THEME_ZEN 1 /*Peaceful, mainly light theme */
#define LV_USE_THEME_NEMO 1 /*Water-like theme based on the movie 'Finding Nemo'*/
/*==================
* FONT USAGE
*===================*/
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
* The symbols are available via `LV_SYMBOL_...` defines
* More info about fonts: https://docs.littlevgl.com/#Fonts
* To create a new font go to: https://littlevgl.com/ttf-font-to-c-array
*/
/* Robot fonts with bpp = 4
* https://fonts.google.com/specimen/Roboto */
#define LV_FONT_ROBOTO_12 0
#define LV_FONT_ROBOTO_16 1
#define LV_FONT_ROBOTO_22 0
#define LV_FONT_ROBOTO_28 0
/*Pixel perfect monospace font
* http://pelulamu.net/unscii/ */
#define LV_FONT_UNSCII_8 0
/* Optionally declare your custom fonts here.
* You can use these fonts as default font too
* and they will be available globally. E.g.
* #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1)
* LV_FONT_DECLARE(my_font_2)
*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font from the built-in fonts*/
#define LV_FONT_DEFAULT &lv_font_roboto_16
/* Enable it if you have fonts with a lot of characters.
* The limit depends on the font size, font face and bpp
* but with > 10,000 characters if you see issues probably you need to enable it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
typedef void * lv_font_user_data_t;
/*=================
* Text settings
*=================*/
/* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
* */
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS ' ,.;:-_'
/*===================
* LV_OBJ SETTINGS
*==================*/
/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
typedef void * lv_obj_user_data_t;
/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
#define LV_USE_OBJ_REALIGN 1
/* Enable to make the object clickable on a larger area.
* LV_EXT_CLICK_AREA_OFF or 0: Disable this feature
* LV_EXT_CLICK_AREA_TINY: The extra area can be adjusted horizontally and vertically (0..255 px)
* LV_EXT_CLICK_AREA_FULL: The extra area can be adjusted in all 4 directions (-32k..+32k px)
*/
#define LV_USE_EXT_CLICK_AREA LV_EXT_CLICK_AREA_OFF
/*==================
* LV OBJ X USAGE
*================*/
/*
* Documentation of the object types: https://docs.littlevgl.com/#Object-types
*/
/*Arc (dependencies: -)*/
#define LV_USE_ARC 1
/*Bar (dependencies: -)*/
#define LV_USE_BAR 1
/*Button (dependencies: lv_cont*/
#define LV_USE_BTN 1
#if LV_USE_BTN != 0
/*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/
# define LV_BTN_INK_EFFECT 0
#endif
/*Button matrix (dependencies: -)*/
#define LV_USE_BTNM 1
/*Calendar (dependencies: -)*/
#define LV_USE_CALENDAR 1
/*Canvas (dependencies: lv_img)*/
#define LV_USE_CANVAS 1
/*Check box (dependencies: lv_btn, lv_label)*/
#define LV_USE_CB 1
/*Chart (dependencies: -)*/
#define LV_USE_CHART 1
#if LV_USE_CHART
# define LV_CHART_AXIS_TICK_LABEL_MAX_LEN 20
#endif
/*Container (dependencies: -*/
#define LV_USE_CONT 1
/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/
#define LV_USE_DDLIST 1
#if LV_USE_DDLIST != 0
/*Open and close default animation time [ms] (0: no animation)*/
# define LV_DDLIST_DEF_ANIM_TIME 200
#endif
/*Gauge (dependencies:lv_bar, lv_lmeter)*/
#define LV_USE_GAUGE 1
/*Image (dependencies: lv_label*/
#define LV_USE_IMG 1
/*Image Button (dependencies: lv_btn*/
#define LV_USE_IMGBTN 1
#if LV_USE_IMGBTN
/*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
# define LV_IMGBTN_TILED 0
#endif
/*Keyboard (dependencies: lv_btnm)*/
#define LV_USE_KB 1
/*Label (dependencies: -*/
#define LV_USE_LABEL 1
#if LV_USE_LABEL != 0
/*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/
# define LV_LABEL_DEF_SCROLL_SPEED 25
/* Waiting period at beginning/end of animation cycle */
# define LV_LABEL_WAIT_CHAR_COUNT 3
/*Enable selecting text of the label */
# define LV_LABEL_TEXT_SEL 0
/*Store extra some info in labels (12 bytes) to speed up drawing of very long texts*/
# define LV_LABEL_LONG_TXT_HINT 0
#endif
/*LED (dependencies: -)*/
#define LV_USE_LED 1
/*Line (dependencies: -*/
#define LV_USE_LINE 1
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
#define LV_USE_LIST 1
#if LV_USE_LIST != 0
/*Default animation time of focusing to a list element [ms] (0: no animation) */
# define LV_LIST_DEF_ANIM_TIME 100
#endif
/*Line meter (dependencies: *;)*/
#define LV_USE_LMETER 1
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
#define LV_USE_MBOX 1
/*Page (dependencies: lv_cont)*/
#define LV_USE_PAGE 1
#if LV_USE_PAGE != 0
/*Focus default animation time [ms] (0: no animation)*/
# define LV_PAGE_DEF_ANIM_TIME 400
#endif
/*Preload (dependencies: lv_arc, lv_anim)*/
#define LV_USE_PRELOAD 1
#if LV_USE_PRELOAD != 0
# define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/
# define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/
# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC
#endif
/*Roller (dependencies: lv_ddlist)*/
#define LV_USE_ROLLER 1
#if LV_USE_ROLLER != 0
/*Focus animation time [ms] (0: no animation)*/
# define LV_ROLLER_DEF_ANIM_TIME 200
/*Number of extra 'pages' when the roller is infinite*/
# define LV_ROLLER_INF_PAGES 7
#endif
/*Slider (dependencies: lv_bar)*/
#define LV_USE_SLIDER 1
/*Spinbox (dependencies: lv_ta)*/
#define LV_USE_SPINBOX 1
/*Switch (dependencies: lv_slider)*/
#define LV_USE_SW 1
/*Text area (dependencies: lv_label, lv_page)*/
#define LV_USE_TA 1
#if LV_USE_TA != 0
# define LV_TA_DEF_CURSOR_BLINK_TIME 400 /*ms*/
# define LV_TA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
/*Table (dependencies: lv_label)*/
#define LV_USE_TABLE 1
#if LV_USE_TABLE
# define LV_TABLE_COL_MAX 12
#endif
/*Tab (dependencies: lv_page, lv_btnm)*/
#define LV_USE_TABVIEW 1
# if LV_USE_TABVIEW != 0
/*Time of slide animation [ms] (0: no animation)*/
# define LV_TABVIEW_DEF_ANIM_TIME 300
#endif
/*Tileview (dependencies: lv_page) */
#define LV_USE_TILEVIEW 1
#if LV_USE_TILEVIEW
/*Time of slide animation [ms] (0: no animation)*/
# define LV_TILEVIEW_DEF_ANIM_TIME 300
#endif
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
#define LV_USE_WIN 1
/*==================
* Non-user section
*==================*/
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
# define _CRT_SECURE_NO_WARNINGS
#endif
/*--END OF LV_CONF_H--*/
/*Be sure every define has a default value*/
#include 'lvgl/src/lv_conf_checker.h'
#endif /*LV_CONF_H*/
#endif /*End of 'Content enable'*/
主要分辨率要選成自己的屏幕對(duì)于的,并關(guān)閉系統(tǒng)支持~
下面我們對(duì)底層進(jìn)行移植:
主要是lcd驅(qū)動(dòng)及TOUCH驅(qū)動(dòng),我們把LVGL里面porting文件夾里面的temp進(jìn)行修改:
其中:
lv_port_dis.c
/**
* @file lv_port_disp.c
*
*/
/*Copy this file as 'lv_port_disp.c' and set this value to '1' to enable content*/
#if 1
/*********************
* INCLUDES
*********************/
#include 'lv_port_disp.h'
#include 'lcd.h'
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void disp_init(void);
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
#if LV_USE_GPU
static void gpu_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
static void gpu_fill(lv_color_t * dest, uint32_t length, lv_color_t color);
#endif
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_port_disp_init(void)
{
/*-------------------------
* Initialize your display
* -----------------------*/
disp_init();
/*-----------------------------
* Create a buffer for drawing
*----------------------------*/
/* Example for 1) */
static lv_disp_buf_t disp_buf_1;
static lv_color_t buf1_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
lv_disp_buf_init(&disp_buf_1, buf1_1, NULL, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
/*-----------------------------------
* Register the display in LittlevGL
*----------------------------------*/
lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
/*Set up the functions to access to your display*/
/*Set the resolution of the display*/
//適配多個(gè)屏幕
disp_drv.hor_res = lcddev.width;
disp_drv.ver_res = lcddev.height;
上一篇:GD32開發(fā)實(shí)戰(zhàn)指南(基礎(chǔ)篇) 第10章 串口通信
下一篇:GD32開發(fā)實(shí)戰(zhàn)指南(基礎(chǔ)篇) 第5章 跳動(dòng)的心臟-Systick
設(shè)計(jì)資源 培訓(xùn) 開發(fā)板 精華推薦
- 英飛凌微控制器:以全新實(shí)惠套件和強(qiáng)大開發(fā)環(huán)境為開發(fā)者提供支持
- iTOP-i.MX6開發(fā)板設(shè)備數(shù)驅(qū)動(dòng)Menuconfig的用法
- 迅為IMX6ULL開發(fā)板Qt for Android搭建開發(fā)環(huán)境
- 迅為i.MX8M mini開發(fā)板Windots QT系統(tǒng)開發(fā)環(huán)境搭建
- 迅為IMX8MM開發(fā)板Yocto系統(tǒng)使用Gstarwmra(一)
- 迅為IMX8M mini開發(fā)板Linix系統(tǒng)修改默認(rèn)屏幕
- iTOP-4412開發(fā)板支持4G以上文件系統(tǒng)擴(kuò)展
- 迅為IMX8MM開發(fā)板Yocto系統(tǒng)設(shè)置開機(jī)自啟動(dòng)
- 迅為IMX6Q開發(fā)板 Buildroot文件系統(tǒng)mqtt測(cè)試
- ADT7490EBZEVB,用于 ADT7490 熱監(jiān)視器和 PWM 風(fēng)扇控制器的評(píng)估板
- LT1172CT、5V/1.25A 高效 5V 降壓轉(zhuǎn)換器的典型應(yīng)用
- AN-5065 視頻開關(guān)應(yīng)用電路
- LT1372,單片式 DC/DC 轉(zhuǎn)換器打破速度限制以縮小電路板空間
- 自制83鍵鍵盤
- DK-MAXII-1270N,MAX II 開發(fā)板,包含在 MAX II 開發(fā)套件中
- LT1170HVIT、-12/5A 正負(fù)降壓-升壓轉(zhuǎn)換器的典型應(yīng)用
- CN0383
- LTC6261IDC 橋接式差分輸出運(yùn)算放大器的典型應(yīng)用
- 使用 Infineon Technologies AG 的 IRU3073 的參考設(shè)計(jì)
- BOE(京東方)發(fā)布未來三年股東回報(bào)規(guī)劃 一攬子方案提升長期投資價(jià)值
- 車載以太網(wǎng)-SOME/IP簡介
- 圓柱電池市場“洗牌”醞釀,場景爭奪戰(zhàn)打響
- 4月15日德州儀器攜手庫卡發(fā)布新一代工業(yè)機(jī)器人控制器,定義安全與效率新標(biāo)桿
- 大眾汽車集團(tuán)在中國推出全新AI驅(qū)動(dòng)ADAS系統(tǒng) 面向下一代智能電動(dòng)汽車
- 納微電半導(dǎo)體推出最新SiCPAK?電源模塊
- “鈉新”、“驍遙雙核”……寧德時(shí)代開啟多核時(shí)代
- 地平線發(fā)布HSD「全家桶」,城市NOA戰(zhàn)局迎來「新變量」
- 地平線輔助駕駛系統(tǒng)發(fā)布:軟硬一體
- TrendForce:預(yù)計(jì)中國市場2025年人形機(jī)器人本體產(chǎn)值將超過45億人民幣
- 感恩十載 與你同在 EEWORLD十周年
- 有獎(jiǎng)直播:安世半導(dǎo)體先進(jìn) SiC MOSFET 助力提升 EV-Charger 和 OBC 應(yīng)用能效
- Digi-Key KOL視頻來襲~歡迎進(jìn)入MicroPython的奇妙世界
- 邀請(qǐng)好友體驗(yàn)WEBENCH,禮品豐厚你有他也有!
- 開啟Altera SoC體驗(yàn)之旅,玩轉(zhuǎn)Altera Cyclone V系列SoC
- 來英飛凌旗艦店,探尋秋日好物!
- 齊分享,月月有獎(jiǎng)第25期活動(dòng)華麗升級(jí)來襲
- 全民行動(dòng),大家一起上干貨!發(fā)表,推薦干貨就有禮~
- 給電機(jī)技術(shù)做個(gè)普查
- 2018年工業(yè)機(jī)器人銷量同比僅增長1% 汽車行業(yè)不給力拖累需求
- 技術(shù)文章—資深工程師的環(huán)路補(bǔ)償經(jīng)驗(yàn)
- 臺(tái)積電封裝技術(shù)獲新突破,恐獨(dú)搶蘋果大單
- 5G基帶芯片的六國演義
- 專注研發(fā)智能特種機(jī)器人 史河科技獲得千萬級(jí)人民幣天使輪融資
- NI針對(duì)5G新要求的測(cè)試解決方案
- 電源的“尺寸、效率和EMI”三大問題的解決思路
- 顧文軍:國內(nèi)政策正暖風(fēng)不斷 半導(dǎo)體企業(yè)需潛心研發(fā)
- Facebook正在建立半導(dǎo)體團(tuán)隊(duì)