libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::TimerHandle::Config Struct Reference

Configuration struct for the Peripheral. More...

Detailed Description

Configuration struct for the Peripheral.

Note
These settings are used during initialization and changing them afterwards may not have the desired effect.

#include <tim.h>

Public Types

enum class  Peripheral { TIM_2 = 0 , TIM_3 , TIM_4 , TIM_5 }
 Hardware Timer to configure, and use. More...
 
enum class  CounterDir { UP = 0 , DOWN }
 Direction of the auto-reload counter. More...
 

Public Member Functions

 Config ()
 

Public Attributes

Peripheral periph
 
CounterDir dir
 
uint32_t period
 period in ticks at TIM frequency that counter will reset based on dir
 
bool enable_irq
 

Member Enumeration Documentation

◆ CounterDir

Direction of the auto-reload counter.

Todo:
Add support for the various
versions of Up/Down counters.
Enumerator
UP 
DOWN 

◆ Peripheral

Hardware Timer to configure, and use.

Enumerator
TIM_2 

32-bit counter

TIM_3 

16-bit counter

TIM_4 

16-bit counter

TIM_5 

32-bit counter

Constructor & Destructor Documentation

◆ Config()

daisy::TimerHandle::Config::Config ( )
inline

Member Data Documentation

◆ dir

CounterDir daisy::TimerHandle::Config::dir

Counter direction

◆ enable_irq

bool daisy::TimerHandle::Config::enable_irq

Enable interrupt for user based callback

◆ period

uint32_t daisy::TimerHandle::Config::period

period in ticks at TIM frequency that counter will reset based on dir

Note
TIM3 and TIM4 are both 16-bit timers. So the period maximum is 0xffff.

◆ periph

Peripheral daisy::TimerHandle::Config::periph

Hardware Peripheral


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