luat_easylvgl_conf.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * @file luat_easylvgl_conf.h
  3. * @summary EasyLVGL 平台相关配置
  4. * @description 根据不同的平台(SDL2、BK7258等)配置 LVGL 参数
  5. *
  6. * 注意:此文件会被 lv_conf.h 包含,用于覆盖默认配置
  7. */
  8. #ifndef LUAT_EASYLVGL_CONF_H
  9. #define LUAT_EASYLVGL_CONF_H
  10. #include "luat_conf_bsp.h"
  11. /*=================
  12. * PLATFORM CONFIGURATION
  13. *=================*/
  14. #if defined(LUAT_USE_EASYLVGL_SDL2)
  15. /* SDL2 平台配置 */
  16. #define LV_USE_OS LV_OS_NONE /* SDL2 平台可能不需要 OSAL */
  17. #define LV_USE_LOG 1
  18. #define LV_LOG_LEVEL LV_LOG_LEVEL_INFO
  19. // 打开png支持
  20. #define LV_USE_LODEPNG 1
  21. #define LV_MEM_SIZE (256 * 1024U)
  22. #define LV_USE_TJPGD 1
  23. // 默认字体设置
  24. #define LV_FONT_FMT_TXT_LARGE 1
  25. #define LV_USE_FONT_COMPRESSED 1
  26. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_misans_20) LV_FONT_DECLARE(lv_font_misans_14)
  27. // #define LV_FONT_DEFAULT &lv_font_misans_20
  28. #define LV_FONT_DEFAULT &lv_font_misans_14
  29. #elif defined(__BK72XX__)
  30. /* BK7258 平台配置:使用 FreeRTOS 以支持 LVGL 多线程渲染 */
  31. #define LV_USE_OS LV_OS_FREERTOS
  32. // #define LV_DRAW_SW_DRAW_UNIT_CNT 1 // 开启2个软件渲染单元以并行绘制
  33. // #define LV_USE_PARALLEL_DRAW_DEBUG 0 // 开启并行绘制调试
  34. #define LV_USE_LOG 1
  35. /** Set value to one of the following levels of logging detail:
  36. * - LV_LOG_LEVEL_TRACE Log detailed information.
  37. * - LV_LOG_LEVEL_INFO Log important events.
  38. * - LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem.
  39. * - LV_LOG_LEVEL_ERROR Log only critical issues, when system may fail.
  40. * - LV_LOG_LEVEL_USER Log only custom log messages added by the user.
  41. * - LV_LOG_LEVEL_NONE Do not log anything. */
  42. #define LV_LOG_LEVEL LV_LOG_LEVEL_INFO
  43. // 图片解码支持
  44. #define LV_USE_LODEPNG 1
  45. #define LV_MEM_SIZE (128 * 1024U)
  46. #define LV_USE_TJPGD 1
  47. #else
  48. /* 默认配置(如果未定义平台) */
  49. /* 使用 lv_conf.h 中的默认值,这里不需要重新定义 */
  50. #endif
  51. #endif /* LUAT_EASYLVGL_CONF_H */