4.14.1 8-bit Timer/Counter0 with PWM
8-bit Timer/Counter0 with Pulse Width Modulation
4.14.1.1 Introduction
The Timer/Counter0 is a general purpose 8-bit Timer/Counter module, with two independent output compare units, and with PWM support. It allows accurate program execution timing (event management) and wave generation.
4.14.1.2 Supported Device Families
ATmegaxxx |
4.14.1.3 Required Header Files
#include "mcc_generated_files/timer/tc0.h"
4.14.1.4 Module Documentation
4.14.1.4.1 TC0
This file contains the API prototypes for the TC0 driver.
Module description
This file contains the API prototypes for the TC0 driver.
Functions
int8_t TC0_Initialize (void)
Initializes the TC0 module.
bool TC0_Get_Overflow_InterruptFlagStatus (void)
Checks the Overflow Interrupt flag status of the TC0 module.
bool TC0_Get_CompareA_InterruptFlagStatus (void)
Checks the Compare A flag status of the TC0 module.
bool TC0_Get_CompareB_InterruptFlagStatus (void)
Checks the Compare B flag status of the TC0 module.
void TC0_Enable_Overflow_Interrupt (void)
Enables the Overflow interrupt of the TC0 module.
void TC0_Disable_Overflow_Interrupt (void)
Disables the Overflow interrupt of the TC0 module.
void TC0_Enable_CompareA_Interrupt (void)
Enables the Compare A interrupt of the TC0 module.
void TC0_Disable_CompareA_Interrupt (void)
Disables the Compare A interrupt of the TC0 module.
void TC0_Enable_CompareB_Interrupt (void)
Enables the Compare B interrupt of the TC0 module.
void TC0_Disable_CompareB_Interrupt (void)
Disables the Compare B interrupt of the TC0 module.
void TC0_WriteTimer (uint8_t timerValue)
Writes the timer value of the TC0 module.
uint8_t TC0_ReadTimer (void)
Reads the timer value of the TC0 module.
Function Documentation
TC0_Disable_CompareA_Interrupt()
void TC0_Disable_CompareA_Interrupt (void )
Disables the Compare A interrupt of the TC0 module.
|
None. |
TC0_Disable_CompareB_Interrupt()
void TC0_Disable_CompareB_Interrupt (void )
Disables the Compare B interrupt of the TC0 module.
|
None. |
TC0_Disable_Overflow_Interrupt()
void TC0_Disable_Overflow_Interrupt (void )
Disables the Overflow interrupt of the TC0 module.
|
None. |
TC0_Enable_CompareA_Interrupt()
void TC0_Enable_CompareA_Interrupt (void )
Enables the Compare A interrupt of the TC0 module.
|
None. |
TC0_Enable_CompareB_Interrupt()
void TC0_Enable_CompareB_Interrupt (void )
Enables the Compare B interrupt of the TC0 module.
|
None. |
TC0_Enable_Overflow_Interrupt()
void TC0_Enable_Overflow_Interrupt (void )
Enables the Overflow interrupt of the TC0 module.
|
None. |
TC0_Get_CompareA_InterruptFlagStatus()
bool TC0_Get_CompareA_InterruptFlagStatus (void )
Checks the Compare A flag status of the TC0 module.
|
True - The counter value matches the Output Compare Register A. False - The counter value does not match the Output Compare Register A. |
TC0_Get_CompareB_InterruptFlagStatus()
bool TC0_Get_CompareB_InterruptFlagStatus (void )
Checks the Compare B flag status of the TC0 module.
|
True - The counter value matches the Output Compare Register B. False - The counter value does not match the Output Compare Register B. |
TC0_Get_Overflow_InterruptFlagStatus()
bool TC0_Get_Overflow_InterruptFlagStatus (void )
Checks the Overflow Interrupt flag status of the TC0 module.
|
True - Timer Overflow is detected. False - Timer Overflow is not detected. |
TC0_Initialize()
int8_t TC0_Initialize (void )
Initializes the TC0 module.
|
0 - The TC0 initialization was successful. 1 - The TC0 initialization was not successful. |
TC0_ReadTimer()
uint8_t TC0_ReadTimer (void )
Reads the timer value of the TC0 module.
|
uint8_t - Timer register value |
TC0_WriteTimer()
void TC0_WriteTimer (uint8_t timerValue)
Writes the timer value of the TC0 module.
|
None. |
4.14.1.5 File Documentation
4.14.1.5.1 source/tc0.c File Reference
This file contains the API implementations for the TC0 module driver.
#include <avr/io.h> #include "../tc0.h"
Functions
int8_t TC0_Initialize (void)
Initializes the TC0 module.
bool TC0_Get_Overflow_InterruptFlagStatus (void)
Checks the Overflow Interrupt flag status of the TC0 module.
bool TC0_Get_CompareA_InterruptFlagStatus (void)
Checks the Compare A flag status of the TC0 module.
bool TC0_Get_CompareB_InterruptFlagStatus (void)
Checks the Compare B flag status of the TC0 module.
void TC0_Enable_Overflow_Interrupt (void)
Enables the Overflow interrupt of the TC0 module.
void TC0_Disable_Overflow_Interrupt (void)
Disables the Overflow interrupt of the TC0 module.
void TC0_Enable_CompareA_Interrupt (void)
Enables the Compare A interrupt of the TC0 module.
void TC0_Disable_CompareA_Interrupt (void)
Disables the Compare A interrupt of the TC0 module.
void TC0_Enable_CompareB_Interrupt (void)
Enables the Compare B interrupt of the TC0 module.
void TC0_Disable_CompareB_Interrupt (void)
Disables the Compare B interrupt of the TC0 module.
void TC0_WriteTimer (uint8_t timerValue)
Writes the timer value of the TC0 module.
uint8_t TC0_ReadTimer (void)
Reads the timer value of the TC0 module.
Detailed Description
This file contains the API implementations for the TC0 module driver.
TC0 Generated Driver File
4.14.1.5.2 source/tc0.h File Reference
#include "../system/utils/compiler.h" #include <stdint.h> #include <stdbool.h>
Functions
int8_t TC0_Initialize (void)
Initializes the TC0 module.
bool TC0_Get_Overflow_InterruptFlagStatus (void)
Checks the Overflow Interrupt flag status of the TC0 module.
bool TC0_Get_CompareA_InterruptFlagStatus (void)
Checks the Compare A flag status of the TC0 module.
bool TC0_Get_CompareB_InterruptFlagStatus (void)
Checks the Compare B flag status of the TC0 module.
void TC0_Enable_Overflow_Interrupt (void)
Enables the Overflow interrupt of the TC0 module.
void TC0_Disable_Overflow_Interrupt (void)
Disables the Overflow interrupt of the TC0 module.
void TC0_Enable_CompareA_Interrupt (void)
Enables the Compare A interrupt of the TC0 module.
void TC0_Disable_CompareA_Interrupt (void)
Disables the Compare A interrupt of the TC0 module.
void TC0_Enable_CompareB_Interrupt (void)
Enables the Compare B interrupt of the TC0 module.
void TC0_Disable_CompareB_Interrupt (void)
Disables the Compare B interrupt of the TC0 module.
void TC0_WriteTimer (uint8_t timerValue)
Writes the timer value of the TC0 module.
uint8_t TC0_ReadTimer (void)
Reads the timer value of the TC0 module.
Detailed Description
TC0 Generated Driver API Header File