3.14.6 12-bit Timer/Counter D with PWM
One 12-bit PWM Timer/Counter type D (TCD) optimized for power control
3.14.6.1 Introduction
The Timer/Counter type D (TCD) is a flexible 12-bit timer that can perform complex actions as well as the basic functions of a simple timer. The TCD is a high-performance waveform generator consisting of a counter that can run on a clock which is asynchronous to the peripheral clock, a prescaler, as well as compare, capture and control logic. The compare logic generates two independent outputs with optional dead time. The TCD is also connected to the Event System for capture and deterministic fault control. The timer/counter can generate interrupts and events on compare match and overflow.
3.14.6.2 Supported Device Families
AVR® Dx | AVR® Ex | ATtiny | ATmega |
3.14.6.3 Required Header Files
#include "mcc_generated_files/timer/tcd[X].h"
3.14.6.4 Module Documentation
3.14.6.4.1 TCD
This file contains the API prototypes for the TCD driver.
Module description
This file contains the API prototypes for the TCD driver.
Functions
-
int8_t TCD_Initialize ()
Initializes the TCD interface.
-
void TCD_SetTRIGIsrCallback (TCD0_cb_t cb)
Interrupt Service Routine (ISR) callback function to be called if the Trigger Input Interrupt flag is set.
-
void TCD_SetOVFIsrCallback (TCD0_cb_t cb)
ISR callback function to be called if the Counter Overflow flag is set.
Function Documentation
TCD_Initialize()
int8_t TCD_Initialize ( )
Initializes the TCD interface.
|
|
TCD_SetOVFIsrCallback()
void TCD_SetOVFIsrCallback (TCD0_cb_t cb)
ISR callback function to be called if the Counter Overflow flag is set.
|
None. |
TCD_SetTRIGIsrCallback()
void TCD_SetTRIGIsrCallback (TCD0_cb_t cb)
Interrupt Service Routine (ISR) callback function to be called if the Trigger Input Interrupt flag is set.
|
None. |
3.14.6.4.2 TIMER INTERFACE
This file contains API prototypes and other data types for the Timer module.
3.14.6.5 Class Documentation
3.14.6.5.1 TMR_INTERFACE Struct Reference
#include <timer_interface.h>
Public Attributes
-
void(* Initialize )(void)
-
void(* Start )(void)
-
void(* Stop )(void)
-
void(* PeriodCountSet )(size_t count)
-
void(* TimeoutCallbackRegister )(void(*CallbackHandler)(void))
-
void(* Tasks )(void)
Member Data Documentation
Initialize
void(* TMR_INTERFACE::Initialize) (void)
PeriodCountSet
void(* TMR_INTERFACE::PeriodCountSet) (size_t count)
Start
void(* TMR_INTERFACE::Start) (void)
Stop
void(* TMR_INTERFACE::Stop) (void)
Tasks
void(* TMR_INTERFACE::Tasks) (void)
TimeoutCallbackRegister
void(* TMR_INTERFACE::TimeoutCallbackRegister) (void(*CallbackHandler)(void))
3.14.6.6 File Documentation
3.14.6.6.1 source/tcd0.c File Reference
This file contains the API implementations for the TCD driver.
#include "../tcd0.h"
Functions
-
void TCD_SetTRIGIsrCallback (TCD_cb_t cb)
-
void TCD_SetOVFIsrCallback (TCD_cb_t cb)
-
int8_t TCD_Initialize (void)
Initializes the TCD interface.
-
ISR (TCD0_OVF_vect)
-
ISR (TCD0_TRIG_vect)
Variables
-
void(* TCD_TRIG_isr_cb )(void) = NULL
-
void(* TCD_OVF_isr_cb )(void) = NULL
Detailed Description
This file contains the API implementations for the TCD driver.
TCD0 Generated Driver File
Function Documentation
ISR()[1/2]
ISR (TCD0_OVF_vect )
ISR()[2/2]
ISR (TCD0_TRIG_vect )
TCD_SetOVFIsrCallback()
void TCD_SetOVFIsrCallback (TCD_cb_t cb)
TCD_SetTRIGIsrCallback()
void TCD_SetTRIGIsrCallback (TCD_cb_t cb)
Variable Documentation
TCD_OVF_isr_cb
void(* TCD_OVF_isr_cb) (void) = NULL
TCD_TRIG_isr_cb
void(* TCD_TRIG_isr_cb) (void) = NULL
3.14.6.6.2 source/tcd0.h File Reference
#include "../system/utils/compiler.h" #include "../system/ccp.h"
Functions
-
int8_t TCD_Initialize ()
Initializes the TCD interface.
-
void TCD_SetTRIGIsrCallback (TCD0_cb_t cb)
Interrupt Service Routine (ISR) callback function to be called if the Trigger Input Interrupt flag is set.
-
void TCD_SetOVFIsrCallback (TCD0_cb_t cb)
ISR callback function to be called if the Counter Overflow flag is set.
Typedefs
-
typedef void(* TCD_cb_t) (void)
Detailed Description
TCD0 Generated Driver API Header File
Typedef Documentation
TCD_cb_t
typedef void(* TCD_cb_t) (void)
3.14.6.6.3 source/timer_interface.h File Reference
#include <stddef.h>
Data structures
-
struct TMR_INTERFACE
Detailed Description
Timer Interface Generated Driver API Header File