Defines | Functions

# timer8_drv.h File Reference

This file contains the low level functions (drivers) of 8-bit Timer(s) 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_0 0x00
#define | TIMER8_2 0x02
#define | BOTH_TIMER8 0xFF
#define | Timer8_set_pwm_a(value) ( Timer8_set_compare_a(value) )
#define | Timer8_set_pwm(value) ( Timer8_set_pwm_a(value) )
#define | Timer8_get_pwm_a() ( Timer8_get_compare_a() )
#define | Timer8_get_pwm() ( Timer8_get_pwm_a() )
#define | Timer8_off() Timer8_set_clock(TIMER8_NO_CLOCK)
| ========================================= ------ ONLY when TIMER8_2 is used ------- =========================================
#define | Timer8_2_system_clk() ( ASSR &= ~((1<<EXCLK)|(1<<AS2)) )
#define | Timer8_2_external_osc() ( ASSR = (ASSR & ~(1<<EXCLK)) | (1<<AS2) )
#define | Timer8_2_external_clk() ( ASSR |= ((1<<EXCLK)|(1<<AS2)) )
#define | Timer8_2_update_busy() ( ASSR & ( (1<<TCN2UB) | (1<<OCR2UB) | (1<<TCR2UB) ) )
#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_WGM_NORMAL (0)
#define | TIMER8_WGM_PWM_PC8 (1)
#define | TIMER8_WGM_CTC_OCR (2)
#define | TIMER8_WGM_FAST_PWM8 (3)
#define | TIMER8_WGM_RA_MASK ( (1<<WGM00) | (1<<WGM01) )
#define | TIMER8_NO_CLOCK (0)
#define | TIMER8_CLKIO_BY_1 (1)
#define | TIMER8_CLK_MASK (7<<CS00)
#define | TIMER8_0_NO_CLOCK (0)
#define | TIMER8_0_CLKIO_BY_1 (1)
#define | TIMER8_0_CLKIO_BY_8 (2)
#define | TIMER8_0_CLKIO_BY_64 (3)
#define | TIMER8_0_CLKIO_BY_256 (4)
#define | TIMER8_0_CLKIO_BY_1024 (5)
#define | TIMER8_0_EXT_CLOCK_FALLING_EDGE (6)
#define | TIMER8_0_EXT_CLOCK_RISING_EDGE (7)
#define | TIMER8_2_NO_CLOCK (0)
#define | TIMER8_2_CLKIO_BY_1 (1)
#define | TIMER8_2_CLKIO_BY_8 (2)
#define | TIMER8_2_CLKIO_BY_32 (3)
#define | TIMER8_2_CLKIO_BY_64 (4)
#define | TIMER8_2_CLKIO_BY_128 (5)
#define | TIMER8_2_CLKIO_BY_256 (6)
#define | TIMER8_2_CLKIO_BY_1024 (7)
## Functions
U8 | timer8_get_counter (void)
| This function READ the 8-bit TIMER counter.

## Detailed Description

This file contains the low level functions (drivers) of 8-bit Timer(s)

- Compiler: IAR EWAVR and GNU GCC for AVR
- Supported devices: ATmega32U4

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file timer8_drv.h.

## Define Documentation

#define TIMER8_0 0x00

Definition at line 59 of file timer8_drv.h.

#define TIMER8_2 0x02

Definition at line 62 of file timer8_drv.h.

#define BOTH_TIMER8 0xFF

Definition at line 65 of file timer8_drv.h.

#define Timer8_set_pwm_a | ( |  | value ) | ( Timer8_set_compare_a(value) )

Definition at line 71 of file timer8_drv.h.

#define Timer8_set_pwm | ( |  | value ) | ( Timer8_set_pwm_a(value) )

Definition at line 72 of file timer8_drv.h.

#define Timer8_get_pwm_a | ( | ) | ( Timer8_get_compare_a() )

Definition at line 73 of file timer8_drv.h.

#define Timer8_get_pwm | ( | ) | ( Timer8_get_pwm_a() )

Definition at line 74 of file timer8_drv.h.

#define Timer8_off | ( | ) | Timer8_set_clock(TIMER8_NO_CLOCK)

