Tool Libs
UMIT-TIROL Institute of Automation and Control Engineering library collection
 
Loading...
Searching...
No Matches
TIMER::PWM Class Reference

Template class for hardware based PWM outputs. More...

#include <pwm.h>

Classes

struct  Config
 PWM configuration. More...
 

Public Member Functions

void pwm (double perc)
 set pwm in percent
 
void ticks (uint32_t ticks)
 set pwm as value of timer ticks
 
void period (uint16_t period)
 change frequency by setting period of timer freq = base / period counter is blocked while period = 0
 
 PWM (const Config &conf)
 Initialize Timer Channel.
 
double pwm ()
 get currently set pwm value in percent
 
uint32_t ticks ()
 get currently set pwm value in timer ticks
 

Detailed Description

Template class for hardware based PWM outputs.


Class Documentation

◆ TIMER::PWM::Config

struct TIMER::PWM::Config

PWM configuration.

Collaboration diagram for TIMER::PWM::Config:
[legend]
Class Members
HW * tim TIMER::HW peripheral.
uint32_t chan Timer channel.
AFIO pin pin in alternate function mode

Member Function Documentation

◆ pwm()

void TIMER::PWM::pwm ( double  perc)
inline

set pwm in percent

Parameters
perc[0..1]

◆ ticks()

void TIMER::PWM::ticks ( uint32_t  ticks)
inline

set pwm as value of timer ticks

Parameters
ticks[0..TIMER::HW period]

◆ period()

void TIMER::PWM::period ( uint16_t  period)
inline

change frequency by setting period of timer freq = base / period counter is blocked while period = 0

Parameters
period[]

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