sitara_depot/components/free_rtos/timer_sw/timer_sw.hpp

32 lines
473 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* timer_sw.hpp
*
* Created on: 13 мар. 2023 г.
* 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_ */