Base class for Timer abstraction.
More...
#include <timer.hpp>
|
using | Impl = TimerImpl< Context, Size > |
|
template<auto Context, template< auto, typename > typename TimerImpl, typename Size>
struct bsp::drv::Timer< Context, TimerImpl, Size >
Base class for Timer abstraction.
- Template Parameters
-
Context | Timer context |
TimerImpl | Timer implementation |
Size | Timer counter register size (16 bit or 32 bit) |
◆ Impl
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ Timer() [1/3]
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ Timer() [2/3]
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ Timer() [3/3]
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ deinit()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
static auto bsp::drv::Timer< Context, TimerImpl, Size >::deinit |
( |
auto ... |
args | ) |
|
|
inlinestatic |
Timer deinitialization.
- Parameters
-
args | Platform specific arguments |
- Returns
- Success
◆ disable()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ enable()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ getCount()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
Get the counter value.
- Returns
- Actual timer count
◆ getPwmFrequency()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
Get the pwm frequency.
- Note
- The frequency is for all channels the same
- Returns
- Frequency in Hz
◆ init()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
static auto bsp::drv::Timer< Context, TimerImpl, Size >::init |
( |
auto ... |
args | ) |
|
|
inlinestatic |
Timer initialization.
- Parameters
-
args | Platform specific arguments |
- Returns
- Success
◆ resetCount()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
Set the counter value to 0.
◆ setCount()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
static void bsp::drv::Timer< Context, TimerImpl, Size >::setCount |
( |
Size |
cnt | ) |
|
|
inlinestatic |
Set the counter value.
- Parameters
-
◆ setPwmFrequency()
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
static bool bsp::drv::Timer< Context, TimerImpl, Size >::setPwmFrequency |
( |
u32 |
f_hz, |
|
|
Size |
resolution = 0 |
|
) |
| |
|
inlinestatic |
Set the pwm frequency and (optional) the maximal ticks within on cycle for all channels.
- Note
- The actual duty cycle for all channels will be restored after the changes
- Parameters
-
f_hz | new frequency in hz |
resolution | of the pwm, for 0 the actual value will be used |
- Returns
- true when the adjustment was possible, false when the parameter did not match
◆ Channel
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
template<u8 Number>
auto& bsp::drv::Timer< Context, TimerImpl, Size >::Channel = Impl::template Channel<Number> |
|
inlinestatic |
Timer channel.
- Template Parameters
-
◆ Encoder
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
◆ ProfileCounter
template<auto Context, template< auto, typename > typename TimerImpl, typename Size >
auto& bsp::drv::Timer< Context, TimerImpl, Size >::ProfileCounter = Impl::ProfileCounter |
|
inlinestatic |
Timer used as profile counter.
The documentation for this struct was generated from the following file: