|
stm32f103
|
Implements device-level abstraction for TIM deivces. More...
#include <timer_device.h>
Classes | |
| struct | Config |
| Configuration for TIM device. More... | |
Public Types | |
| enum | Timers { kTim1, kTim2, kTim3, kTim4, kTim5, kTim6, kTim7 } |
| TIM devices enumeration. More... | |
| using | Listener = std::function< void()> |
| TIM Listener type definition. More... | |
Public Member Functions | |
| TimerDevice (const Config &config) | |
| Constructor for Timer Device. More... | |
| void | SetListener (Listener &&listener) |
| Sets and enables listener for this device. More... | |
Static Public Member Functions | |
| static Listener & | InvokeListener (const Timers tim_device) |
| Invokes the external listener. More... | |
Implements device-level abstraction for TIM deivces.
As opposed to Timer, this class is designed to be a higher-level abstraction, and includes the ability to manage listeners for each TIM device.
| using TimerDevice::Listener = std::function<void()> |
TIM Listener type definition.
| enum TimerDevice::Timers |
|
explicit |
Constructor for Timer Device.
| config | Timer device configuration. See TimerDevice::Config. |
Invokes the external listener.
| tim_device | TIM device enumeration |

| void TimerDevice::SetListener | ( | Listener && | listener | ) |
Sets and enables listener for this device.
Timer listeners should have function prototype of void().
| listener | External listener function to trigger. |