Lazuli
timer_counter_0.h
Go to the documentation of this file.
1 /*
2  * SPDX-License-Identifier: GPL-3.0-only
3  * This file is part of Lazuli.
4  */
5 
15 #ifndef LAZULI_SYS_ARCH_AVR_TIMER_COUNTER_0_H
16 #define LAZULI_SYS_ARCH_AVR_TIMER_COUNTER_0_H
17 
18 #include <stdint.h>
19 
20 #include <Lazuli/common.h>
21 
23 
24 /*
25  * Timer 0 registers definitions.
26  * Ordered by address.
27  */
28 
30 #define TIFR0 DIRECT(0x35)
31 
33 #define TCCR0A DIRECT(0x44)
34 
36 #define TCCR0B DIRECT(0x45)
37 
39 #define TCNT0 DIRECT(0x46)
40 
42 #define OCR0A DIRECT(0x47)
43 
45 #define OCR0B DIRECT(0x48)
46 
48 #define TIMSK0 DIRECT(0x6e)
49 
53 typedef struct {
54  volatile uint8_t tccr0a;
55  volatile uint8_t tccr0b;
56  volatile uint8_t tcnt0;
57  volatile uint8_t ocr0a;
58  volatile uint8_t ocr0b;
60 
64 enum {
71 };
72 
76 enum {
83 };
84 
88 enum {
91 
94 
97 };
98 
102 enum {
108 };
109 
111 
112 #endif /* LAZULI_SYS_ARCH_AVR_TIMER_COUNTER_0_H */
#define _EXTERN_C_DECL_BEGIN
Open C++ header file declarations.
Definition: common.h:37
Compare Match Output B Mode.
Compare Match Output A Mode.
volatile uint8_t ocr0b
Output Compare register B.
Waveform Generation Mode.
Waveform Generation Mode.
Waveform Generation Mode.
Clock Select.
Force Output Compare A.
Timer/Counter 0 Output Compare Match A Interrupt Enable.
#define POSITION(X)
Define a constant bit at position X, starting from index 0.
Definition: common.h:174
Timer/Counter 0 Output Compare B Match Flag.
unsigned char uint8_t
Represents a unsigned integer type with width of exactly 8 bits.
Definition: stdint.h:89
volatile uint8_t ocr0a
Output Compare register A.
Timer/Counter 0 Output Compare Match B Interrupt Enable.
volatile uint8_t tccr0b
Timer/Counter Control Register B.
volatile uint8_t tccr0a
Timer/Counter Control Register A.
Clock Select.
Basic type definitions and useful macros.
Compare Match Output A Mode.
Clock Select.
#define _EXTERN_C_DECL_END
Close C++ header file declarations.
Definition: common.h:42
Timer/Counter 0 Overflow Interrupt enable.
volatile uint8_t tcnt0
Timer/Counter Register.
Timer/Counter 0 Overflow Flag.
Timer/Counter 0 Output Compare A Match Flag.
Force Output Compare B.
Compare Match Output B Mode.
Describes the memory mapping for timer/counter 0.