Operates a borrowed up counter and computes elapsed ticks across a wrap.
More...
#include <timer.hpp>
|
| | Timer (Counter &counter, CompareControl *compare=nullptr, InputCapture *capture=nullptr) |
| | Timer (ClockControl &counter, CompareControl *compare=nullptr, InputCapture *capture=nullptr) |
| void | start () |
| void | stop () |
| Count | ticks () const |
| uint8_t | width_bits () const |
| bool | set_ticks (Count count) |
| bool | set_tick_frequency_hz (uint32_t frequency_hz) |
| bool | set_compare (ChannelId channel, Count threshold) |
| bool | try_capture (Count &count) |
| | Preserves count if capture is unavailable or no event is ready.
|
| Count | elapsed_since (Count previous) const |
| | Computes elapsed ticks modulo the counter width.
|
Operates a borrowed up counter and computes elapsed ticks across a wrap.
Definition at line 16 of file timer.hpp.
◆ Timer() [1/2]
| mhaa::timer::Timer::Timer |
( |
Counter & | counter, |
|
|
CompareControl * | compare = nullptr, |
|
|
InputCapture * | capture = nullptr ) |
|
inlineexplicit |
◆ Timer() [2/2]
| mhaa::timer::Timer::Timer |
( |
ClockControl & | counter, |
|
|
CompareControl * | compare = nullptr, |
|
|
InputCapture * | capture = nullptr ) |
|
inlineexplicit |
◆ elapsed_since()
| Count mhaa::timer::Timer::elapsed_since |
( |
Count | previous | ) |
const |
|
inline |
Computes elapsed ticks modulo the counter width.
Definition at line 48 of file timer.hpp.
◆ set_compare()
| bool mhaa::timer::Timer::set_compare |
( |
ChannelId | channel, |
|
|
Count | threshold ) |
|
inline |
◆ set_tick_frequency_hz()
| bool mhaa::timer::Timer::set_tick_frequency_hz |
( |
uint32_t | frequency_hz | ) |
|
|
inline |
◆ set_ticks()
| bool mhaa::timer::Timer::set_ticks |
( |
Count | count | ) |
|
|
inline |
◆ start()
| void mhaa::timer::Timer::start |
( |
| ) |
|
|
inline |
◆ stop()
| void mhaa::timer::Timer::stop |
( |
| ) |
|
|
inline |
◆ ticks()
| Count mhaa::timer::Timer::ticks |
( |
| ) |
const |
|
inline |
◆ try_capture()
| bool mhaa::timer::Timer::try_capture |
( |
Count & | count | ) |
|
|
inline |
Preserves count if capture is unavailable or no event is ready.
Definition at line 45 of file timer.hpp.
◆ width_bits()
| uint8_t mhaa::timer::Timer::width_bits |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: