stm32f103
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TimerDevice Class Reference

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 ListenerInvokeListener (const Timers tim_device)
 Invokes the external listener. More...
 

Detailed Description

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.

Member Typedef Documentation

using TimerDevice::Listener = std::function<void()>

TIM Listener type definition.

Member Enumeration Documentation

TIM devices enumeration.

Enumerator
kTim1 

TIM1.

kTim2 

TIM2.

kTim3 

TIM3.

kTim4 

TIM4.

kTim5 

TIM5.

kTim6 

TIM6.

kTim7 

TIM7.

Constructor & Destructor Documentation

TimerDevice::TimerDevice ( const Config config)
explicit

Constructor for Timer Device.

Parameters
configTimer device configuration. See TimerDevice::Config.

Member Function Documentation

static Listener& TimerDevice::InvokeListener ( const Timers  tim_device)
inlinestatic

Invokes the external listener.

Parameters
tim_deviceTIM device enumeration
Returns
External listener corresponding to the TIM device

Here is the caller graph for this function:

void TimerDevice::SetListener ( Listener &&  listener)

Sets and enables listener for this device.

Timer listeners should have function prototype of void().

Parameters
listenerExternal listener function to trigger.

The documentation for this class was generated from the following files: