ATmega328p
Hardware definitions
Loading...
Searching...
No Matches
Timer.h File Reference

Timer/counter modes, widths, and clock selections. More...

#include <stdint.h>
#include "Config.h"
#include "Pin.h"
Include dependency graph for Timer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  atmega328p
 Device-specific definitions for the ATmega328P.
namespace  atmega328p::timer
 Timer/counter definitions.
namespace  atmega328p::timer::timer0
 Timer0 hardware characteristics.
namespace  atmega328p::timer::timer1
 Timer1 hardware characteristics.
namespace  atmega328p::timer::timer2
 Timer2 hardware characteristics.

Enumerations

enum class  atmega328p::timer::Id : uint8_t { atmega328p::timer::Timer0 = 0 , atmega328p::timer::Timer1 = 1 , atmega328p::timer::Timer2 = 2 }
 Hardware timer identifiers. More...
enum class  atmega328p::timer::Timer01ClockSelection : uint8_t {
  atmega328p::timer::Stopped = 0 , atmega328p::timer::NoPrescaling = 1 , atmega328p::timer::Divide8 = 2 , atmega328p::timer::Divide64 = 3 ,
  atmega328p::timer::Divide256 = 4 , atmega328p::timer::Divide1024 = 5 , atmega328p::timer::ExternalFallingEdge = 6 , atmega328p::timer::ExternalRisingEdge = 7
}
 Timer0/Timer1 clock-select encodings. More...
enum class  atmega328p::timer::Timer01Prescaler : uint16_t {
  atmega328p::timer::Divide1 = 1 , atmega328p::timer::Divide8 = 8 , atmega328p::timer::Divide64 = 64 , atmega328p::timer::Divide256 = 256 ,
  atmega328p::timer::Divide1024 = 1024
}
 Timer0 and Timer1 prescaler values. More...
enum class  atmega328p::timer::Timer2Prescaler : uint16_t {
  atmega328p::timer::Divide1 = 1 , atmega328p::timer::Divide8 = 8 , atmega328p::timer::Divide32 = 32 , atmega328p::timer::Divide64 = 64 ,
  atmega328p::timer::Divide128 = 128 , atmega328p::timer::Divide256 = 256 , atmega328p::timer::Divide1024 = 1024
}
 Timer2 prescaler selections. More...
enum class  atmega328p::timer::Timer2ClockSelection : uint8_t {
  atmega328p::timer::Stopped = 0 , atmega328p::timer::NoPrescaling = 1 , atmega328p::timer::Divide8 = 2 , atmega328p::timer::Divide32 = 3 ,
  atmega328p::timer::Divide64 = 4 , atmega328p::timer::Divide128 = 5 , atmega328p::timer::Divide256 = 6 , atmega328p::timer::Divide1024 = 7
}
 Timer2 clock source and prescaler selections. More...
enum class  atmega328p::timer::Timer0WaveformMode : uint8_t {
  atmega328p::timer::Normal = 0 , atmega328p::timer::PhaseCorrectPWM = 1 , atmega328p::timer::ClearOnCompare = 2 , atmega328p::timer::FastPWM = 3 ,
  atmega328p::timer::Reserved4 = 4 , atmega328p::timer::PhaseCorrectPWMTopOCR0A = 5 , atmega328p::timer::Reserved6 = 6 , atmega328p::timer::FastPWMTopOCR0A = 7
}
 Timer0 waveform modes. More...
enum class  atmega328p::timer::Timer2WaveformMode : uint8_t {
  atmega328p::timer::Normal = 0 , atmega328p::timer::PhaseCorrectPWM = 1 , atmega328p::timer::ClearOnCompare = 2 , atmega328p::timer::FastPWM = 3 ,
  atmega328p::timer::Reserved4 = 4 , atmega328p::timer::PhaseCorrectPWMTopOCR2A = 5 , atmega328p::timer::Reserved6 = 6 , atmega328p::timer::FastPWMTopOCR2A = 7
}
 Timer2 waveform modes. More...
enum class  atmega328p::timer::Timer1WaveformMode : uint8_t {
  atmega328p::timer::Normal = 0 , atmega328p::timer::PhaseCorrectPWM8Bit = 1 , atmega328p::timer::PhaseCorrectPWM9Bit = 2 , atmega328p::timer::PhaseCorrectPWM10Bit = 3 ,
  atmega328p::timer::ClearOnCompareOCR1A = 4 , atmega328p::timer::FastPWM8Bit = 5 , atmega328p::timer::FastPWM9Bit = 6 , atmega328p::timer::FastPWM10Bit = 7 ,
  atmega328p::timer::PhaseAndFrequencyCorrectPWMWithICR1 = 8 , atmega328p::timer::PhaseAndFrequencyCorrectPWMWithOCR1A = 9 , atmega328p::timer::PhaseCorrectPWMWithICR1 = 10 , atmega328p::timer::PhaseCorrectPWMWithOCR1A = 11 ,
  atmega328p::timer::ClearOnCompareICR1 = 12 , atmega328p::timer::Reserved13 = 13 , atmega328p::timer::FastPWMWithICR1 = 14 , atmega328p::timer::FastPWMWithOCR1A = 15
}
 Timer1 waveform modes. More...
enum  : uint8_t {
  atmega328p::timer::timer0::counter_bits = 8 , atmega328p::timer::timer0::compare_channel_count = 2 , atmega328p::timer::timer0::has_input_capture = 0 , atmega328p::timer::timer0::supports_async_clock = 0 ,
  atmega328p::timer::timer0::shares_prescaler_with_timer1 = 1
}
enum  : uint8_t {
  atmega328p::timer::timer1::counter_bits = 16 , atmega328p::timer::timer1::compare_channel_count = 2 , atmega328p::timer::timer1::has_input_capture = 1 , atmega328p::timer::timer1::supports_async_clock = 0 ,
  atmega328p::timer::timer1::shares_prescaler_with_timer0 = 1 , atmega328p::timer::timer1::has_input_capture_noise_canceler = 1 , atmega328p::timer::timer1::has_selectable_capture_edge = 1
}
enum  : uint8_t {
  atmega328p::timer::timer2::counter_bits = 8 , atmega328p::timer::timer2::compare_channel_count = 2 , atmega328p::timer::timer2::has_input_capture = 0 , atmega328p::timer::timer2::supports_async_clock = 1 ,
  atmega328p::timer::timer2::async_requires_internal_rc_clock = 1 , atmega328p::timer::timer2::async_requires_cpu_clock_above_4x_tosc = 1 , atmega328p::timer::timer2::supports_external_clock_on_tosc1 = 1
}
enum  : uint8_t {
  atmega328p::timer::timer_count = 3U , atmega328p::timer::timer0_counter_bits = 8U , atmega328p::timer::timer1_counter_bits = 16U , atmega328p::timer::timer2_counter_bits = 8U ,
  atmega328p::timer::timer0_compare_channel_count = 2U , atmega328p::timer::timer1_compare_channel_count = 2U , atmega328p::timer::timer2_compare_channel_count = 2U
}
enum  : uint16_t { atmega328p::timer::timer01_prescaler_count = 5 , atmega328p::timer::timer2_prescaler_count = 7 }
enum class  atmega328p::timer::PinSignal : uint8_t { atmega328p::timer::Timer0ExternalClock = 0x24 , atmega328p::timer::Timer1ExternalClock = 0x25 , atmega328p::timer::Timer1InputCapture = 0x00 }
 Timer input pin identifiers. More...

Detailed Description

Timer/counter modes, widths, and clock selections.