timer8_drv.h File Reference

,vThis file contains the prototypes and the macros of the low level functions (drivers) of: More...

#include "config.h"

Include dependency graph for timer8_drv.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define Timer8_select(timer8_num)   __no_operation()
#define Timer8_clear()   ( TCCR0A=0, TCCR0B=0, TCNT0=0, OCR0A=0, OCR0B=0)
#define Timer8_set_counter(value)   ( TCNT0 = value )
#define Timer8_get_counter()   ( TCNT0 )
#define Timer8_set_compare_a(value)   ( OCR0A = value )
#define Timer8_set_compare_b(value)   ( OCR0B = value )
#define Timer8_set_compare(value)   ( Timer8_set_compare_a(value) )
#define Timer8_get_compare_a()   ( OCR0A )
#define Timer8_get_compare_b()   ( OCR0B )
#define Timer8_get_compare()   ( Timer8_get_compare_a() )
#define Timer8_force_output_compare_a()   ( TCCR0B |= (1<FOC0A) )
#define Timer8_clear_output_compare_a()   ( TCCR0B &= ~(1<FOC0A) )
#define Timer8_force_output_compare_b()   ( TCCR0B |= (1<FOC0B) )
#define Timer8_clear_output_compare_b()   ( TCCR0B &= ~(1<FOC0B) )
#define Timer8_force_output_compare()   ( Timer8_force_output_compare_a() )
#define Timer8_clear_output_compare()   ( Timer8_clear_output_compare_a() )
#define Timer8_set_mode_output_a(conf)   ( TCCR0A = (TCCR0A & (~TIMER8_COMP_MODE_MASK_A)) | (conf << COM0A0) )
#define Timer8_set_mode_output_b(conf)   ( TCCR0A = (TCCR0A & (~TIMER8_COMP_MODE_MASK_B)) | (conf << COM0B0) )
#define Timer8_set_mode_output(conf)   ( Timer8_set_mode_output_a(conf) )
#define Timer8_get_mode_output_a()   ((TCCR0A & TIMER8_COMP_MODE_MASK_A) >> COM0A0 )
#define Timer8_get_mode_output_b()   ((TCCR0A & TIMER8_COMP_MODE_MASK_B) >> COM0B0 )
#define Timer8_get_mode_output()   ( Timer8_get_mode_output_a() )
#define Timer8_set_waveform_mode(conf)
#define Timer8_get_waveform_mode()
#define Timer8_set_clock(value)   ( TCCR0B = (TCCR0B & (~TIMER8_CLK_MASK)) | (value << CS00) )
#define Timer8_get_clock()   ( (TCCR0B & TIMER8_CLK_MASK) >> CS00 )
#define Timer8_overflow_it_enable()   ( TIMSK0 |= (1<<TOIE0) )
#define Timer8_overflow_it_disable()   ( TIMSK0 &= ~(1<<TOIE0) )
#define Timer8_compare_a_it_enable()   ( TIMSK0 |= (1<<OCIE0A) )
#define Timer8_compare_a_it_disable()   ( TIMSK0 &= ~(1<<OCIE0A) )
#define Timer8_compare_b_it_enable()   ( TIMSK0 |= (1<<OCIE0B) )
#define Timer8_compare_b_it_disable()   ( TIMSK0 &= ~(1<<OCIE0B) )
#define Timer8_compare_it_enable()   ( Timer8_compare_a_it_enable() )
#define Timer8_compare_it_disable()   ( Timer8_compare_a_it_disable() )
#define Timer8_get_overflow_it_mask()   ((TIMSK0 & (1<<TOIE0) ) >> TOIE0 )
#define Timer8_get_compare_a_it_mask()   ((TIMSK0 & (1<<OCIE0A)) >> OCIE0A )
#define Timer8_get_compare_b_it_mask()   ((TIMSK0 & (1<<OCIE0B)) >> OCIE0B )
#define Timer8_get_compare_it_mask()   ( Timer8_get_compare_a_it_mask() )
#define Timer8_clear_overflow_it()   ( TIFR0 |= (1<<TOV0) )
#define Timer8_clear_compare_a_it()   ( TIFR0 |= (1<<OCF0A) )
#define Timer8_clear_compare_b_it()   ( TIFR0 |= (1<<OCF0B) )
#define Timer8_clear_compare_it()   ( Timer8_clear_compare_a_it() )
#define Timer8_get_overflow_it()   ((TIFR0 & (1<<TOV0) ) >> TOV0 )
#define Timer8_get_compare_a_it()   ((TIFR0 & (1<<OCF0A)) >> OCF0A )
#define Timer8_get_compare_b_it()   ((TIFR0 & (1<<OCF0B)) >> OCF0B )
#define Timer8_get_compare_it()   ( Timer8_get_compare_a_it() )
#define TIMER8_COMP_MODE_NORMAL   (0)
#define TIMER8_COMP_MODE_TOGGLE   (1)
#define TIMER8_COMP_MODE_CLEAR_OC   (2)
#define TIMER8_COMP_MODE_SET_OC   (3)
#define TIMER8_COMP_MODE_MASK_A   (3<<COM0A0)
#define TIMER8_COMP_MODE_MASK_B   (3<<COM0B0)
#define TIMER8_WGM_NORMAL   (0)
#define TIMER8_WGM_PWM_PC8   (1)
#define TIMER8_WGM_CTC_OCR   (2)
#define TIMER8_WGM_FAST_PWM8   (3)
#define TIMER8_WGM_PWM_PC_OCRA   (5)
#define TIMER8_WGM_PWM_FAST_OCRA   (7)
#define TIMER8_WGM_01_MASK   ((1<<WGM00) | (1<<WGM01))
#define TIMER8_WGM_2_MASK   (1<<WGM02)
#define TIMER8_CLK_MASK   (7<<CS00)
#define TIMER8_NO_CLOCK   (0)
#define TIMER8_CLKIO_BY_1   (1)
#define TIMER8_CLKIO_BY_8   (2)
#define TIMER8_CLKIO_BY_64   (3)
#define TIMER8_CLKIO_BY_256   (4)
#define TIMER8_CLKIO_BY_1024   (5)
#define TIMER8_EXT_CLOCK_FALLING_EDGE   (6)
#define TIMER8_EXT_CLOCK_RISING_EDGE   (7)

Functions

U8 timer8_get_counter (void)
 This function READ the 8-bit TIMER counter.


Detailed Description

,vThis file contains the prototypes and the macros of the low level functions (drivers) of:

Copyright (c) 2006 Atmel.

Use of this program is subject to Atmel's End User License Agreement. Please read file license.txt for copyright notice.

This file can be parsed by Doxygen for automatic documentation generation.

Version:
1.1 at90usb162-cdc-1_0_1
Todo:
Bug:

Definition in file timer8_drv.h.


Define Documentation

#define Timer8_select ( timer8_num   )     __no_operation()

Definition at line 32 of file timer8_drv.h.

 
#define Timer8_clear (  )     ( TCCR0A=0, TCCR0B=0, TCNT0=0, OCR0A=0, OCR0B=0)

Definition at line 34 of file timer8_drv.h.

#define Timer8_set_counter ( value   )     ( TCNT0 = value )

Definition at line 36 of file timer8_drv.h.

 
#define Timer8_get_counter (  )     ( TCNT0 )

Definition at line 37 of file timer8_drv.h.

Referenced by timer8_get_counter().

#define Timer8_set_compare_a ( value   )     ( OCR0A = value )

Definition at line 39 of file timer8_drv.h.

#define Timer8_set_compare_b ( value   )     ( OCR0B = value )

Definition at line 40 of file timer8_drv.h.

#define Timer8_set_compare ( value   )     ( Timer8_set_compare_a(value) )

Definition at line 41 of file timer8_drv.h.

 
#define Timer8_get_compare_a (  )     ( OCR0A )

Definition at line 42 of file timer8_drv.h.

 
#define Timer8_get_compare_b (  )     ( OCR0B )

Definition at line 43 of file timer8_drv.h.

 
#define Timer8_get_compare (  )     ( Timer8_get_compare_a() )

Definition at line 44 of file timer8_drv.h.

 
#define Timer8_force_output_compare_a (  )     ( TCCR0B |= (1<FOC0A) )

Definition at line 46 of file timer8_drv.h.

 
#define Timer8_clear_output_compare_a (  )     ( TCCR0B &= ~(1<FOC0A) )

Definition at line 47 of file timer8_drv.h.

 
#define Timer8_force_output_compare_b (  )     ( TCCR0B |= (1<FOC0B) )

Definition at line 48 of file timer8_drv.h.

 
#define Timer8_clear_output_compare_b (  )     ( TCCR0B &= ~(1<FOC0B) )

Definition at line 49 of file timer8_drv.h.

 
#define Timer8_force_output_compare (  )     ( Timer8_force_output_compare_a() )

