modm API documentation
modm::platform::Timer6 Class Reference

Basic Timer 6. More...

#include <modm/platform/timer/timer_6.hpp>

Inheritance diagram for modm::platform::Timer6:
modm::platform::BasicTimer

Public Typedefs

using Value = uint16_t
 

Public Types

enum  Event : uint32_t {
  Break = TIM_EGR_BG, CaptureCompareControlUpdate = TIM_EGR_COMG, Trigger = TIM_EGR_TG, CaptureCompare4 = TIM_EGR_CC4G,
  CaptureCompare3 = TIM_EGR_CC3G, CaptureCompare2 = TIM_EGR_CC2G, CaptureCompare1 = TIM_EGR_CC1G, Update = TIM_EGR_UG
}
 
enum  Interrupt : uint32_t { Update = TIM_DIER_UIE }
 
enum  InterruptFlag : uint32_t { Update = TIM_SR_UIF }
 
enum  Mode : uint32_t { UpCounter = 0, OneShotUpCounter = TIM_CR1_OPM }
 

Public Member Functions

 MODM_FLAGS32 (Interrupt)
 
 MODM_FLAGS32 (InterruptFlag)
 

Static Public Member Functions

template<class... Signals>
static void connect ()
 
static void enable ()
 
static void disable ()
 
static bool isEnabled ()
 
static void pause ()
 
static void start ()
 
static void setMode (Mode mode)
 
static void setPrescaler (uint16_t prescaler)
 
static uint16_t getPrescaler ()
 
static void setOverflow (Value overflow)
 
static Value getOverflow ()
 
template<class SystemClock >
static constexpr uint32_t getClockFrequency ()
 
template<class SystemClock , class Rep , class Period >
static Value setPeriod (std::chrono::duration< Rep, Period > duration, bool autoApply=true)
 
static void generateEvent (Event ev)
 
static void applyAndReset ()
 
static Value getValue ()
 
static void setValue (Value value)
 
static bool isCountingUp ()
 
static bool isCountingDown ()
 
static constexpr bool hasAdvancedPwmControl ()
 
static void enableInterruptVector (bool enable, uint32_t priority)
 
static void enableInterrupt (Interrupt_t interrupt)
 
static void disableInterrupt (Interrupt_t interrupt)
 
static InterruptFlag_t getInterruptFlags ()
 
static void acknowledgeInterruptFlags (InterruptFlag_t interrupt)
 
static void enableInterruptVector (bool enable, uint8_t priority)
 

Detailed Description

Basic Timer 6.

Interrupt handler:

MODM_ISR(TIM6)
{
Timer6::resetInterruptFlags(Timer6::FLAG_UPDATE);
...
}

For the STM32F2xx and STM32F4xx:

MODM_ISR(TIM6_DAC)
{
Timer6::resetInterruptFlags(Timer6::FLAG_UPDATE);
...
}
Author
Fabian Greif

Member Function Documentation

static void modm::platform::BasicTimer::enableInterruptVector ( bool  enable,
uint8_t  priority 
)
inheritedstatic

Enables or disables the Interrupt Vector.

Parameters
enableEnable/disable the interrupt vector
priorityPriority of the interrupt vector (0=highest to 15=lowest).

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