Timer implementation for Midgard.
More...
#include <timer.hpp>
template<auto Context, typename Size>
struct bsp::mid::drv::Timer< Context, Size >
Timer implementation for Midgard.
- Warning
- Do not use this on its own!
- Template Parameters
-
Context | Timer context |
Size | Timer width (16 bit or 32 bit) |
◆ deinit()
template<auto Context, typename Size >
Deinit function.
- Returns
- Success
◆ disable()
template<auto Context, typename Size >
◆ enable()
template<auto Context, typename Size >
◆ getCount()
template<auto Context, typename Size >
Get the counter value.
- Returns
- Actual timer count
◆ getPwmFrequency()
template<auto Context, typename Size >
Get the pwm frequency.
- Note
- The frequency is for all channels the same
- Returns
- Frequency in Hz
◆ init()
template<auto Context, typename Size >
Init function.
- Returns
- Success
◆ setCount()
template<auto Context, typename Size >
Set the counter value.
- Parameters
-
◆ setPwmFrequency()
template<auto Context, typename Size >
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
-
Implement a proper error handling, the function does not guarantee to be successful
- 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, typename Size >
template<u8 Number>
Timer channel.
- Template Parameters
-
◆ Encoder
template<auto Context, typename Size >
◆ ProfileCounter
template<auto Context, typename Size >
Timer used as profile counter.
The documentation for this struct was generated from the following file: