sitara_depot/components/free_rtos/timer_sw/timer_sw.hpp

32 lines
469 B
C++
Raw Normal View History

/*
* timer_sw.hpp
*
* Created on: 13 <EFBFBD><EFBFBD><EFBFBD>. 2023 <EFBFBD>.
* Author: sychev
*/
#ifndef FREE_RTOS_TIMER_SW_TIMER_SW_HPP_
#define FREE_RTOS_TIMER_SW_TIMER_SW_HPP_
#include <cstdint>
class TimerSw {
public:
void start(uint32_t period);
void stop();
bool tick(uint32_t ticks);
bool is_started() { return enable_; }
private:
bool enable_ = false;
uint32_t cnt_ = 0;
uint32_t prd_ = 0;
};
#endif /* FREE_RTOS_TIMER_SW_TIMER_SW_HPP_ */