luat_conf_bsp.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /*
  2. * Copyright (c) 2022 OpenLuat & AirM2M
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. * this software and associated documentation files (the "Software"), to deal in
  6. * the Software without restriction, including without limitation the rights to
  7. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  8. * the Software, and to permit persons to whom the Software is furnished to do so,
  9. * subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in all
  12. * copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  16. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  17. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  18. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. */
  21. #ifndef LUAT_CONF_BSP
  22. #define LUAT_CONF_BSP
  23. #define LUAT_BSP_VERSION "V1020"
  24. //------------------------------------------------------
  25. // 以下custom --> 到 <-- custom 之间的内容,是供用户配置的
  26. // 同时也是云编译可配置的部分. 提交代码时切勿删除会修改标识
  27. //custom -->
  28. //------------------------------------------------------
  29. #define LUAT_USE_UART 1
  30. #define LUAT_USE_GPIO 1
  31. #define LUAT_USE_I2C 1
  32. #define LUAT_USE_SPI 1
  33. #define LUAT_USE_ADC 1
  34. #define LUAT_USE_PWM 1
  35. #define LUAT_USE_WDT 1
  36. #define LUAT_USE_PM 1
  37. #define LUAT_USE_MCU 1
  38. // #define LUAT_USE_HWTIMER 1
  39. #define LUAT_USE_RTC 1
  40. #define LUAT_USE_KEYBOARD 1
  41. #define LUAT_USE_DAC 1
  42. #define LUAT_USE_OTP 1
  43. #define LUAT_USE_SOFT_UART 1
  44. #define LUAT_USE_CRYPTO 1
  45. #define LUAT_USE_CJSON 1
  46. #define LUAT_USE_ZBUFF 1
  47. #define LUAT_USE_PACK 1
  48. #define LUAT_USE_LIBGNSS 1
  49. #define LUAT_USE_FS 1
  50. #define LUAT_USE_SENSOR 1
  51. #define LUAT_USE_SFUD 1
  52. #define LUAT_USE_SFD 1
  53. // #define LUAT_USE_STATEM 1
  54. // #define LUAT_USE_COREMARK 1
  55. // 启用64位虚拟机
  56. // #define LUAT_CONF_VM_64bit
  57. // #define LUAT_USE_YMODEM
  58. // FDB 提供kv数据库, 与nvm库类似
  59. // #define LUAT_USE_FDB 1
  60. // fskv提供与fdb库兼容的API,旨在替换fdb库
  61. #define LUAT_USE_FSKV 1
  62. //#define LUAT_USE_ZLIB
  63. #define LUAT_USE_CAMERA 1
  64. #define LUAT_USE_I2CTOOLS 1
  65. #define LUAT_USE_SOFTKB 1
  66. #define LUAT_USE_PROTOBUF
  67. #define LUAT_USE_FATFS 1
  68. #define LUAT_USE_FATFS_CHINESE
  69. // #define LUAT_FF_USE_LFN 3
  70. // #define LUAT_FF_LFN_UNICODE 3
  71. #define LUAT_USE_USB 1
  72. #define LUAT_USE_MEDIA 1
  73. #define LUAT_USE_IO_QUEUE 1
  74. #define LUAT_USE_W5500 1
  75. #define LUAT_USE_DHCP 1
  76. #define LUAT_USE_DNS 1
  77. #define LUAT_USE_NETWORK 1
  78. #define LUAT_USE_TLS 1
  79. #define LUAT_USE_SNTP 1
  80. #define LUAT_USE_FTP 1
  81. #define LUAT_USE_IOTAUTH 1
  82. #define LUAT_USE_LORA 1
  83. // #define LUAT_USE_LORA2 1
  84. // #define LUAT_USE_MAX30102
  85. // #define LUAT_USE_MLX90640 1
  86. #define LUAT_USE_MINIZ 1
  87. #define LUAT_USE_BIT64 1
  88. // #define LUAT_USE_MQTTCORE 1
  89. // #define LUAT_USE_LIBCOAP 1
  90. //----------------------------
  91. // 高通字体, 需配合芯片使用
  92. #define LUAT_USE_GTFONT 1
  93. #define LUAT_USE_GTFONT_UTF8 1
  94. //----------------------------
  95. // 高级功能, 其中repl推荐开启, shell已废弃
  96. // #define LUAT_USE_SHELL 1
  97. // #define LUAT_USE_DBG 1
  98. #define LUAT_USE_OTA 1
  99. #define LUAT_USE_FOTA 1
  100. #define LUAT_USE_REPL 1
  101. // 多虚拟机支持,实验性,一般不启用
  102. // #define LUAT_USE_VMX 1
  103. // #define LUAT_USE_NES
  104. // RSA 加解密,加签验签
  105. #define LUAT_USE_RSA 1
  106. // 国密算法 SM2/SM3/SM4
  107. #define LUAT_USE_GMSSL 1
  108. // #define LUAT_USE_ICONV 1
  109. //---------------------
  110. // UI
  111. #define LUAT_USE_LCD 1
  112. #define LUAT_LCD_CMD_DELAY_US 7
  113. #define LUAT_USE_TJPGD 1
  114. #define LUAT_USE_EINK 1
  115. //---------------------
  116. // U8G2
  117. #define LUAT_USE_DISP 1
  118. #define LUAT_USE_U8G2 1
  119. /**************FONT*****************/
  120. #define LUAT_USE_FONTS 1
  121. /**********U8G2&LCD&EINK FONT*************/
  122. #define USE_U8G2_OPPOSANSM_ENGLISH 1
  123. #define USE_U8G2_OPPOSANSM12_CHINESE
  124. //#define USE_U8G2_OPPOSANSM16_CHINESE
  125. // #define USE_U8G2_OPPOSANSM24_CHINESE
  126. // #define USE_U8G2_OPPOSANSM32_CHINESE
  127. // SARASA
  128. // #define USE_U8G2_SARASA_M8_CHINESE
  129. // #define USE_U8G2_SARASA_M10_CHINESE
  130. // #define USE_U8G2_SARASA_M12_CHINESE
  131. // #define USE_U8G2_SARASA_M14_CHINESE
  132. // #define USE_U8G2_SARASA_M16_CHINESE
  133. // #define USE_U8G2_SARASA_M18_CHINESE
  134. // #define USE_U8G2_SARASA_M20_CHINESE
  135. // #define USE_U8G2_SARASA_M22_CHINESE
  136. // #define USE_U8G2_SARASA_M24_CHINESE
  137. // #define USE_U8G2_SARASA_M26_CHINESE
  138. // #define USE_U8G2_SARASA_M28_CHINESE
  139. /**********LVGL FONT*************/
  140. //#define LV_FONT_OPPOSANS_M_12
  141. #define LV_FONT_OPPOSANS_M_16
  142. //---------------------
  143. // LVGL
  144. #define LUAT_USE_LVGL
  145. // #define LV_USE_LOG 1
  146. #define LUAT_USE_LVGL_ARC //圆弧 无依赖
  147. #define LUAT_USE_LVGL_BAR //进度条 无依赖
  148. #define LUAT_USE_LVGL_BTN //按钮 依赖容器CONT
  149. #define LUAT_USE_LVGL_BTNMATRIX //按钮矩阵 无依赖
  150. #define LUAT_USE_LVGL_CALENDAR //日历 无依赖
  151. #define LUAT_USE_LVGL_CANVAS //画布 依赖图片IMG
  152. #define LUAT_USE_LVGL_CHECKBOX //复选框 依赖按钮BTN 标签LABEL
  153. #define LUAT_USE_LVGL_CHART //图表 无依赖
  154. #define LUAT_USE_LVGL_CONT //容器 无依赖
  155. #define LUAT_USE_LVGL_CPICKER //颜色选择器 无依赖
  156. #define LUAT_USE_LVGL_DROPDOWN //下拉列表 依赖页面PAGE 标签LABEL
  157. #define LUAT_USE_LVGL_GAUGE //仪表 依赖进度条BAR 仪表(弧形刻度)LINEMETER
  158. #define LUAT_USE_LVGL_IMG //图片 依赖标签LABEL
  159. #define LUAT_USE_LVGL_IMGBTN //图片按钮 依赖按钮BTN
  160. #define LUAT_USE_LVGL_KEYBOARD //键盘 依赖图片按钮IMGBTN
  161. #define LUAT_USE_LVGL_LABEL //标签 无依赖
  162. #define LUAT_USE_LVGL_LED //LED 无依赖
  163. #define LUAT_USE_LVGL_LINE //线 无依赖
  164. #define LUAT_USE_LVGL_LIST //列表 依赖页面PAGE 按钮BTN 标签LABEL
  165. #define LUAT_USE_LVGL_LINEMETER //仪表(弧形刻度) 无依赖
  166. #define LUAT_USE_LVGL_OBJMASK //对象蒙版 无依赖
  167. #define LUAT_USE_LVGL_MSGBOX //消息框 依赖图片按钮IMGBTN 标签LABEL
  168. #define LUAT_USE_LVGL_PAGE //页面 依赖容器CONT
  169. #define LUAT_USE_LVGL_SPINNER //旋转器 依赖圆弧ARC 动画ANIM
  170. #define LUAT_USE_LVGL_ROLLER //滚筒 无依赖
  171. #define LUAT_USE_LVGL_SLIDER //滑杆 依赖进度条BAR
  172. #define LUAT_USE_LVGL_SPINBOX //数字调整框 无依赖
  173. #define LUAT_USE_LVGL_SWITCH //开关 依赖滑杆SLIDER
  174. #define LUAT_USE_LVGL_TEXTAREA //文本框 依赖标签LABEL 页面PAGE
  175. #define LUAT_USE_LVGL_TABLE //表格 依赖标签LABEL
  176. #define LUAT_USE_LVGL_TABVIEW //页签 依赖页面PAGE 图片按钮IMGBTN
  177. #define LUAT_USE_LVGL_TILEVIEW //平铺视图 依赖页面PAGE
  178. #define LUAT_USE_LVGL_WIN //窗口 依赖容器CONT 按钮BTN 标签LABEL 图片IMG 页面PAGE
  179. #define LUAT_SCRIPT_SIZE 512 //脚本区大小,必须为64KB的倍数
  180. #define LUAT_FS_SIZE 512 //文件系统大小,必须为64KB的倍数
  181. //-------------------------------------------------------------------------------
  182. //<-- custom
  183. //------------------------------------------------------------------------------
  184. // 以下选项仅开发人员可修改, 一般用户切勿自行修改
  185. #ifdef LUAT_HEAP_SIZE_256K
  186. #define LUAT_HEAP_SIZE (256)
  187. #endif
  188. #ifdef LUAT_HEAP_SIZE_300K
  189. #undef LUAT_HEAP_SIZE
  190. #define LUAT_HEAP_SIZE (300)
  191. #endif
  192. #ifdef LUAT_HEAP_SIZE_400K
  193. #undef LUAT_HEAP_SIZE
  194. #define LUAT_HEAP_SIZE (400)
  195. #endif
  196. #ifndef LUAT_HEAP_SIZE
  197. #define LUAT_HEAP_SIZE (200)
  198. #endif
  199. #define FLASH_FS_REGION_SIZE (LUAT_FS_SIZE + LUAT_SCRIPT_SIZE)
  200. #define LUAT_GPIO_NUMS 32
  201. #define LUAT__UART_TX_NEED_WAIT_DONE
  202. //----------------------------------
  203. // 使用VFS(虚拟文件系统)和内置库文件, 必须启用
  204. #define LUAT_USE_FS_VFS 1
  205. #define LUAT_USE_VFS_INLINE_LIB 1
  206. //----------------------------------
  207. #define LV_DISP_DEF_REFR_PERIOD gLVFlashTime
  208. extern unsigned int gLVFlashTime;
  209. #define LUAT_LV_DEBUG 0
  210. #define LV_MEM_CUSTOM 1
  211. #define LUAT_USE_LVGL_INDEV 1
  212. #define LV_HOR_RES_MAX (240)
  213. #define LV_VER_RES_MAX (240)
  214. #define LV_COLOR_DEPTH 16
  215. #define LV_COLOR_16_SWAP 1
  216. #define __LVGL_SLEEP_ENABLE__
  217. #define LV_TICK_CUSTOM 1
  218. #define LV_TICK_CUSTOM_INCLUDE "app_interface.h" /*Header for the system time function*/
  219. #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((uint32_t)GetSysTickMS()) /*Expression evaluating to current system time in ms*/
  220. #define LUAT_USE_LCD_CUSTOM_DRAW
  221. #define time(X) luat_time(X)
  222. #define LV_USE_PERF_MONITOR 1
  223. #define __LUATOS_TICK_64BIT__
  224. #define LUAT_USE_MEMORY_OPTIMIZATION_CODE_MMAP
  225. #ifndef __LV_DEBUG__
  226. #undef LV_USE_PERF_MONITOR
  227. #endif
  228. #define LUAT_RT_RET_TYPE int
  229. #define LUAT_RT_RET 0
  230. #define LUAT_RT_CB_PARAM void *pdata, void *param
  231. #define __LUAT_C_CODE_IN_RAM__ __attribute__((section (".RamFunc")))
  232. // 单纯为了生成文档的宏
  233. #define LUAT_USE_PIN 1
  234. #ifdef LUAT_USE_SHELL
  235. #undef LUAT_USE_REPL
  236. #endif
  237. #endif