TIMER - Timer/Counter

Description

Timer/Counter (TIMER) Peripheral API.

The timer module consists of three main parts:

  • General timer configuration and enable control.
  • Compare/capture control.
  • Dead time insertion control (may not be available for all timers).

Data Structures

struct TIMER_Init_TypeDef
TIMER initialization structure.
struct TIMER_InitCC_TypeDef
TIMER compare/capture initialization structure.
struct TIMER_InitDTI_TypeDef
TIMER Dead Time Insertion (DTI) initialization structure.

Functions

void TIMER_Init (TIMER_TypeDef *timer, const TIMER_Init_TypeDef *init)
Initialize TIMER.
void TIMER_InitCC (TIMER_TypeDef *timer, unsigned int ch, const TIMER_InitCC_TypeDef *init)
Initialize the TIMER compare/capture channel.
void TIMER_InitDTI (TIMER_TypeDef *timer, const TIMER_InitDTI_TypeDef *init)
Initialize the TIMER DTI unit.
void TIMER_Reset (TIMER_TypeDef *timer)
Reset the TIMER to the same state that it was in after a hardware reset.
bool TIMER_Valid (const TIMER_TypeDef *ref)
Validate TIMER register block pointer.
bool TIMER_SupportsDTI (const TIMER_TypeDef *ref)
Check if TIMER is valid and supports Dead Timer Insertion (DTI).
uint32_t TIMER_MaxCount (const TIMER_TypeDef *ref)
Get the Max count of the timer.