sitara_depot/components/free_rtos/clock/clock.hpp

40 lines
586 B
C++
Raw Permalink 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.

/*
* clock.hpp
*
* Created on: 13 мар. 2023 г.
* Author: sychev
*/
#ifndef FREE_RTOS_CLOCK_CLOCK_HPP_
#define FREE_RTOS_CLOCK_CLOCK_HPP_
#include <kernel/dpl/ClockP.h>
namespace free_rtos {
class Clock {
public:
using Callback = void(*)(ClockP_Object *,void *);
bool init(uint32_t period_ms, Callback cbk, void * arg);
void start();
void stop();
uint32_t getPeriod() {
return prd_ms_;
}
~Clock();
private:
ClockP_Object obj_;
uint32_t prd_ms_; /// Период в мс
};
}
#endif /* FREE_RTOS_CLOCK_CLOCK_HPP_ */