Definition at line 50 of file timer8_drv.h.

 
#define Timer8_clear_output_compare (  )     ( Timer8_clear_output_compare_a() )

Definition at line 51 of file timer8_drv.h.

#define Timer8_set_mode_output_a ( conf   )     ( TCCR0A = (TCCR0A & (~TIMER8_COMP_MODE_MASK_A)) | (conf << COM0A0) )

Definition at line 53 of file timer8_drv.h.

#define Timer8_set_mode_output_b ( conf   )     ( TCCR0A = (TCCR0A & (~TIMER8_COMP_MODE_MASK_B)) | (conf << COM0B0) )

Definition at line 54 of file timer8_drv.h.

#define Timer8_set_mode_output ( conf   )     ( Timer8_set_mode_output_a(conf) )

Definition at line 55 of file timer8_drv.h.

 
#define Timer8_get_mode_output_a (  )     ((TCCR0A & TIMER8_COMP_MODE_MASK_A) >> COM0A0 )

Definition at line 56 of file timer8_drv.h.

 
#define Timer8_get_mode_output_b (  )     ((TCCR0A & TIMER8_COMP_MODE_MASK_B) >> COM0B0 )

Definition at line 57 of file timer8_drv.h.

 
#define Timer8_get_mode_output (  )     ( Timer8_get_mode_output_a() )

Definition at line 58 of file timer8_drv.h.

#define Timer8_set_waveform_mode ( conf   ) 

Value:

( TCCR0A = (TCCR0A&(~TIMER8_WGM_01_MASK)) | ((conf&0x03) << WGM00), \
                                               ( TCCR0B = (TCCR0B&(~TIMER8_WGM_2_MASK)) | (((conf&0x04)>>2) << WGM02)) )

Definition at line 60 of file timer8_drv.h.

 
#define Timer8_get_waveform_mode (  ) 

Value:

( ((TCCR0A & TIMER8_WGM_01_MASK) >> WGM00) |  \
                                               ( ((TCCR0A & TIMER8_WGM_2_MASK) >> WGM02) << 0x2) )

Definition at line 62 of file timer8_drv.h.

#define Timer8_set_clock ( value   )     ( TCCR0B = (TCCR0B & (~TIMER8_CLK_MASK)) | (value << CS00) )

Definition at line 65 of file timer8_drv.h.

 
#define Timer8_get_clock (  )     ( (TCCR0B & TIMER8_CLK_MASK) >> CS00 )

Definition at line 66 of file timer8_drv.h.

 
#define Timer8_overflow_it_enable (  )     ( TIMSK0 |= (1<<TOIE0) )

Definition at line 68 of file timer8_drv.h.

 
#define Timer8_overflow_it_disable (  )     ( TIMSK0 &= ~(1<<TOIE0) )

Definition at line 69 of file timer8_drv.h.

 
#define Timer8_compare_a_it_enable (  )     ( TIMSK0 |= (1<<OCIE0A) )

Definition at line 70 of file timer8_drv.h.

 
#define Timer8_compare_a_it_disable (  )     ( TIMSK0 &= ~(1<<OCIE0A) )

Definition at line 71 of file timer8_drv.h.

 
#define Timer8_compare_b_it_enable (  )     ( TIMSK0 |= (1<<OCIE0B) )

Definition at line 72 of file timer8_drv.h.

 
#define Timer8_compare_b_it_disable (  )     ( TIMSK0 &= ~(1<<OCIE0B) )

Definition at line 73 of file timer8_drv.h.

 
#define Timer8_compare_it_enable (  )     ( Timer8_compare_a_it_enable() )

Definition at line 74 of file timer8_drv.h.

 
#define Timer8_compare_it_disable (  )     ( Timer8_compare_a_it_disable() )

Definition at line 75 of file timer8_drv.h.

 
#define Timer8_get_overflow_it_mask (  )     ((TIMSK0 & (1<<TOIE0) ) >> TOIE0 )

Definition at line 76 of file timer8_drv.h.

 
#define Timer8_get_compare_a_it_mask (  )     ((TIMSK0 & (1<<OCIE0A)) >> OCIE0A )

Definition at line 77 of file timer8_drv.h.

 
#define Timer8_get_compare_b_it_mask (  )     ((TIMSK0 & (1<<OCIE0B)) >> OCIE0B )

Definition at line 78 of file timer8_drv.h.

 
#define Timer8_get_compare_it_mask (  )     ( Timer8_get_compare_a_it_mask() )

Definition at line 79 of file timer8_drv.h.

 
#define Timer8_clear_overflow_it (  )     ( TIFR0 |= (1<<TOV0) )

