furi_hal_delay.h 878 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /** Delay in milliseconds
  27. * @warning Cannot be used from ISR
  28. *
  29. * @param[in] milliseconds milliseconds to wait
  30. */
  31. void furi_hal_delay_ms(float milliseconds);
  32. /** Delay in microseconds
  33. *
  34. * @param[in] microseconds microseconds to wait
  35. */
  36. void furi_hal_delay_us(float microseconds);
  37. #ifdef __cplusplus
  38. }
  39. #endif