4.14.2 16-bit Timer/Counter1 with PWM

16-bit Timer/Counter1 with Pulse Width Modulation

4.14.2.1 Introduction

The MCC Melody 16-bit Timer/Counter1 with PWM (TC16) PLIB Driver (Peripheral Library) generates APIs to support TC16-specific peripheral functionality on AVR target MCUs.

The 16-bit Timer/Counter unit allows accurate program execution timing (event management), wave generation, and signal timing measurement.

4.14.2.2 Supported Device Families

ATmegaxxx

4.14.2.3 Required Header Files

#include "mcc_generated_files/tc16/tc1.h"

4.14.2.4 Module Documentation

4.14.2.4.1 TC1

This file contains the API prototypes for the TC1 driver.

Module description

This file contains the API prototypes for the TC1 driver.

Version: TC1 Driver Version 1.0.0
Functions

Function Documentation

TC1_Disable_CompareA_Interrupt()

void TC1_Disable_CompareA_Interrupt (void )

Disables the Compare A interrupt of the TC1 module.

Parameters:
None.
Returns:

None.

TC1_Disable_CompareB_Interrupt()

void TC1_Disable_CompareB_Interrupt (void )

Disables the Compare B interrupt of the TC1 module.

Parameters:
None.
Returns:

None.

TC1_Disable_Overflow_Interrupt()

void TC1_Disable_Overflow_Interrupt (void )

Disables the overflow interrupt of the TC1 module.

Parameters:
None.
Returns:

None.

TC1_Enable_CompareA_Interrupt()

void TC1_Enable_CompareA_Interrupt (void )

Enables the Compare A interrupt of the TC1 module.

Parameters:
None.
Returns:

None.

TC1_Enable_CompareB_Interrupt()

void TC1_Enable_CompareB_Interrupt (void )

Enables the Compare B interrupt of the TC1 module.

Parameters:
None.
Returns:

None.

TC1_Enable_Overflow_Interrupt()

void TC1_Enable_Overflow_Interrupt (void )

Enables the overflow interrupt of the TC1 module.

Parameters:
None.
Returns:

None.

TC1_Get_CompareA_InterruptFlagStatus()

bool TC1_Get_CompareA_InterruptFlagStatus (void )

Checks the Compare A flag status of the TC1 module.

Parameters:
None.
Returns:

True - The counter value matches the Output Compare A register.

False - The counter value not matches the Output Compare A register.

TC1_Get_CompareB_InterruptFlagStatus()

bool TC1_Get_CompareB_InterruptFlagStatus (void )

Checks the Compare B flag status of the TC1 module.

Parameters:
None.
Returns:

True - The counter value matches the Output Compare B register.

False - The counter value not matches the Output Compare B register.

TC1_Get_Overflow_InterruptFlagStatus()

bool TC1_Get_Overflow_InterruptFlagStatus (void )

Checks the Overflow Interrupt flag status of the TC1 module.

Parameters:
None.
Returns:

True - Overflow interrupt was detected.

False - No overflow interrupt was detected.

TC1_Initialize()

int8_t TC1_Initialize (void )

Initializes the TC1 module.

Parameters:
None.
Returns:

0 - The TC1 initialization was successful.

1 - The TC1 initialization was not successful.

TC1_ReadTimer()

uint16_t TC1_ReadTimer (void )

Reads the timer value of the TC1 module.

Parameters:
None.
Returns:

uint16_t - Timer register value.

TC1_WriteTimer()

void TC1_WriteTimer (uint16_t timerValue)

Writes the timer value of the TC1 module.

Parameters:
uint16_t

- TimerValue.

Returns:

None.

4.14.2.5 File Documentation

4.14.2.5.1 source/tc1.c File Reference

This file contains the API implementations for the TC1 module driver.

#include <avr/io.h>
#include "../tc1.h"

Functions

Detailed Description

This file contains the API implementations for the TC1 module driver.

TC1 Generated Driver File

Version: TC1 Driver Version 1.0.0

Function Documentation

ISR()[1/4]

ISR (TIMER1_COMPA_vect )

ISR()[2/4]

ISR (TIMER1_COMPB_vect )

ISR()[3/4]

ISR (TIMER1_OVF_vect )

ISR()[4/4]

ISR (TIMER1_CAPT_vect )

4.14.2.5.2 source/tc1.h File Reference

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

Functions

Detailed Description

TC1 Generated Driver API Header File