娇小w搡bbbb搡bbb,《第一次の人妻》,中国成熟妇女毛茸茸,边啃奶头边躁狠狠躁视频免费观看

【技術(shù)分享】星空派GD32開發(fā)板LVGL移植經(jīng)驗(yàn)分享

發(fā)布者:真誠友愛最新更新時(shí)間:2024-11-08 來源: elecfans關(guān)鍵字:GD32開發(fā)板 手機(jī)看文章 掃描二維碼
隨時(shí)隨地手機(jī)看文章

#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;

[1] [2] [3]
關(guān)鍵字:GD32開發(fā)板 引用地址:【技術(shù)分享】星空派GD32開發(fā)板LVGL移植經(jīng)驗(yàn)分享

上一篇:GD32開發(fā)實(shí)戰(zhàn)指南(基礎(chǔ)篇) 第10章 串口通信
下一篇:GD32開發(fā)實(shí)戰(zhàn)指南(基礎(chǔ)篇) 第5章 跳動(dòng)的心臟-Systick

0
添点儿料...
无论热点新闻、行业分析、技术干货……
設(shè)計(jì)資源 培訓(xùn) 開發(fā)板 精華推薦

最新單片機(jī)文章

 
EEWorld訂閱號(hào)

 
EEWorld服務(wù)號(hào)

 
汽車開發(fā)圈

 
機(jī)器人開發(fā)圈

電子工程世界版權(quán)所有 京ICP證060456號(hào) 京ICP備10001474號(hào)-1 電信業(yè)務(wù)審批[2006]字第258號(hào)函 京公網(wǎng)安備 11010802033920號(hào) Copyright ? 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
主站蜘蛛池模板: 海丰县| 梁山县| 石渠县| 上林县| 高密市| 桐乡市| 喀什市| 阿拉善盟| 南平市| 高尔夫| 鱼台县| 海口市| 买车| 普兰店市| 宜章县| 息烽县| 崇信县| 依兰县| 柳江县| 邵阳县| 象州县| 水城县| 大渡口区| 陇西县| 伽师县| 宕昌县| 金川县| 蒙自县| 彝良县| 汉中市| 施甸县| 安龙县| 北流市| 绥宁县| 普兰店市| 新河县| 特克斯县| 丹凤县| 龙川县| 义乌市| 阿尔山市|