Definition at line 81 of file timer8_drv.h.

 
#define Timer8_clear_compare_a_it (  )     ( TIFR0 |= (1<<OCF0A) )

Definition at line 82 of file timer8_drv.h.

 
#define Timer8_clear_compare_b_it (  )     ( TIFR0 |= (1<<OCF0B) )

Definition at line 83 of file timer8_drv.h.

 
#define Timer8_clear_compare_it (  )     ( Timer8_clear_compare_a_it() )

Definition at line 84 of file timer8_drv.h.

 
#define Timer8_get_overflow_it (  )     ((TIFR0 & (1<<TOV0) ) >> TOV0 )

Definition at line 85 of file timer8_drv.h.

 
#define Timer8_get_compare_a_it (  )     ((TIFR0 & (1<<OCF0A)) >> OCF0A )

Definition at line 86 of file timer8_drv.h.

 
#define Timer8_get_compare_b_it (  )     ((TIFR0 & (1<<OCF0B)) >> OCF0B )

Definition at line 87 of file timer8_drv.h.

 
#define Timer8_get_compare_it (  )     ( Timer8_get_compare_a_it() )

Definition at line 88 of file timer8_drv.h.

#define TIMER8_COMP_MODE_NORMAL   (0)

Definition at line 96 of file timer8_drv.h.

#define TIMER8_COMP_MODE_TOGGLE   (1)

Definition at line 97 of file timer8_drv.h.

#define TIMER8_COMP_MODE_CLEAR_OC   (2)

Definition at line 98 of file timer8_drv.h.

#define TIMER8_COMP_MODE_SET_OC   (3)

Definition at line 99 of file timer8_drv.h.

#define TIMER8_COMP_MODE_MASK_A   (3<<COM0A0)

Definition at line 100 of file timer8_drv.h.

#define TIMER8_COMP_MODE_MASK_B   (3<<COM0B0)

Definition at line 101 of file timer8_drv.h.

#define TIMER8_WGM_NORMAL   (0)

Definition at line 103 of file timer8_drv.h.

#define TIMER8_WGM_PWM_PC8   (1)

Definition at line 104 of file timer8_drv.h.

#define TIMER8_WGM_CTC_OCR   (2)

Definition at line 105 of file timer8_drv.h.

#define TIMER8_WGM_FAST_PWM8   (3)

Definition at line 106 of file timer8_drv.h.

#define TIMER8_WGM_PWM_PC_OCRA   (5)

Definition at line 107 of file timer8_drv.h.

#define TIMER8_WGM_PWM_FAST_OCRA   (7)

Definition at line 108 of file timer8_drv.h.

#define TIMER8_WGM_01_MASK   ((1<<WGM00) | (1<<WGM01))

Definition at line 109 of file timer8_drv.h.

#define TIMER8_WGM_2_MASK   (1<<WGM02)

Definition at line 110 of file timer8_drv.h.

#define TIMER8_CLK_MASK   (7<<CS00)

Definition at line 112 of file timer8_drv.h.

#define TIMER8_NO_CLOCK   (0)

Definition at line 113 of file timer8_drv.h.

#define TIMER8_CLKIO_BY_1   (1)

Definition at line 114 of file timer8_drv.h.

#define TIMER8_CLKIO_BY_8   (2)

Definition at line 115 of file timer8_drv.h.

#define TIMER8_CLKIO_BY_64   (3)

Definition at line 116 of file timer8_drv.h.

#define TIMER8_CLKIO_BY_256   (4)

Definition at line 117 of file timer8_drv.h.

#define TIMER8_CLKIO_BY_1024   (5)

Definition at line 118 of file timer8_drv.h.

#define TIMER8_EXT_CLOCK_FALLING_EDGE   (6)

Definition at line 119 of file timer8_drv.h.

#define TIMER8_EXT_CLOCK_RISING_EDGE   (7)

Definition at line 120 of file timer8_drv.h.


Function Documentation

U8 timer8_get_counter ( void   ) 

This function READ the 8-bit TIMER counter.

"Call" compatible with 16-bit Timers drivers.

Warning:
Parameters:
 
Returns:
8-bit counter value

Definition at line 43 of file timer8_drv.c.

References Timer8_get_counter.

00044 {
00045     U8 u8_temp;
00046 
00047     u8_temp = Timer8_get_counter();
00048 
00049     return u8_temp;
00050 }


Generated on Fri Jun 15 14:15:44 2007 for Atmel by  doxygen 1.5.1-p1