furi_hal_delay.h 664 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * @file furi_hal_delay.h
  3. * Delay HAL API
  4. */
  5. #pragma once
  6. #include "main.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. extern uint32_t instructions_per_us;
  11. /** Init DWT
  12. */
  13. void furi_hal_delay_init(void);
  14. /** Delay in milliseconds
  15. * @warning Cannot be used from ISR
  16. *
  17. * @param[in] milliseconds milliseconds to wait
  18. */
  19. void delay(float milliseconds);
  20. /** Delay in microseconds
  21. *
  22. * @param[in] microseconds microseconds to wait
  23. */
  24. void delay_us(float microseconds);
  25. /** Get current millisecond
  26. *
  27. * System uptime, pProvided by HAL, may overflow.
  28. *
  29. * @return Current milliseconds
  30. */
  31. uint32_t millis(void);
  32. #ifdef __cplusplus
  33. }
  34. #endif