4.14.4 16-bit Timer/Counter A with PWM

16-bit Timer/Counter type A (TCA) with three compare channels for PWM and waveform generation.

4.14.4.1 Introduction

The Timer/Counter type A (TCA) is a 16-bit flexible timer that can perform complex actions as well as the basic functions of a simple timer. The TCA can be split into two completely independent 8-bit timers and can also support Wave Generation modes. Another important characteristic is that the TCA was devised to overcome common problems when using timers, such as the unpredictable behavior of the Pulse-Width Modulator (PWM) signal when the duty cycle is changed while the timer is running. The TCA has double-buffered registers that synchronize the updates of different registers, making the generated waveforms predictable in every single situation.

4.14.4.2 Supported Device Families

AVR® DxAVR® ExATtinyATmega

4.14.4.3 Required Header Files

#include "mcc_generated_files/timer/tca[X].h"
Note: Replace [X] with the selected instance number of the TCA module.

4.14.4.4 How to Use the TCA PLIB Driver

The links below provide examples for the different TCA use cases.

General instructions common for all examples: Timer Use Case Code Snippet Instructions

Videos Running MCC Melody use case code snippets for AVR:
Many of use cases build on the following components, so this is a good place to start if you are new to MCC Melody:

4.14.4.5 Module Documentation

4.14.4.5.1 TCA0 in Normal Mode

This file contains the API prototypes for the TCA0 driver in Normal (16-bit) mode.

Module description

This file contains the API prototypes for the TCA0 driver in Normal (16-bit) mode.

Version: TCA0 Driver Version 2.1.1
Typedefs
  • typedef void(* TCAx_cb_t) (void)

    Function pointer to the callback function called by TCA when operating in Normal mode. The default value is set to NULL which means that no callback function will be used.

Functions

Typedef Documentation

TCAx_cb_t

void TCAx_cb_t

Function pointer to the callback function called by TCA when operating in Normal mode. The default value is set to NULL which means that no callback function will be used.

Function pointer to the callback function called by TCA when operating in Split mode. The default value is set to NULL which means that no callback function will be used.

Function Documentation

TCAx_ClearCMP0InterruptFlag()

void TCAx_ClearCMP0InterruptFlag (void )

Clears the Compare 0 Interrupt flag after the Compare 0 flag is set.

Parameters:
None.
Returns:

None.

TCAx_ClearCMP1InterruptFlag()

void TCAx_ClearCMP1InterruptFlag (void )

Clears the Compare 1 Interrupt flag after the Compare 1 flag is set.

Parameters:
None.
Returns:

None.

TCAx_ClearCMP2InterruptFlag()

void TCAx_ClearCMP2InterruptFlag (void )

Clears the Compare 2 Interrupt flag after the Compare 2 flag is set.

Parameters:
None.
Returns:

None.

TCAx_ClearOverflowInterruptFlag()

void TCAx_ClearOverflowInterruptFlag (void )

Clears the Overflow Interrupt flag after the Overflow flag set.

Parameters:
None.
Returns:

None.

TCAx_Compare0CallbackRegister()

void TCAx_Compare0CallbackRegister (TCAx_cb_t cb)

ISR callback function to be called if the Compare 0 Match Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Compare 0 match event.

Returns:

None.

TCAx_Compare1CallbackRegister()

void TCAx_Compare1CallbackRegister (TCAx_cb_t cb)

ISR callback function to be called if the Compare 1 Match Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Compare 1 match event.

Returns:

None.

TCAx_Compare2CallbackRegister()

void TCAx_Compare2CallbackRegister (TCAx_cb_t cb)

ISR callback function to be called if the Compare 2 Match Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Compare 2 match event.

Returns:

None.

TCAx_DisableInterrupt()

void TCAx_DisableInterrupt (void )

Disables the 16-bit timer/counter interrupt for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_EnableInterrupt()

void TCAx_EnableInterrupt (void )

Enables the 16-bit timer/counter interrupt for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_Initialize()

void TCAx_Initialize (void )

Initializes the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_IsCMP0InterruptFlagSet()

bool TCAx_IsCMP0InterruptFlagSet (void )

Checks the Compare 0 Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Compare 0 Interrupt flag is set.

False

- Compare 0 Interrupt flag is not set.

TCAx_IsCMP1InterruptFlagSet()

bool TCAx_IsCMP1InterruptFlagSet (void )

Checks the Compare 1 Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Compare 1 Interrupt flag is set.

