lv_conf.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /**
  2. * @file lv_conf.h
  3. *
  4. */
  5. #ifndef LV_CONF_H
  6. #define LV_CONF_H
  7. /*----------------
  8. * Dynamic memory
  9. *----------------*/
  10. /*
  11. * Memory size which will be used by the library
  12. * to store the graphical objects and other data
  13. */
  14. #define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
  15. #if LV_MEM_CUSTOM == 0
  16. #define LV_MEM_SIZE (32U * 1024U) /*Size memory used by mem_alloc (in bytes)*/
  17. #define LV_MEM_ATTR /*Complier prefix for big array declaration*/
  18. #define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
  19. #else /*LV_MEM_CUSTOM*/
  20. #define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
  21. #define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
  22. #define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
  23. #endif /*LV_MEM_CUSTOM*/
  24. /*===================
  25. Graphical settings
  26. *=====================*/
  27. /* Horizontal and vertical resolution of the library.*/
  28. #define LV_HOR_RES (240)
  29. #define LV_VER_RES (320)
  30. #define LV_DPI 50
  31. /* Size of VDB (Virtual Display Buffer: the internal graphics buffer).
  32. * Required for buffered drawing, opacity and anti-aliasing
  33. * VDB makes the double buffering, you don't need to deal with it!
  34. * Typical size: ~1/10 screen */
  35. // onion.io : TODO: try a VDB that is the size of the entire screen/half the screen
  36. #define LV_VDB_SIZE (150 * 1024) /*Size of VDB in pixel count (1/10 screen size is good for first)*/
  37. #define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
  38. /* Use two Virtual Display buffers (VDB) parallelize rendering and flushing (optional)
  39. * The flushing should use DMA to write the frame buffer in the background*/
  40. #define LV_VDB_DOUBLE 0 /*1: Enable the use of 2 VDBs*/
  41. #define LV_VDB2_ADR 0 /*kisvegabor@gmail.com: Set to 0 because `fbdev_flush` doesn't supports it*/ /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
  42. /* Enable anti-aliasing (lines, and radiuses will be smoothed) */
  43. #define LV_ANTIALIAS 1 /*kisvegabor@gmail.com: enabled because it's very fast sience v5.1 */ /*1: Enable anti-aliasing*/
  44. /*Screen refresh settings*/
  45. #define LV_REFR_PERIOD 50 /*Screen refresh period in milliseconds*/
  46. #define LV_INV_FIFO_SIZE 32 /*The average count of objects on a screen */
  47. /*=================
  48. Misc. setting
  49. *=================*/
  50. /*Input device settings*/
  51. #define LV_INDEV_READ_PERIOD 50 /*Input device read period in milliseconds*/
  52. #define LV_INDEV_POINT_MARKER 0 /*Mark the pressed points*/
  53. #define LV_INDEV_DRAG_LIMIT 10 /*Drag threshold in pixels */
  54. #define LV_INDEV_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
  55. #define LV_INDEV_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
  56. #define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
  57. /*Color settings*/
  58. #define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/24*/
  59. // #define LV_COLOR_TRANSP LV_COLOR_MAKE(0xFF,0x00,0xFF) /*Images pixels with this color will not be drawn (chroma keying)*/
  60. //#define LV_COLOR_TRANSP LV_COLOR_WHITE /*Images pixels with this color will not be drawn (chroma keying)*/
  61. #define LV_COLOR_TRANSP LV_COLOR_BLACK /*Images pixels with this color will not be drawn (chroma keying)*/
  62. /*Text settings*/
  63. #define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */
  64. #define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
  65. /*Graphics feature usage*/
  66. #define USE_LV_ANIMATION 1 /*1: Enable all animations*/
  67. #define USE_LV_SHADOW 0 /*1: Enable shadows*/
  68. #define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/
  69. #define USE_LV_GPU 0 /*1: Enable GPU interface*/
  70. #define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images*/
  71. /*Compiler attributes*/
  72. #define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to tick increment function */
  73. #define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to task handler function */
  74. #define LV_COMPILER_VLA_SUPPORTED 0
  75. /*================
  76. * THEME USAGE
  77. *================*/
  78. #define USE_LV_THEME_TEMPL 0 /*Just for test*/
  79. #define USE_LV_THEME_DEFAULT 0 /*Built mainly from the built-in styles. Consumes very few RAM*/
  80. #define USE_LV_THEME_ALIEN 0 /*Dark futuristic theme*/
  81. #define USE_LV_THEME_NIGHT 0 /*Dark elegant theme*/
  82. #define USE_LV_THEME_MONO 0 /*Mono color theme for monochrome displays*/
  83. #define USE_LV_THEME_MATERIAL 0 /*Flat theme with bold colors and light shadows*/
  84. #define USE_LV_THEME_ZEN 0 /*Peaceful, mainly light theme */
  85. /*==================
  86. * FONT USAGE
  87. *===================*/
  88. /* More info about fonts: https://littlevgl.com/basics#fonts
  89. * To enable a built-in font use 1,2,4 or 8 values
  90. * which will determine the bit-per-pixel */
  91. #define LV_FONT_DEFAULT &lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/
  92. #define USE_LV_FONT_DEJAVU_10 4
  93. #define USE_LV_FONT_DEJAVU_10_LATIN_SUP 4
  94. #define USE_LV_FONT_DEJAVU_10_CYRILLIC 0
  95. #define USE_LV_FONT_SYMBOL_10 4
  96. #define USE_LV_FONT_DEJAVU_20 4
  97. #define USE_LV_FONT_DEJAVU_20_LATIN_SUP 4
  98. #define USE_LV_FONT_DEJAVU_20_CYRILLIC 0
  99. #define USE_LV_FONT_SYMBOL_20 4
  100. #define USE_LV_FONT_DEJAVU_30 4
  101. #define USE_LV_FONT_DEJAVU_30_LATIN_SUP 4
  102. #define USE_LV_FONT_DEJAVU_30_CYRILLIC 0
  103. #define USE_LV_FONT_SYMBOL_30 4
  104. #define USE_LV_FONT_DEJAVU_40 4
  105. #define USE_LV_FONT_DEJAVU_40_LATIN_SUP 4
  106. #define USE_LV_FONT_DEJAVU_40_CYRILLIC 0
  107. #define USE_LV_FONT_SYMBOL_40 4
  108. /*===================
  109. * LV_OBJ SETTINGS
  110. *==================*/
  111. #define LV_OBJ_FREE_NUM_TYPE uint32_t /*Type of free number attribute (comment out disable free number)*/
  112. #define LV_OBJ_FREE_PTR 1 /*Enable the free pointer attribute*/
  113. /*==================
  114. * LV OBJ X USAGE
  115. *================*/
  116. /*
  117. * Documentation of the object types: https://littlevgl.com/object-types
  118. */
  119. /*****************
  120. * Simple object
  121. *****************/
  122. /*Label (dependencies: -*/
  123. #define USE_LV_LABEL 1
  124. #if USE_LV_LABEL != 0
  125. #define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
  126. #endif
  127. /*Image (dependencies: lv_label, lv_filesystem*/
  128. #define USE_LV_IMG 1
  129. /*Line (dependencies: -*/
  130. #define USE_LV_LINE 1
  131. /*******************
  132. * Container objects
  133. *******************/
  134. /*Container (dependencies: -*/
  135. #define USE_LV_CONT 1
  136. /*Page (dependencies: lv_cont)*/
  137. #define USE_LV_PAGE 1
  138. /*Window (dependencies: lv_btn, lv_label, lv_img, lv_page)*/
  139. #define USE_LV_WIN 0
  140. /*Tab view (dependencies: lv_page, lv_btnm)*/
  141. #define USE_LV_TABVIEW 0
  142. #if USE_LV_TABVIEW != 0
  143. #define LV_TABVIEW_ANIM_TIME 100 /*Time of slide animation [ms] (0: no animation)*/
  144. #endif
  145. /*************************
  146. * Data visualizer objects
  147. *************************/
  148. /*Bar (dependencies: -)*/
  149. #define USE_LV_BAR 1
  150. /*Line meter (dependencies: - )*/
  151. #define USE_LV_LMETER 0
  152. /*Gauge (dependencies:bar, lmeter)*/
  153. #define USE_LV_GAUGE 0
  154. /*Chart (dependencies: -)*/
  155. #define USE_LV_CHART 0
  156. /*LED (dependencies: -)*/
  157. #define USE_LV_LED 0
  158. /*Message box (dependencies: lv_cont, lv_btnm, lv_label)*/
  159. #define USE_LV_MBOX 1
  160. /*Text area (dependencies: lv_label, lv_page)*/
  161. #define USE_LV_TA 0
  162. #if USE_LV_TA != 0
  163. #define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
  164. #define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
  165. #endif
  166. #define USE_LV_CALENDAR 1
  167. /*************************
  168. * User input objects
  169. *************************/
  170. /*Button (dependencies: lv_cont*/
  171. #define USE_LV_BTN 1
  172. /*Button matrix (dependencies: -)*/
  173. #define USE_LV_BTNM 1
  174. /*Keyboard (dependencies: lv_btnm, lv_ta)*/
  175. #define USE_LV_KB 0
  176. /*Check box (dependencies: lv_btn, lv_label)*/
  177. #define USE_LV_CB 0
  178. /*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
  179. #define USE_LV_LIST 0
  180. #if USE_LV_LIST != 0
  181. #define LV_LIST_FOCUS_TIME 100 /*Default animation time of focusing to a list element [ms] (0: no animation) */
  182. #endif
  183. /*Drop down list (dependencies: lv_page, lv_label)*/
  184. #define USE_LV_DDLIST 0
  185. #if USE_LV_DDLIST != 0
  186. #define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
  187. #endif
  188. /*Roller (dependencies: lv_ddlist)*/
  189. #define USE_LV_ROLLER 0
  190. #if USE_LV_ROLLER != 0
  191. #define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
  192. #endif
  193. /*Slider (dependencies: lv_bar)*/
  194. #define USE_LV_SLIDER 0
  195. /*Switch (dependencies: lv_slider)*/
  196. #define USE_LV_SW 0
  197. #endif /*LV_CONF_H*/