timer_avr.h File Reference

Low-level timer module for AVR (interface). More...

#include <appconfig.h>
#include <cfg/compiler.h>
#include <cfg/macros.h>
#include <hw_cpu.h>

Go to the source code of this file.


Defines

#define TIMER_HW_HPTICKS_PER_SEC   DIV_ROUND(CLOCK_FREQ, TIMER_PRESCALER)
 Frequency of the hardware high precision timer.
#define OCR_DIVISOR   (DIV_ROUND(DIV_ROUND(CLOCK_FREQ, TIMER_PRESCALER), TIMER_TICKS_PER_SEC) - 1)
 System timer: additional division after the prescaler 12288000 / 64 / 192 (0.
#define timer_hw_irq()   do {} while (0)
 Not needed, IRQ timer flag cleared automatically.
#define timer_hw_triggered()   (true)
 Not needed, timer IRQ handler called only for timer source.
Values for CONFIG_TIMER.
Select which hardware timer interrupt to use for system clock and softtimers.

Note:
The timer 1 overflow mode set the timer as a 24 kHz PWM.


#define TIMER_ON_OUTPUT_COMPARE0   1
#define TIMER_ON_OVERFLOW1   2
#define TIMER_ON_OUTPUT_COMPARE2   3
#define TIMER_ON_OVERFLOW3   4
#define TIMER_DEFAULT   TIMER_ON_OUTPUT_COMPARE0
 Default system timer.

Detailed Description

Low-level timer module for AVR (interface).

Version:
Id
timer_avr.h 932 2007-10-23 15:57:59Z batt

Author:
Bernardo Innocenti <bernie@develer.com>

Francesco Sacchi <batt@develer.com>

Definition in file timer_avr.h.


Define Documentation

#define OCR_DIVISOR   (DIV_ROUND(DIV_ROUND(CLOCK_FREQ, TIMER_PRESCALER), TIMER_TICKS_PER_SEC) - 1)

System timer: additional division after the prescaler 12288000 / 64 / 192 (0.

.191) = 1 ms

Definition at line 177 of file timer_avr.h.

#define TIMER_HW_HPTICKS_PER_SEC   DIV_ROUND(CLOCK_FREQ, TIMER_PRESCALER)

Frequency of the hardware high precision timer.

Definition at line 171 of file timer_avr.h.