False

- Compare 1 Interrupt flag is not set.

TCAx_IsCMP2InterruptFlagSet()

bool TCAx_IsCMP2InterruptFlagSet (void )

Checks the Compare 2 Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Compare 2 Interrupt flag is set.

False

- Compare 2 Interrupt flag is not set.

TCAx_IsOverflowInterruptFlagSet()

bool TCAx_IsOverflowInterruptFlagSet (void )

Checks the Overflow Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Overflow Interrupt flag is set.

False

- Overflow Interrupt flag is not set.

TCAx_OverflowCallbackRegister()

void TCAx_OverflowCallbackRegister (TCAx_cb_t cb)

Interrupt Service Routine (ISR) callback function register to be called if the Overflow Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Overflow event.

Returns:

None.

TCAx_Read()

uint16_t TCAx_Read (void )

Reads the 16-bit timer/counter value for the TCA interface.

Parameters:
None.
Returns:

uint16_t - timer/counter value returns from the TCA0 interface.

TCAx_Start()

void TCAx_Start (void )

Starts the 16-bit timer/counter for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_Stop()

void TCAx_Stop (void )

Stops the 16-bit timer/counter for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_Write()

void TCAx_Write (uint16_t timerVal)

Writes the timer value to load to the TCA.

Parameters:
uint16_t

timerVal - Loading the timer value for the TCA.

Returns:

None.

4.14.4.5.2 TCA0 in Split mode

This file contains the API prototypes for the TCA0 driver in Split (8-bit) mode.

Module description

This file contains the API prototypes for the TCA0 driver in Split (8-bit) mode.

Version: TCA0 Driver Version 2.1.1
Functions

Function Documentation

TCAx_ClearHUNFInterruptFlag()

void TCAx_ClearHUNFInterruptFlag (void )

Clears the high byte Underflow Interrupt flag, if the flag is set.

Parameters:
None.
Returns:

None.

TCAx_ClearLCMP0InterruptFlag()

void TCAx_ClearLCMP0InterruptFlag (void )

Clears the low byte Compare Channel 0 Interrupt Enable bit, if the flag is set for the TCA.

Parameters:
None.
Returns:

None.

TCAx_ClearLCMP1InterruptFlag()

void TCAx_ClearLCMP1InterruptFlag (void )

Clears the low byte Compare Channel 1 Interrupt Enable bit, if the flag is set for the TCA.

Parameters:
None.
Returns:

None.

TCAx_ClearLCMP2InterruptFlag()

void TCAx_ClearLCMP2InterruptFlag (void )

Clears the low byte Compare Channel 2 Interrupt Enable bit, if the flag is set for the TCA.

Parameters:
None.
Returns:

None.

TCAx_ClearLUNFInterruptFlag()

void TCAx_ClearLUNFInterruptFlag (void )

Clears the low byte Underflow Interrupt flag, if the flag is set.

Parameters:
None.
Returns:

None.

TCAx_DisableInterrupt()

void TCAx_DisableInterrupt (void )

Disables the Split timer/counter interrupt for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_EnableInterrupt()

void TCAx_EnableInterrupt (void )

Enables the Split timer/counter interrupt for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_HighCountCallbackRegister()

void TCAx_HighCountCallbackRegister (TCAx_cb_t cb)

Interrupt Service Routine (ISR) callback function register to be called when the high byte Underflow Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for high byte underflow event.

Returns:

None.

TCAx_Initialize()

void TCAx_Initialize (void )

Initializes Split mode for the TCA interface.

Parameters:
None.
Returns:

None.

Initializes Split mode for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_IsHUNFInterruptFlagSet()

bool TCAx_IsHUNFInterruptFlagSet (void )

Checks the high byte Underflow Interrupt flag status for split timer/counter.

Parameters:
None.
Return values:
True

- High byte Underflow Interrupt flag is set.

False

- High byte Underflow Interrupt flag is not set.

TCAx_IsLCMP0InterruptFlagSet()

bool TCAx_IsLCMP0InterruptFlagSet (void )

Checks the low byte Compare Channel 0 Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Low byte Compare Channel 0 Interrupt flag is set.

False

- Low byte Compare Channel 0 Interrupt flag is not set.

TCAx_IsLCMP1InterruptFlagSet()

bool TCAx_IsLCMP1InterruptFlagSet (void )

Checks the low byte Compare Channel 1 Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Low byte Compare Channel 1 Interrupt flag is set.

False

- Low byte Compare Channel 1 Interrupt flag is not set.

TCAx_IsLCMP2InterruptFlagSet()

bool TCAx_IsLCMP2InterruptFlagSet (void )

Checks the low byte Compare Channel 2 Interrupt flag status for the TCA interface.

Parameters:
None.
Return values:
True

- Low byte Compare Channel 2 Interrupt flag is set.

False

- Low byte Compare Channel 2 Interrupt flag is not set.

TCAx_IsLUNFInterruptFlagSet()

bool TCAx_IsLUNFInterruptFlagSet (void )

Checks the low byte Underflow Interrupt flag status for Split timer/counter.

Parameters:
None.
Return values:
True

- Low byte Underflow Interrupt flag is set.

False

- Low byte Underflow Interrupt flag is not set.

TCAx_LowCompare0CallbackRegister()

void TCAx_LowCompare0CallbackRegister (TCAx_cb_t cb)

ISR callback function register to be called when the lower byte Compare 0 Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Compare 0.

Returns:

None.

TCAx_LowCompare1CallbackRegister()

void TCAx_LowCompare1CallbackRegister (TCAx_cb_t cb)

ISR callback function register to be called when the lower byte Compare 1 Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Compare 1.

Returns:

None.

TCAx_LowCompare2CallbackRegister()

void TCAx_LowCompare2CallbackRegister (TCAx_cb_t cb)

ISR callback function register to be called when the lower byte Compare 2 Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for Compare 2.

Returns:

None.

TCAx_LowCountCallbackRegister()

void TCAx_LowCountCallbackRegister (TCAx_cb_t cb)

ISR callback function register to be called when the low byte Underflow Interrupt flag is set.

Parameters:
TCAx_cb_t

cb - Callback function for low byte underflow event.

Returns:

None.

TCAx_ReadHighCount()

uint8_t TCAx_ReadHighCount (void )

Reads the high 8-bit timer/counter1 value for the TCA interface.

Parameters:
None.
Returns:

Timer/counter1 value returned from the TCA0 interface.

TCAx_ReadLowCount()

uint8_t TCAx_ReadLowCount (void )

Reads the low 8-bit timer/counter2 value for the TCA interface.

Parameters:
None.
Returns:

uint8_t - Timer/counter2 value returned from the TCA0 interface.

TCAx_Start()

void TCAx_Start (void )

Starts Split timer/counter for the TCA interface.

Parameters:
None.
Returns:

None.

Starts Split timer/counter for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_Stop()

void TCAx_Stop (void )

Stops Split timer/counter for the TCA interface.

Parameters:
None.
Returns:

None.

Stops Split timer/counter for the TCA interface.

Parameters:
None.
Returns:

None.

TCAx_WriteHighCount()

void TCAx_WriteHighCount (uint8_t timerVal)

Writes the high 8-bit timer/counter1 value to load for the TCA interface.

Parameters:
uint8_t

timerVal - Loading the Timer1 value for the TCA.

Returns:

None.

TCAx_WriteLowCount()

void TCAx_WriteLowCount (uint8_t timerVal)

Writes the low 8-bit timer/counter2 value to load to the TCA interface.

Parameters:
uint8_t

timerVal - Loading the Timer2 value for the TCA.

Returns:

None.

4.14.4.5.3 Timer Interface

This file contains API prototypes and other datatypes for TCA module.

Module description

This file contains API prototypes and other datatypes for TCA module.

@Company Microchip Technology Inc.

@File Name TMR_interface.h

@Summary This is the generated header file for Timer module interfaces.

@Description This header file provides interfaces to Timer driver APIs. Generation Information : Driver Version : 1.00 The generated drivers are tested against the following: MPLAB : MPLAB X v5.40

4.14.4.5.4 Timer/Counter Type A (TCA) Use Cases

Timer Use Case Code Snippet Instructions

The use cases show example uses of the Timer/Counter A Peripheral Library (PLIB) driver, within a MCC Melody project:
  • Add TCA (or another timer) to the project

  • Configure:
    1. Timer/Counter X as described in the use case.

    2. Any other peripherals or pins needed for the use case.

  • Generate the code

  • Add the code snippet(s) to the application code

  • Program the board

Timer Use Case 1: 100 ms Timer

This use case configures Timer/Counter A (TCAx) to generate an overflow interrupt at a period of 100 ms, while toggling an LED.

