furi_hal_delay.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * @file furi_hal_delay.h
  3. * Delay HAL API
  4. */
  5. #pragma once
  6. #include <stdint.h>
  7. #include <stdbool.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /** Init Delay subsystem */
  12. void furi_hal_delay_init();
  13. /** Get instructions per microsecond count */
  14. uint32_t furi_hal_delay_instructions_per_microsecond();
  15. /** Increase tick counter.
  16. * Should be called from SysTick ISR
  17. */
  18. void furi_hal_tick(void);
  19. /** Get current tick counter
  20. *
  21. * System uptime, may overflow.
  22. *
  23. * @return Current ticks in milliseconds
  24. */
  25. uint32_t furi_hal_get_tick(void);
  26. /** Convert milliseconds to ticks
  27. *
  28. * @param[in] milliseconds time in milliseconds
  29. * @return time in ticks
  30. */
  31. uint32_t furi_hal_ms_to_ticks(float milliseconds);
  32. /** Delay in milliseconds
  33. * @warning Cannot be used from ISR
  34. *
  35. * @param[in] milliseconds milliseconds to wait
  36. */
  37. void furi_hal_delay_ms(float milliseconds);
  38. /** Delay in microseconds
  39. *
  40. * @param[in] microseconds microseconds to wait
  41. */
  42. void furi_hal_delay_us(float microseconds);
  43. #ifdef __cplusplus
  44. }
  45. #endif