========================================= ------ ONLY when TIMER8_2 is used ------- =========================================

Definition at line 76 of file timer8_drv.h.

#define Timer8_2_system_clk | ( | ) | ( ASSR &= ~((1<<EXCLK)|(1<<AS2)) )

Definition at line 196 of file timer8_drv.h.

#define Timer8_2_external_osc | ( | ) | ( ASSR = (ASSR & ~(1<<EXCLK)) | (1<<AS2) )

Definition at line 197 of file timer8_drv.h.

#define Timer8_2_external_clk | ( | ) | ( ASSR |= ((1<<EXCLK)|(1<<AS2)) )

Definition at line 198 of file timer8_drv.h.

#define Timer8_2_update_busy | ( | ) | ( ASSR & ( (1<<TCN2UB) | (1<<OCR2UB) | (1<<TCR2UB) ) )

Definition at line 200 of file timer8_drv.h.

#define TIMER8_COMP_MODE_NORMAL (0)

Definition at line 206 of file timer8_drv.h.

#define TIMER8_COMP_MODE_TOGGLE (1)

Definition at line 207 of file timer8_drv.h.

#define TIMER8_COMP_MODE_CLEAR_OC (2)

Definition at line 208 of file timer8_drv.h.

#define TIMER8_COMP_MODE_SET_OC (3)

Definition at line 209 of file timer8_drv.h.

#define TIMER8_COMP_MODE_MASK_A (3<<COM0A0)

Definition at line 210 of file timer8_drv.h.

#define TIMER8_WGM_NORMAL (0)

Definition at line 212 of file timer8_drv.h.

#define TIMER8_WGM_PWM_PC8 (1)

Definition at line 213 of file timer8_drv.h.

#define TIMER8_WGM_CTC_OCR (2)

Definition at line 214 of file timer8_drv.h.

#define TIMER8_WGM_FAST_PWM8 (3)

Definition at line 215 of file timer8_drv.h.

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

Definition at line 216 of file timer8_drv.h.

#define TIMER8_NO_CLOCK (0)

Definition at line 218 of file timer8_drv.h.

#define TIMER8_CLKIO_BY_1 (1)

Definition at line 219 of file timer8_drv.h.

#define TIMER8_CLK_MASK (7<<CS00)

Definition at line 220 of file timer8_drv.h.

#define TIMER8_0_NO_CLOCK (0)

Definition at line 222 of file timer8_drv.h.

#define TIMER8_0_CLKIO_BY_1 (1)

Definition at line 223 of file timer8_drv.h.

#define TIMER8_0_CLKIO_BY_8 (2)

Definition at line 224 of file timer8_drv.h.

#define TIMER8_0_CLKIO_BY_64 (3)

Definition at line 225 of file timer8_drv.h.

#define TIMER8_0_CLKIO_BY_256 (4)

Definition at line 226 of file timer8_drv.h.

#define TIMER8_0_CLKIO_BY_1024 (5)

Definition at line 227 of file timer8_drv.h.

#define TIMER8_0_EXT_CLOCK_FALLING_EDGE (6)

Definition at line 228 of file timer8_drv.h.

#define TIMER8_0_EXT_CLOCK_RISING_EDGE (7)

Definition at line 229 of file timer8_drv.h.

#define TIMER8_2_NO_CLOCK (0)

Definition at line 231 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_1 (1)

Definition at line 232 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_8 (2)

Definition at line 233 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_32 (3)

Definition at line 234 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_64 (4)

Definition at line 235 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_128 (5)

Definition at line 236 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_256 (6)

Definition at line 237 of file timer8_drv.h.

#define TIMER8_2_CLKIO_BY_1024 (7)

Definition at line 238 of file timer8_drv.h.

## Function Documentation

U8 timer8_get_counter | ( | void | ) |

This function READ the 8-bit TIMER counter.

Warning:

Parameters:

Returns:
  8-bit counter value

"Call" compatible with 16-bit Timers drivers.

Warning:

Parameters:

Returns:
  8-bit counter value

Definition at line 67 of file timer8_drv.c.

    {
        U8 u8_temp;

        u8_temp = Timer8_get_counter();

        return u8_temp;
    }