Timer/Counter Configuration
  • TCAx > Hardware Settings:
    1. Clock Selection: System Clock/x => Select so high limit of Requested Timeout(s) > needed

    2. Requested Timeout(s): 0.1 (100 ms).

  • TCAx > Interrupt Settings:
    1. Enable Overflow Interrupt: Yes

System Configuration
  • System > Interrupt Manager:
    1. Global Interrupt Enable: Yes.

  • System > Pins:
    1. Pin Grid View: Select LED pin as output (Check the schematic for your board).

    2. Pins: Rename Custom Name to "LED".

After configuring the components as described above, click 'Generate' to generate the code. Then add the following code snippets to your application:

#include "mcc_generated_files/system/system.h" 

/* Create a pointer of the type TMR_INTERFACE and assign it to the address of the TCA0_Interface TMR_INTERFACE struct.
This enables us to get access the portable API interface, which ensures that it's easy to change the peripheral instance the timer runs on. */
const struct TMR_INTERFACE *Timer = &TCA0_Interface;
void Timer_Callback_100ms(void){
    LED_Toggle();
}
int main(void)
{
    SYSTEM_Initialize();
    Timer->TimeoutCallbackRegister(Timer_Callback_100ms);

    while(1){}    
}

Timer Use Case 2: Switching timer period 100 ms/500 ms

The period of a timer is changed at run-time, when pushing the switch(SW) pin. The timer period is changed in the pin change interrupt request (IRQ) callback.

System Configuration
  • CLKCTRL > Settings:
    1. Oscillator Frequency Selection: 1 MHz system clock

Timer/Counter Configuration
  • TCAx > Hardware Settings:
    1. Clock Selection: System Clock/8.

    2. Requested Timeout(s): 0.1 (100 ms).

  • TCAx > Interrupt Settings:
    1. Enable Overflow Interrupt: Yes.

System Configuration
  • System > Interrupt Manager:
    1. Global Interrupt Enable: Yes.

  • System > Pins:
    1. Pin Grid View: Select LED pin as output, switch pin as input (Check the schematic for your board).

    2. Pins, LED pin: Rename Custom Name to "LED".

    3. Pins, switch pin: Rename Custom Name for switch pin to "SW".

    4. Pins, switch pin: Enable Pull-up if needed (Check the schematic for your board).

    5. Pins, switch pin: Input/Sense Configuration: Sense Falling/Rising Edge on switch press (Check the schematic for your board).

After configuring the components as described above, click 'Generate' to generate the code. Then add the following code snippets to your application:

#include "mcc_generated_files/system/system.h"
#include <util/delay.h>
/* Create a pointer of the type TMR_INTERFACE and assign it to the address of the TCA0_Interface TMR_INTERFACE struct.
This enables us to get access to the portable API interface, ensuring that it's easy to change the peripheral instance the timer runs on. */
const struct TMR_INTERFACE *Timer = &TCA0_Interface;  

#define LED_100ms (0x30D3)
#define LED_500ms (0xF423)
volatile bool CHANGE_PERIOD = false;
volatile bool PERIOD_100ms = true;
void Timer_Callback(void)
{
    LED_Toggle();
}

void SW_Callback(void)
{
    CHANGE_PERIOD = true;
}

void Timer_Change_Frequency(void){
    Timer->Stop();
    if(PERIOD_100ms)
    {
        TCA0.SINGLE.CNT = 0x0;  //Clear the Counter register
        Timer->PeriodCountSet(LED_500ms);
        PERIOD_100ms = false;
    }
    else
    {
        TCA0.SINGLE.CNT = 0x0;   //Clear the Counter register
        Timer->PeriodCountSet(LED_100ms);
        PERIOD_100ms = true;
    }
    Timer->Start();
}
int main(void)
{
    SYSTEM_Initialize();

    Timer->TimeoutCallbackRegister(Timer_Callback);
    PB2_SetInterruptHandler(SW_Callback);
    while(1)
    {
        if(CHANGE_PERIOD)
        {
            Timer_Change_Frequency();
            _delay_ms(100);    //De-bounce delay
            CHANGE_PERIOD = false;
        }
    }
}

Timer Use Case 3: Timer Wakes from Sleep Every 10s

This use case shows how to configure TCAx to wake the microcontroller (MCU) from sleep mode every ten seconds. The wake-up interrupt callback makes the LED blink on for 100 ms, then puts the MCU back to sleep mode. No callback is used, but The TCAx interrupt wakes up the MCU, which then continues to execute code in the while loop.

  • System > CLKCTRL:
    1. Oscillator Frequency Selection: 1 MHz system clock

