lvgl_demo.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*=================================================================
  2. EDIT HISTORY FOR MODULE
  3. This section contains comments describing changes made to the module.
  4. Notice that changes are listed in reverse chronological order.
  5. WHEN WHO WHAT, WHERE, WHY
  6. ------------ ------- -------------------------------------------------------------------------------
  7. =================================================================*/
  8. #ifndef _LVGL_DEMO_H
  9. #define _LVGL_DEMO_H
  10. #include "ql_api_osi.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /*===========================================================================
  15. * Enumeration Definition
  16. ===========================================================================*/
  17. /*===========================================================================
  18. * Struct
  19. ===========================================================================*/
  20. /*===========================================================================
  21. * Functions declaration
  22. ===========================================================================*/
  23. void ql_lvgl_app_init(void);
  24. /**
  25. * \brief forward declaration
  26. */
  27. struct _lv_indev_t;
  28. /**
  29. * \brief function prototype for gui creation
  30. */
  31. typedef void (*lvGuiCreate_t)(void);
  32. /**
  33. * \brief start gui based on littlevgl
  34. *
  35. * It will create gui thread, initialize littlevgl, and optional call gui
  36. * creation function \p create.
  37. *
  38. * LCD should be initialized before this, back light should be enabled. And
  39. * usually quick logo has been shown. Gui thread will blit to LCD directly.
  40. *
  41. * \param create gui creation function
  42. */
  43. void lvGuiInit(lvGuiCreate_t create);
  44. /**
  45. * \brief terminate littlevgl gui
  46. *
  47. * Most likely, it won't be called.
  48. */
  49. void lvGuiDeinit(void);
  50. /**
  51. * \brief get keypad input device
  52. * \return
  53. * - keypad device
  54. */
  55. struct _lv_indev_t *lvGuiGetKeyPad(void);
  56. ///**
  57. // * \brief schedule a callback to be executed in gui thread
  58. // *
  59. // * \param cb callback function
  60. // * \param param callback parameter
  61. // */
  62. //void lvGuiThreadCallback(osiCallback_t cb, void *param);
  63. /**
  64. * \brief send event to gui thread
  65. */
  66. void lvGuiSendEvent(ql_event_t *evt);
  67. /**
  68. * \brief request screen on
  69. *
  70. * It is for an application to request the screen on even there are no
  71. * user inputs.
  72. *
  73. * \p id is the identification of application. In the system, it should
  74. * be unique. Internally, 32bits bitmap is used to record this. So, it
  75. * should be inside [0,31].
  76. *
  77. * The request is not counting. That is, for a given application id,
  78. * event there are multiple calls, single call of \p lvGuiReleaseScreenOn
  79. * will clear the request.
  80. *
  81. * \param id application id
  82. * \return
  83. * - true on success
  84. * - false on invalid parameter
  85. */
  86. bool lvGuiRequestSceenOn(uint8_t id);
  87. /**
  88. * \brief release screen on request
  89. *
  90. * \param id application id
  91. * \return
  92. * - true on success
  93. * - false on invalid parameter
  94. */
  95. bool lvGuiReleaseScreenOn(uint8_t id);
  96. /**
  97. * \brief turn on screen
  98. *
  99. * When screen is already turned on, it will do nothing.
  100. */
  101. void lvGuiScreenOn(void);
  102. /**
  103. * \brief turn off screen
  104. *
  105. * When screen is already turned off, it will do nothing.
  106. */
  107. void lvGuiScreenOff(void);
  108. /**
  109. * \brief set screen off timeout at inactive
  110. *
  111. * It can change the default value. When \p timeout is 0, screen won't be
  112. * turned off by inactive timeout.
  113. *
  114. * \param timeout inactive screen off timeout, 0 for never timeout
  115. */
  116. void lvGuiSetInactiveTimeout(unsigned timeout);
  117. /**
  118. * \brief set whether animation is regarded as inactive
  119. *
  120. * When \p inactive is true, animation update won't be regarded as *active*.
  121. * The inactive screen off timer will still count down even there are
  122. * animations. Otherwise, inactive screen off timer will stop counting when
  123. * there are animation.
  124. *
  125. * \param inactive animation will be regarded as inactive
  126. */
  127. void lvGuiSetAnimationInactive(bool inactive);
  128. #ifdef __cplusplus
  129. } /*"C" */
  130. #endif
  131. #endif /* _LCDDEMO_H */