stimer.h (491B)
1 #ifndef __STIMER_H__ 2 #define __STIMER_H__ 3 4 #include <stdbool.h> 5 #include <stdint.h> 6 7 typedef struct { 8 bool autoReset; 9 bool hasElapsed; 10 uint32_t waitTime; 11 uint32_t targetTime; 12 } Stimer_t; 13 14 void stimer_systick_init(void); 15 void stimer_start(Stimer_t *timer, const uint32_t waitTime, const bool autoReset); 16 bool stimer_ping(Stimer_t *timer); 17 void stimer_reset(Stimer_t *timer); 18 void stimer_delay(const uint32_t delay); 19 void stimer_reload(Stimer_t *timer); 20 #endif // __STIMER_H__