Lazuli
Data Structures | Macros | Enumerations
timer_counter_0.h File Reference

Interface for Timer/Counter 0 of the ATMega328p. More...

#include <stdint.h>
#include <Lazuli/common.h>

Go to the source code of this file.

Data Structures

struct  TimerCounter0
 Describes the memory mapping for timer/counter 0. More...
 

Macros

#define TIFR0   DIRECT(0x35)
 Timer/Counter 0 Interrupt Flag Register.
 
#define TCCR0A   DIRECT(0x44)
 Timer/Counter Control Register A.
 
#define TCCR0B   DIRECT(0x45)
 Timer/Counter Control Register B.
 
#define TCNT0   DIRECT(0x46)
 Timer/Counter Register.
 
#define OCR0A   DIRECT(0x47)
 Output Compare register A.
 
#define OCR0B   DIRECT(0x48)
 Output Compare register B.
 
#define TIMSK0   DIRECT(0x6e)
 Timer/Counter Interrupt Mask Register.
 

Enumerations

enum  {
  TCCR0A_WGM00 = POSITION(0U),
  TCCR0A_WGM01 = POSITION(1U),
  TCCR0A_COM0B0 = POSITION(4U),
  TCCR0A_COM0B1 = POSITION(5U),
  TCCR0A_COM0A0 = POSITION(6U),
  TCCR0A_COM0A1 = POSITION(7U)
}
 Content of the TCCR0A register. More...
 
enum  {
  TCCR0B_CS00 = POSITION(0U),
  TCCR0B_CS01 = POSITION(1U),
  TCCR0B_CS02 = POSITION(2U),
  TCCR0B_WGM02 = POSITION(3U),
  TCCR0B_FOC0B = POSITION(6U),
  TCCR0B_FOC0A = POSITION(7U)
}
 Content of the TCCR0B register. More...
 
enum  {
  TIMSK0_TOIE0 = POSITION(0U),
  TIMSK0_OCIE0A = POSITION(1U),
  TIMSK0_OCIE0B = POSITION(2U)
}
 Content of the TIMSK0 register. More...
 
enum  {
  TIFR0_TOV0 = POSITION(0U),
  TIFR0_OCF0A = POSITION(1U),
  TIFR0_OCF0B = POSITION(2U)
}
 Content of the TIFR0 Register. More...
 

Detailed Description

Interface for Timer/Counter 0 of the ATMega328p.

Describes the interface of the "8-bit timer/counter 0" driver for the ATMega328p.

Definition in file timer_counter_0.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Content of the TCCR0A register.

Enumerator
TCCR0A_WGM00 

Waveform Generation Mode.

TCCR0A_WGM01 

Waveform Generation Mode.

TCCR0A_COM0B0 

Compare Match Output B Mode.

TCCR0A_COM0B1 

Compare Match Output B Mode.

TCCR0A_COM0A0 

Compare Match Output A Mode.

TCCR0A_COM0A1 

Compare Match Output A Mode.

Definition at line 64 of file timer_counter_0.h.

◆ anonymous enum

anonymous enum

Content of the TCCR0B register.

Enumerator
TCCR0B_CS00 

Clock Select.

TCCR0B_CS01 

Clock Select.

TCCR0B_CS02 

Clock Select.

TCCR0B_WGM02 

Waveform Generation Mode.

TCCR0B_FOC0B 

Force Output Compare B.

TCCR0B_FOC0A 

Force Output Compare A.

Definition at line 76 of file timer_counter_0.h.

◆ anonymous enum

anonymous enum

Content of the TIMSK0 register.

Enumerator
TIMSK0_TOIE0 

Timer/Counter 0 Overflow Interrupt enable.

TIMSK0_OCIE0A 

Timer/Counter 0 Output Compare Match A Interrupt Enable.

TIMSK0_OCIE0B 

Timer/Counter 0 Output Compare Match B Interrupt Enable.

Definition at line 88 of file timer_counter_0.h.

◆ anonymous enum

anonymous enum

Content of the TIFR0 Register.

Enumerator
TIFR0_TOV0 

Timer/Counter 0 Overflow Flag.

TIFR0_OCF0A 

Timer/Counter 0 Output Compare A Match Flag.

TIFR0_OCF0B 

Timer/Counter 0 Output Compare B Match Flag.

Definition at line 102 of file timer_counter_0.h.