mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-08-05 19:01:54 +00:00
Added Timer Wrapper
This commit is contained in:
34
include/sta/rtos/timer.hpp
Normal file
34
include/sta/rtos/timer.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief RTOS timer implementation.
|
||||
*/
|
||||
|
||||
#ifndef STA_RTOS_TIMER_HPP
|
||||
#define STA_RTOS_TIMER_HPP
|
||||
|
||||
#include <cmsis_os2.h>
|
||||
#include <sta/timer.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
/**
|
||||
* @brief Implementation of Timer using CMSIS RTOS2.
|
||||
*
|
||||
* @ingroup STA_RTOS_API
|
||||
*/
|
||||
class RtosTimer : public Timer
|
||||
{
|
||||
public:
|
||||
RtosTimer(void (*callback)(void *arg), void *arg);
|
||||
~RtosTimer();
|
||||
|
||||
void start(uint32_t millis) override;
|
||||
void stop() override;
|
||||
|
||||
private:
|
||||
osTimerId_t timer_id_; /**< CMSIS RTOS2 Timer */
|
||||
osTimerAttr_t timer_attr_; /**< CMSIS RTOS2 Timer attributes */
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_RTOS_TIMER_HPP
|
Reference in New Issue
Block a user