gg_external_data.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2024 NXP
  3. * NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
  4. * accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
  5. * activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
  6. * comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
  7. * terms, then you may not retain, install, activate or otherwise use the software.
  8. */
  9. #ifndef GG_EXTERNAL_DATA_H
  10. #define GG_EXTERNAL_DATA_H
  11. #include <stdint.h>
  12. #include "lvgl.h"
  13. typedef void (*gg_edata_task_cb_t)(void * param);
  14. typedef struct _gg_edata_task_t
  15. {
  16. uint64_t last_time;
  17. uint32_t period;
  18. gg_edata_task_cb_t cb;
  19. void * param;
  20. } gg_edata_task_t;
  21. enum gg_widget_type {
  22. GG_LABEL = 1,
  23. GG_CHART,
  24. GG_BAR,
  25. GG_METER,
  26. GG_ARC,
  27. GG_SLIDER,
  28. GG_SWITCH
  29. };
  30. /**
  31. * get time in us
  32. */
  33. uint64_t gg_get_us_time();
  34. /**
  35. * get time in ms
  36. */
  37. uint64_t gg_get_ms_time();
  38. /**
  39. * sleep in ns
  40. * @param ns number to sleep.
  41. */
  42. void gg_nanosleep(int ns);
  43. /**
  44. * init edata task link
  45. */
  46. void gg_edata_task_init(void);
  47. /**
  48. * clear edata task linked list, The list remain valid but become empty.
  49. */
  50. void gg_edata_task_clear(lv_obj_t * act_scr);
  51. /**
  52. * Create a new edata task
  53. * @param period call period in ms unit
  54. * @param cb a callback which will be called periodically.
  55. * @param param parameter for callback
  56. * @return pointer to the new task
  57. */
  58. gg_edata_task_t * gg_edata_task_create(uint32_t period, gg_edata_task_cb_t cb, void * param);
  59. /**
  60. * routine which will be executed in a new thread
  61. */
  62. void *gg_edata_task_exec();
  63. #endif