Timer/Counter Configuration:
  • TCAx > Hardware Settings:
    1. Clock Selection: System Clock/1024 (giving about 1 ms clock).

    2. Requested Timeout(s): 10(s).

  • TCAx > Interrupt Settings:
    1. Enable Overflow Interrupt: Yes. (Note: No callback is used, the interrupt is only used to wake MCU from sleep mode).

System Configuration:
  • System > Interrupt Manager:
    1. Global Interrupt Enable: Yes.

  • System > Pins:
    1. Pin Grid View: Select LED pin as output (Check the schematic for your board).

    2. Pins: Rename Custom Name to "LED".

  • System > SLPCTRL (Sleep Control):
    1. System > SLPCTRL: Add to project.

    2. Sleep Enable: Yes.

After configuring the components as described above, click 'Generate' to generate the code. Then add the following code snippets to your application:

#include "mcc_generated_files/system/system.h"
#include <util/delay.h>
#include <avr/sleep.h>
int main(void)
{
    SYSTEM_Initialize();

    while(1){
        LED_SetLow();     //Set LED High
        _delay_ms(100);   //100ms Delay in between LED toggle
        LED_SetHigh();    //Set LED Low
        sleep_mode();     //Put microcontroller to Sleep
    }
}

Timer Use Case 4: 250 Hz Output Signal on General Purpose Input/Output (GPIO) Pin

This use case shows how to generate a signal of a specified frequency on a pin.

Note: It is only possible to select a single output frequency, i.e. the frequency will be the same between output channels even when set to different values.

  • System > CLKCTRL:
    1. Oscillator Frequency Selection: 1 MHz system clock.

Timer/Counter Configuration:
  • TCAx > Hardware Settings:
    1. Clock Selection: System Clock/4.

    2. Requested Timeout(s): 0.004 (4 ms).

  • TCAx > Waveform Generation Mode:
    1. Waveform Generation Mode: Frequency Generation Mode.

  • TCAx > Timer Channels:
    1. Channel 0: Enabled, 250 Hz.

  • System > Pins:
    1. Pin Grid View: TMR0 WO0, select GPIO to use for 250 Hz signal.

After configuring the components as described above, click 'Generate' to generate the code. Then add the following code snippets to your application:

#include "mcc_generated_files/system/system.h"
int main(void)
{
    SYSTEM_Initialize();

    while(1){}
}

Timer Use Case 5: Single slope PWM

Generates two PWM signals on the selected Waveform Output PINs:
  • a period of 100 ms and 25% duty cycle

  • a period of 100 ms and 60% duty cycle

  • System > CLKCTRL:
    1. Oscillator Frequency Selection: 1 MHz system clock.

  • TCAx > Hardware Settings:
    1. Clock Selection: System Clock/2.

  • TCAx > Waveform Generation Mode:
    1. Waveform Generation Mode: Single Slope PWM.

  • TCAx > Timer Channels:
    1. Timer Channels: Select an output channel(s) to enable.

    2. Timer Channels: RequestedDuty 25%, 60%.

  • System > Pins:
    1. Pin Grid View: TCAx WO0 (Waveform Output): Select output pin.

    2. Pin Grid View: TCAx WO1 (Waveform Output): Select output pin.

After configuring the components as described above, click 'Generate' to generate the code. Then add the following code snippets to your application:

#include "mcc_generated_files/system/system.h"
int main(void)
{
    SYSTEM_Initialize();

    while(1){}
}

Timer Use Case 6: Single Slope PWM in Split mode

Generates PWM signals using timer split mode, generating two PWM waveforms on the selected Waveform Output pins:

  • a period of 10 ms and 20% duty cycle

  • a period of 5 ms and 40% duty cycle

  • System > CLKCTRL:
    1. Oscillator Frequency Selection: 1 MHz system clock.

  • TCAx > Hardware Settings:
    1. Clock Selection: System Clock/64.

    2. Timer Mode: 8-bit (Split).

    3. Requested time 1(s): Set to 0.01s (10 ms).

    4. Requested time 2(s): Set to 0.005s (5 ms).

  • TCAx > Timer Channels:
    1. Timer channels: Select two output channels to enable.

    2. Timer channels: RequestedDuty 20(%), 40(%).

  • System > Pins:
    1. Pin Grid View: TCAx WO0 (Waveform Output): Select output pin.

    2. Pin Grid View: TCAx WO1 (Waveform Output): Select output pin.

