unleashed-firmware/firmware/targets/furi_hal_include/furi_hal_delay.h
Georgii Surkov df66f4f6ba
[FL-2480] Use SysTick as the main OS timer (#1140)
* Use SysTick as OS tick timer
* Use LPTIM2 as tickless idle timer
* Remove dummy LPTIM2 IRQ handler
* Clean up clock init code
* Rename os timer to idle timer
* Advance hal ticks along with FreeRTOS's
* Improve SysTick control during tickless idle
* Improve idle timer precision
* Correct SysTick IRQ priority
* Main, FuriHal: move system startup to separate thread
* Minor code cleanup

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-04-21 16:15:19 +03:00

51 lines
958 B
C

/**
* @file furi_hal_delay.h
* Delay HAL API
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Init Delay subsystem */
void furi_hal_delay_init();
/** Get instructions per microsecond count */
uint32_t furi_hal_delay_instructions_per_microsecond();
/** Get current tick counter
*
* System uptime, may overflow.
*
* @return Current ticks in milliseconds
*/
uint32_t furi_hal_get_tick(void);
/** Convert milliseconds to ticks
*
* @param[in] milliseconds time in milliseconds
* @return time in ticks
*/
uint32_t furi_hal_ms_to_ticks(float milliseconds);
/** Delay in milliseconds
* @warning Cannot be used from ISR
*
* @param[in] milliseconds milliseconds to wait
*/
void furi_hal_delay_ms(float milliseconds);
/** Delay in microseconds
*
* @param[in] microseconds microseconds to wait
*/
void furi_hal_delay_us(float microseconds);
#ifdef __cplusplus
}
#endif