ATmega2560
Hardware definitions
Loading...
Searching...
No Matches
Timer.h
Go to the documentation of this file.
1
5
6#ifndef ATMEGA2560_DEFINITIONS_TIMER_H
7#define ATMEGA2560_DEFINITIONS_TIMER_H
8
9#include <stdint.h>
10#include "Config.h"
11
13namespace atmega2560
14{
16 namespace timer
17 {
19 enum class Id : uint8_t
20 {
21 Timer0 = 0,
22 Timer1 = 1,
23 Timer2 = 2,
24 Timer3 = 3,
25 Timer4 = 4,
26 Timer5 = 5,
27 };
28
40
41 enum class Timer2ClockSelection : uint8_t
42 {
43 Stopped = 0,
45 Divide8 = 2,
51 };
52
53 enum class Timer01Prescaler : uint16_t
54 {
55 Divide1 = 1,
56 Divide8 = 8,
57 Divide64 = 64,
58 Divide256 = 256,
59 Divide1024 = 1024,
60 };
61
62 enum class Timer2Prescaler : uint16_t
63 {
64 Divide1 = 1,
65 Divide8 = 8,
66 Divide32 = 32,
67 Divide64 = 64,
68 Divide128 = 128,
69 Divide256 = 256,
70 Divide1024 = 1024,
71 };
72
82
101
110
112 enum : uint8_t
113 {
119 };
121 namespace timer0
122 {
124 enum : uint8_t
125 {
129 };
130 }
131
132 namespace timer1
133 {
135 enum : uint8_t
136 {
140 };
141 }
142
143 namespace timer2
144 {
146 enum : uint8_t
147 {
151 };
152 }
153
154 namespace timer3
155 {
157 enum : uint8_t
158 {
162 };
163 }
164
165 namespace timer4
166 {
168 enum : uint8_t
169 {
173 };
174 }
175
176 namespace timer5
177 {
179 enum : uint8_t
180 {
184 };
185 }
186 }
187}
188
189#endif
Device, package and operating-grade selection.
Timer0 definitions.
Definition Timer.h:122
@ has_input_capture
has input capture.
Definition Timer.h:128
@ counter_bits
counter bits.
Definition Timer.h:126
@ compare_channel_count
compare channel count.
Definition Timer.h:127
Timer1 definitions.
Definition Timer.h:133
@ compare_channel_count
compare channel count.
Definition Timer.h:138
@ has_input_capture
has input capture.
Definition Timer.h:139
@ counter_bits
counter bits.
Definition Timer.h:137
Timer2 definitions.
Definition Timer.h:144
@ has_input_capture
has input capture.
Definition Timer.h:150
@ compare_channel_count
compare channel count.
Definition Timer.h:149
@ counter_bits
counter bits.
Definition Timer.h:148
Timer3 definitions.
Definition Timer.h:155
@ compare_channel_count
compare channel count.
Definition Timer.h:160
@ has_input_capture
has input capture.
Definition Timer.h:161
@ counter_bits
counter bits.
Definition Timer.h:159
Timer4 definitions.
Definition Timer.h:166
@ counter_bits
counter bits.
Definition Timer.h:170
@ compare_channel_count
compare channel count.
Definition Timer.h:171
@ has_input_capture
has input capture.
Definition Timer.h:172
Timer5 definitions.
Definition Timer.h:177
@ compare_channel_count
compare channel count.
Definition Timer.h:182
@ has_input_capture
has input capture.
Definition Timer.h:183
@ counter_bits
counter bits.
Definition Timer.h:181
Timer definitions.
Definition Timer.h:17
Timer16WaveformMode
16-bit waveform generator encodings.
Definition Timer.h:84
@ PhaseCorrectICRn
Phase correct ICR TOP.
Definition Timer.h:95
@ PhaseCorrectPWM10
10-bit phase correct.
Definition Timer.h:88
@ FastPWMOCRnA
Fast PWM OCRnA TOP.
Definition Timer.h:99
@ FastPWM8
8-bit fast PWM.
Definition Timer.h:90
@ PhaseFrequencyCorrectICRn
Phase-frequency correct with ICR TOP.
Definition Timer.h:93
@ FastPWM10
10-bit fast PWM.
Definition Timer.h:92
@ PhaseCorrectOCRnA
Phase correct OCRnA TOP.
Definition Timer.h:96
@ FastPWM9
9-bit fast PWM.
Definition Timer.h:91
@ PhaseCorrectPWM8
8-bit phase correct.
Definition Timer.h:86
@ CTCOCRnA
Clear on OCRnA.
Definition Timer.h:89
@ PhaseFrequencyCorrectOCRnA
Phase-frequency correct with OCRnA TOP.
Definition Timer.h:94
@ CTCICRn
CTC with ICR TOP.
Definition Timer.h:97
@ FastPWMICRn
Fast PWM ICR TOP.
Definition Timer.h:98
@ PhaseCorrectPWM9
9-bit phase correct.
Definition Timer.h:87
Timer8WaveformMode
8-bit timer waveform encodings.
Definition Timer.h:74
@ PhaseCorrectPWM
Phase-correct PWM.
Definition Timer.h:76
@ FastPWMTopOCRnA
Fast PWM with OCRnA TOP.
Definition Timer.h:80
@ FastPWM
Fast PWM.
Definition Timer.h:78
@ Normal
Counter mode.
Definition Timer.h:75
@ PhaseCorrectPWMTopOCRnA
Phase-correct PWM with OCRnA TOP.
Definition Timer.h:79
@ ClearOnCompare
CTC.
Definition Timer.h:77
Timer2Prescaler
Timer2 prescaler values.
Definition Timer.h:63
Timer2ClockSelection
Timer 2 clock selection.
Definition Timer.h:42
@ Divide128
Divide by 128.
Definition Timer.h:48
@ Divide32
Divide by 32.
Definition Timer.h:46
Timer16WaveformMode Timer5WaveformMode
Definition Timer.h:109
Timer01Prescaler
Prescaler values for synchronous timers.
Definition Timer.h:54
@ Divide1
Clock division by 1.
Definition Timer.h:55
Timer8WaveformMode Timer2WaveformMode
Timer2 waveform modes.
Definition Timer.h:104
Timer16WaveformMode Timer3WaveformMode
Definition Timer.h:107
@ output_compare_8bit_channel_count
output compare 8bit channel count.
Definition Timer.h:117
@ timer_count
timer count.
Definition Timer.h:114
@ output_compare_16bit_channel_count
output compare 16bit channel count.
Definition Timer.h:118
@ timer16_count
timer16 count.
Definition Timer.h:116
@ timer8_count
timer8 count.
Definition Timer.h:115
Timer01ClockSelection
Timer 0/1/3/4/5 clock selection.
Definition Timer.h:30
@ NoPrescaling
System clock.
Definition Timer.h:32
@ ExternalFallingEdge
External falling edge.
Definition Timer.h:37
@ Divide1024
Prescaler 1024.
Definition Timer.h:36
@ Divide64
Prescaler 64.
Definition Timer.h:34
@ Divide8
Prescaler 8.
Definition Timer.h:33
@ ExternalRisingEdge
External rising edge.
Definition Timer.h:38
@ Stopped
Timer stopped.
Definition Timer.h:31
@ Divide256
Prescaler 256.
Definition Timer.h:35
Timer16WaveformMode Timer1WaveformMode
Timer1, 3, 4 and 5 waveform modes.
Definition Timer.h:106
Timer8WaveformMode Timer0WaveformMode
Timer0 waveform modes.
Definition Timer.h:102
Timer16WaveformMode Timer4WaveformMode
Definition Timer.h:108
Id
Six hardware timer/counters.
Definition Timer.h:20
@ Timer4
Hardware timer 4.
Definition Timer.h:25
@ Timer3
Hardware timer 3.
Definition Timer.h:24
@ Timer1
Hardware timer 1.
Definition Timer.h:22
@ Timer2
Hardware timer 2.
Definition Timer.h:23
@ Timer5
Hardware timer 5.
Definition Timer.h:26
@ Timer0
Hardware timer 0.
Definition Timer.h:21
ATmega2560 hardware definitions.
Definition ADC.h:15