After configuring the components as described above, click 'Generate' to generate the code. Then add the following code snippets to your application:

#include "mcc_generated_files/system/system.h"
int main(void)
{
    SYSTEM_Initialize();

    while(1){}
}

4.14.4.6 Class Documentation

4.14.4.6.1 TMR_INTERFACE Struct Reference

#include <timer_interface.h>

Member Data Documentation

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

source/

timer_interface.h

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))

4.14.4.7 File Documentation

4.14.4.7.1 source/tca0_normal.c File Reference

This file contains the API implementations for TCA0 module driver in Normal (16-bit) mode.

#include "../tca0.h"

Functions

Detailed Description

This file contains the API implementations for TCA0 module driver in Normal (16-bit) mode.

TCA0 Generated Driver File

Version: TCA0 Driver Version 2.1.1

Function Documentation

ISR()[1/4]

ISR (TCA0_CMP0_vect )

ISR()[2/4]

ISR (TCA0_CMP1_vect )

ISR()[3/4]

ISR (TCA0_CMP2_vect )

ISR()[4/4]

ISR (TCA0_OVF_vect )

TCAx_DefaultCompare0CallbackRegister()

void TCAx_DefaultCompare0CallbackRegister (void )

TCAx_DefaultCompare1CallbackRegister()

void TCAx_DefaultCompare1CallbackRegister (void )

TCAx_DefaultCompare2CallbackRegister()

void TCAx_DefaultCompare2CallbackRegister (void )

TCAx_DefaultOverflowCallbackRegister()

void TCAx_DefaultOverflowCallbackRegister (void )

Variable Documentation

4.14.4.7.2 source/tca0_normal.h File Reference

#include <stdint.h>
#include <stdbool.h>
#include "../system/system.h"
#include "timer_interface.h"
#include "../system/utils/compiler.h"

Functions

Typedefs

  • typedef void(* TCAx_cb_t) (void)

    Function pointer to the callback function called by TCA when operating in Normal mode. The default value is set to NULL which means that no callback function will be used.

Detailed Description

TCA0 Generated Driver API Header File

Variable Documentation

4.14.4.7.3 source/tca0_split.c File Reference

This file contains the API implementations for TCA0 module in Split (8-bit) mode.

#include "../tca0.h"

Functions

Detailed Description

This file contains the API implementations for TCA0 module in Split (8-bit) mode.

TCA0 Generated Driver File

Version: TCA0 Driver Version 2.1.1

Function Documentation

ISR()[1/5]

ISR (TCA0_HUNF_vect )

ISR()[2/5]

ISR (TCA0_LCMP0_vect )

ISR()[3/5]

ISR (TCA0_LCMP1_vect )

ISR()[4/5]

ISR (TCA0_LCMP2_vect )

ISR()[5/5]

ISR (TCA0_LUNF_vect )

TCAx_DefaultHighCountCallbackRegister()

void TCAx_DefaultHighCountCallbackRegister (void )

TCAx_DefaultLowCompare0CallbackRegister()

void TCAx_DefaultLowCompare0CallbackRegister (void )

TCAx_DefaultLowCompare1CallbackRegister()

void TCAx_DefaultLowCompare1CallbackRegister (void )

TCAx_DefaultLowCompare2CallbackRegister()

void TCAx_DefaultLowCompare2CallbackRegister (void )

TCAx_DefaultLowCountCallbackRegister()

void TCAx_DefaultLowCountCallbackRegister (void )

Variable Documentation

TCAx_Interface

const struct TMR_INTERFACE TCAx_Interface

Initial value:

= {
    .Initialize = TCAx_Initialize,
    .Start = NULL,
    .Stop = NULL,
    .PeriodCountSet = NULL,
    .TimeoutCallbackRegister = NULL,
    .Tasks = NULL
}

4.14.4.7.4 source/tca0_split.h File Reference

#include "../system/utils/compiler.h"
#include "timer_interface.h"

Functions

Detailed Description

TCA0 Generated Driver API Header File

Typedef Documentation

TCAx_cb_t

typedef void(* TCAx_cb_t) (void)

Variable Documentation

4.14.4.7.5 source/timer_interface.h File Reference

#include <stddef.h>

4.14.4.7.6 source/timerA.dox File Reference