16
AVR1306
8045A-AVR-02/08
This allows for complex interaction between different parts of the system,
independent of any code running. The event system is covered more in-depth in the
application note AVR1001.
7.3 Timer/Counter Extension Modules
The Timer/Counter functionality can be extended through Timer/Counter extension
modules, such as the Advanced Waveform eXtension (AWeX) and High-Resolution
(Hi-Res) extension. The extension modules are not covered in this document. Please
refer to application note AVR1311 for more information.
8 Driver Implementation
The included driver has functions that control all the major features of the
Timer/Counter modules (including waveform generation). All functions take a pointer
to a Timer/Counter module as its first argument, so the same functions can be reused
for all Timer/Counter modules on one XMEGA. The driver is written in ANSI® C, and
should compile on all compilers with XMEGA support.
Note that this driver is
not
written with high performance in mind. It is designed as a
library to get started with the XMEGA Timer/Counters and an easy-to-use framework
for rapid prototyping. For time and code space critical application development,
consider replacing function calls with macros or direct access to registers.
8.1 Files
The driver package consists of the following files:
•
tc_driver.c – Timer/Counter driver source file
•
tc_driver.h – Timer/Counter driver header file
•
tc_example.c – Examples using the Timer/Counter driver.
8.2 Doxygen Documentation
All source code is prepared for automatic documentation generation using Doxygen.
Doxygen is a tool for generating documentation from source code by analyzing the
source code and using special keywords. For more details about Doxygen please visit
. Precompiled Doxygen documentation is also supplied with
the source code accompanying this application note, available from the
readme.html
file in the source code folder.