/*1* Copyright (c) 2018 CTCaer2*3* This program is free software; you can redistribute it and/or modify it4* under the terms and conditions of the GNU General Public License,5* version 2, as published by the Free Software Foundation.6*7* This program is distributed in the hope it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for10* more details.11*12* You should have received a copy of the GNU General Public License13* along with this program. If not, see <http://www.gnu.org/licenses/>.14*/1516#ifndef LV_CONF_H17#define LV_CONF_H1819#include <soc/timer.h>20#include <memory_map.h>21/*===================22Dynamic memory23*===================*/2425/* Memory size which will be used by the library26* to store the graphical objects and other data */27#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/28#if LV_MEM_CUSTOM == 029# define LV_MEM_SIZE NYX_LV_MEM_SZ /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/30# define LV_MEM_ATTR /*Complier prefix for big array declaration*/31# define LV_MEM_ADR NYX_LV_MEM_ADR /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/32# define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/33#else /*LV_MEM_CUSTOM*/34# define LV_MEM_CUSTOM_INCLUDE <mem/heap.h> /*Header for the dynamic memory function*/35# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/36# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/37#endif /*LV_MEM_CUSTOM*/3839/* Garbage Collector settings40* Used if lvgl is binded to higher language and the memory is managed by that language */41#define LV_ENABLE_GC 042#if LV_ENABLE_GC != 043# define LV_MEM_CUSTOM_REALLOC your_realloc /*Wrapper to realloc*/44# define LV_MEM_CUSTOM_GET_SIZE your_mem_get_size /*Wrapper to lv_mem_get_size*/45# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/46#endif /* LV_ENABLE_GC */4748/*===================49Graphical settings50*===================*/5152/* Horizontal and vertical resolution of the library.*/53#define LV_HOR_RES (1280)54#define LV_VER_RES (720)5556/* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide57* (Not so important, you can adjust it to modify default sizes and spaces)*/58#define LV_DPI 1005960/* Enable anti-aliasing (lines, and radiuses will be smoothed) */61#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/6263/*Screen refresh period in milliseconds*/64#define LV_REFR_PERIOD 336566/*-----------------67* VDB settings68*----------------*/6970/* VDB (Virtual Display Buffer) is an internal graphics buffer.71* The GUI will be drawn into this buffer first and then72* the buffer will be passed to your `disp_drv.disp_flush` function to73* copy it to your frame buffer.74* VDB is required for: buffered drawing, opacity, anti-aliasing and shadows75* Learn more: https://docs.littlevgl.com/#Drawing*/7677/* Size of the VDB in pixels. Typical size: ~1/10 screen. Must be >= LV_HOR_RES78* Setting it to 0 will disable VDB and `disp_drv.disp_fill` and `disp_drv.disp_map` functions79* will be called to draw to the frame buffer directly*/80#define LV_VDB_SIZE (LV_VER_RES * LV_HOR_RES)8182/* Bit-per-pixel of VDB. Useful for monochrome or non-standard color format displays.83* Special formats are handled with `disp_drv.vdb_wr`)*/84#define LV_VDB_PX_BPP LV_COLOR_SIZE /*LV_COLOR_SIZE comes from LV_COLOR_DEPTH below to set 8, 16 or 32 bit pixel size automatically */8586/* Place VDB to a specific address (e.g. in external RAM)87* 0: allocate automatically into RAM88* LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/89#define LV_VDB_ADR NYX_LV_VDB_ADR9091/* Use two Virtual Display buffers (VDB) to parallelize rendering and flushing92* The flushing should use DMA to write the frame buffer in the background */93#define LV_VDB_DOUBLE 09495/* Place VDB2 to a specific address (e.g. in external RAM)96* 0: allocate automatically into RAM97* LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/98#define LV_VDB2_ADR 099100/* Using true double buffering in `disp_drv.disp_flush` you will always get the image of the whole screen.101* Your only task is to set the rendered image (`color_p` parameter) as frame buffer address or send it to your display.102* The best if you do in the blank period of you display to avoid tearing effect.103* Requires:104* - LV_VDB_SIZE = LV_HOR_RES * LV_VER_RES105* - LV_VDB_DOUBLE = 1106*/107#define LV_VDB_TRUE_DOUBLE_BUFFERED 0108109/*=================110Misc. setting111*=================*/112113/*Input device settings*/114#define LV_INDEV_READ_PERIOD 33 /*Input device read period in milliseconds*/115#define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points (required: USE_LV_REAL_DRAW = 1)*/116#define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */117#define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */118#define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/119#define LV_INDEV_LONG_PRESS_REP_TIME 1000 //Fix keyb /*Repeated trigger period in long press [ms] */120121/*Color settings*/122#define LV_COLOR_DEPTH 32 /*Color depth: 1/8/16/32*/123#define LV_COLOR_16_SWAP 0 /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/124#define LV_COLOR_SCREEN_TRANSP 0 /*1: Enable screen transparency. Useful for OSD or other overlapping GUIs. Requires ARGB8888 colors*/125#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (with chroma keying)*/126127/*Text settings*/128#define LV_TXT_UTF8 0 /*Enable UTF-8 coded Unicode character usage */129#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/130#define LV_TXT_LINE_BREAK_LONG_LEN 12 /* If a character is at least this long, will break wherever "prettiest" */131#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /* Minimum number of characters of a word to put on a line before a break */132#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 1 /* Minimum number of characters of a word to put on a line after a break */133134/*Feature usage*/135#define USE_LV_ANIMATION 1 /*1: Enable all animations*/136#define USE_LV_SHADOW 1 /*1: Enable shadows*/137#define USE_LV_GROUP 0 /*1: Enable object groups (for keyboards)*/138#define USE_LV_GPU 0 /*1: Enable GPU interface*/139#define USE_LV_REAL_DRAW 0 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/140#define USE_LV_FILESYSTEM 0 /*1: Enable file system (might be required for images*/141#define USE_LV_MULTI_LANG 0 /* Number of languages for labels to store (0: to disable this feature)*/142143/*Compiler settings*/144#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to `lv_tick_inc` function */145#define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */146#define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/147148/*HAL settings*/149#define LV_TICK_CUSTOM 1 /*1: use a custom tick source (removing the need to manually update the tick with `lv_tick_inc`) */150#if LV_TICK_CUSTOM == 1151#define LV_TICK_CUSTOM_INCLUDE <soc/timer.h> /*Header for the sys time function*/152#define LV_TICK_CUSTOM_SYS_TIME_EXPR ((u32)get_tmr_ms()) /*Expression evaluating to current systime in ms*/153#endif /*LV_TICK_CUSTOM*/154155156/*Log settings*/157#ifdef DEBUG_UART_LV_LOG158# define USE_LV_LOG 1 /*Enable/disable the log module*/159#else160# define USE_LV_LOG 0 /*Enable/disable the log module*/161#endif162#if USE_LV_LOG163/* How important log should be added:164* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information165* LV_LOG_LEVEL_INFO Log important events166* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't caused problem167* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail168*/169# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN170/* 1: Print the log with 'printf'; 0: user need to register a callback*/171# define LV_LOG_PRINTF 1172#endif /*USE_LV_LOG*/173174/*================175* THEME USAGE176*================*/177#define LV_THEME_LIVE_UPDATE 0 /*1: Allow theme switching at run time. Uses 8..10 kB of RAM*/178179#define USE_LV_THEME_HEKATE 1 /*Flat theme with bold colors and light shadows*/180181/*==================182* FONT USAGE183*===================*/184185/* More info about fonts: https://docs.littlevgl.com/#Fonts186* To enable a built-in font use 1,2,4 or 8 values187* which will determine the bit-per-pixel. Higher value means smoother fonts */188#define LV_FONT_QUALITY 8189190#define USE_UBUNTU_MONO LV_FONT_QUALITY191192#define USE_INTERUI_20 LV_FONT_QUALITY193#define USE_INTERUI_30 LV_FONT_QUALITY194195#define USE_HEKATE_SYMBOL_20 USE_INTERUI_20196#define USE_HEKATE_SYMBOL_30 USE_INTERUI_30197#define USE_HEKATE_SYMBOL_120 LV_FONT_QUALITY198199/* Optionally declare your custom fonts here.200* You can use these fonts as default font too201* and they will be available globally. E.g.202* #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \203* LV_FONT_DECLARE(my_font_2) \204*/205#define LV_FONT_CUSTOM_DECLARE206207#define LV_FONT_DEFAULT &interui_30 /*Always set a default font from the built-in fonts*/208209/*===================210* LV_OBJ SETTINGS211*==================*/212#define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/213#define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/214#define LV_OBJ_REALIGN 1 // 0 in OG gui /*Enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/215216/*==================217* LV OBJ X USAGE218*================*/219/*220* Documentation of the object types: https://docs.littlevgl.com/#Object-types221*/222223/*****************224* Simple object225*****************/226227/*Label (dependencies: -*/228#define USE_LV_LABEL 1229#if USE_LV_LABEL != 0230# define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/231#endif232233/*Image (dependencies: lv_label*/234#define USE_LV_IMG 1235#if USE_LV_IMG != 0236# define LV_IMG_CF_INDEXED 0 /*Enable indexed (palette) images*/237# define LV_IMG_CF_ALPHA 0 /*Enable alpha indexed images*/238#endif239240/*Line (dependencies: -*/241#define USE_LV_LINE 1242243/*Arc (dependencies: -)*/244#define USE_LV_ARC 0245246/*******************247* Container objects248*******************/249250/*Container (dependencies: -*/251#define USE_LV_CONT 1252253/*Page (dependencies: lv_cont)*/254#define USE_LV_PAGE 1255256/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/257#define USE_LV_WIN 1258259/*Tab (dependencies: lv_page, lv_btnm)*/260#define USE_LV_TABVIEW 1261# if USE_LV_TABVIEW != 0262# define LV_TABVIEW_ANIM_TIME 0 /*Time of slide animation [ms] (0: no animation)*/263#endif264265/*Tileview (dependencies: lv_page) */266#define USE_LV_TILEVIEW 0267#if USE_LV_TILEVIEW268# define LV_TILEVIEW_ANIM_TIME 0 /*Time of slide animation [ms] (0: no animation)*/269#endif270271/*************************272* Data visualizer objects273*************************/274275/*Bar (dependencies: -)*/276#define USE_LV_BAR 1277278/*Line meter (dependencies: *;)*/279#define USE_LV_LMETER 0280281/*Gauge (dependencies:lv_bar, lv_lmeter)*/282#define USE_LV_GAUGE 0283284/*Chart (dependencies: -)*/285#define USE_LV_CHART 0286287/*Table (dependencies: lv_label)*/288#define USE_LV_TABLE 1289#if USE_LV_TABLE290# define LV_TABLE_COL_MAX 12291#endif292293/*LED (dependencies: -)*/294#define USE_LV_LED 0295296/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/297#define USE_LV_MBOX 1298#if USE_LV_MBOX != 0299# define LV_MBOX_CLOSE_ANIM_TIME 200 /*ms*/300#endif301302/*Text area (dependencies: lv_label, lv_page)*/303#define USE_LV_TA 1304#if USE_LV_TA != 0305# define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/306# define LV_TA_PWD_SHOW_TIME 1500 /*ms*/307#endif308309/*Spinbox (dependencies: lv_ta)*/310#define USE_LV_SPINBOX 0311312/*Calendar (dependencies: -)*/313#define USE_LV_CALENDAR 0314315/*Preload (dependencies: lv_arc)*/316#define USE_LV_PRELOAD 0317#if USE_LV_PRELOAD != 0318# define LV_PRELOAD_DEF_ARC_LENGTH 60 /*[deg]*/319# define LV_PRELOAD_DEF_SPIN_TIME 1000 /*[ms]*/320# define LV_PRELOAD_DEF_ANIM LV_PRELOAD_TYPE_SPINNING_ARC321#endif322323/*Canvas (dependencies: lv_img)*/324#define USE_LV_CANVAS 0325/*************************326* User input objects327*************************/328329/*Button (dependencies: lv_cont*/330#define USE_LV_BTN 1331#if USE_LV_BTN != 0332# define LV_BTN_INK_EFFECT 0 /*Enable button-state animations - draw a circle on click (dependencies: USE_LV_ANIMATION)*/333#endif334335/*Image Button (dependencies: lv_btn*/336#define USE_LV_IMGBTN 1337#if USE_LV_IMGBTN338# define LV_IMGBTN_TILED 0 /*1: The imgbtn requires left, mid and right parts and the width can be set freely*/339#endif340341/*Button matrix (dependencies: -)*/342#define USE_LV_BTNM 1343344/*Keyboard (dependencies: lv_btnm)*/345#define USE_LV_KB 0346347/*Check box (dependencies: lv_btn, lv_label)*/348#define USE_LV_CB 1349350/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/351#define USE_LV_LIST 1352#if USE_LV_LIST != 0353# define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */354#endif355356/*Drop down list (dependencies: lv_page, lv_label, lv_symbol_def.h)*/357#define USE_LV_DDLIST 1358#if USE_LV_DDLIST != 0359# define LV_DDLIST_ANIM_TIME 100 /*Open and close default animation time [ms] (0: no animation)*/360#endif361362/*Roller (dependencies: lv_ddlist)*/363#define USE_LV_ROLLER 1364#if USE_LV_ROLLER != 0365# define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/366#endif367368/*Slider (dependencies: lv_bar)*/369#define USE_LV_SLIDER 1370371/*Switch (dependencies: lv_slider)*/372#define USE_LV_SW 1373374#endif /*LV_CONF_H*/375376377378