lv_hal_tick.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * @file lv_hal_tick.h
  3. * Provide access to the system tick with 1 millisecond resolution
  4. */
  5. #ifndef LV_HAL_TICK_H
  6. #define LV_HAL_TICK_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /*********************
  11. * INCLUDES
  12. *********************/
  13. #include <stdint.h>
  14. #include <stdbool.h>
  15. /*********************
  16. * DEFINES
  17. *********************/
  18. #ifndef LV_ATTRIBUTE_TICK_INC
  19. #define LV_ATTRIBUTE_TICK_INC
  20. #endif
  21. /**********************
  22. * TYPEDEFS
  23. **********************/
  24. /**********************
  25. * GLOBAL PROTOTYPES
  26. **********************/
  27. /**
  28. * You have to call this function periodically
  29. * @param tick_period the call period of this function in milliseconds
  30. */
  31. LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period);
  32. /**
  33. * Get the elapsed milliseconds since start up
  34. * @return the elapsed milliseconds
  35. */
  36. uint32_t lv_tick_get(void);
  37. /**
  38. * Get the elapsed milliseconds science a previous time stamp
  39. * @param prev_tick a previous time stamp (return value of systick_get() )
  40. * @return the elapsed milliseconds since 'prev_tick'
  41. */
  42. uint32_t lv_tick_elaps(uint32_t prev_tick);
  43. /**********************
  44. * MACROS
  45. **********************/
  46. #ifdef __cplusplus
  47. } /* extern "C" */
  48. #endif
  49. #endif /*LV_HAL_TICK_H*/