steering-wheel/Core/Inc/shorttimer.h

29 lines
481 B
C
Raw Normal View History

2023-03-17 17:50:00 +01:00
#ifndef INC_SHORTTIMER_H
#define INC_SHORTTIMER_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* Timer with an arbitrary period.
*
* shorttimer_callback() must be called in HAL_TIM_PeriodElapsedCallback.
*/
#include "stm32h7xx_hal.h"
#include <stdint.h>
void shorttimer_init(TIM_HandleTypeDef *handle);
uint32_t shorttimer_gettick(void);
void shorttimer_sleep(uint32_t microseconds);
void shorttimer_callback(void);
#ifdef __cplusplus
}
#endif
#endif // INC_SHORTTIMER_H