Struct ArchAVR_TimerConfig

Nested Relationships

Nested Types

Struct Documentation

struct ArchAVR_TimerConfig

Configuration structure for ArchAVR_Timer.

Public Types

enum COM

Definition of actions to perform on a Compare Output when a CompareMatch event occurs.

Values:

enumerator COM_NoChange

No change to the output.

enumerator COM_Toggle

Toggle the output.

enumerator COM_Clear

Clear the output (set to zero)

enumerator COM_Set

Set the output (set to one)

enumerator COM_ToggleA

Toggle the output for channel A, no change for other channels.

enum Top

Definition of the value for the TOP event

Values:

enumerator Top_OnMax

Maximum permitted value (0xFF for 8-bits counter, 0xFFFF for 16-bits counters)

enumerator Top_OnFixed

Fixed value.

enumerator Top_OnCompA

TOP == OCRA.

enumerator Top_OnIC

TOP == ICR.

enum OCR

Definition of OCR update behaviour

Values:

enumerator OCR_Unbuffered

Immediate update.

enumerator OCR_UpdateOnTop

Update on TOP event.

enumerator OCR_UpdateOnBottom

Update on BOTTOM event.

enum OVF

Definition of Overflow value

Values:

enumerator OVF_SetOnMax

OVF == MAX.

enumerator OVF_SetOnTop

OVF == TOP.

enumerator OVF_SetOnBottom

OVF == BOTTOM.

typedef std::vector<COM_config_t> COM_variant_t

Array of COM variants.

See also

com_modes

Public Members

bool is_16bits

Boolean indicating if the timer is 8-bits (false) or 16-bits (true)

std::vector<clock_config_t> clocks

List of clock source configurations.

std::vector<mode_config_t> modes

List of the timer mode configurations.

std::vector<COM_variant_t> com_modes

List of COM enum values The COM values are presented in a 2D vector, indexed by:

  • a variant index, selected by the timer mode (in mode_config_t)

  • a OC mode selected by the OC channel mode field (in OC_config_t)

std::vector<OC_config_t> oc_channels

List of Output Compare channel configurations.

regbit_t rb_clock

Regbit for the clock/prescaler configuration register.

regbit_compound_t rbc_mode

Regbit for the timer mode control register.

reg_addr_t reg_cnt

Counter register address.

reg_addr_t reg_icr

Input compare register address.

reg_addr_t reg_int_enable

Interrupt enable register address.

reg_addr_t reg_int_flag

Interrupt flag register address.

vector_config_t vect_ovf

Overflow Interrupt configuration.

vector_config_t vect_icr

Input Capture Interrupt configuration.

struct clock_config_t : public base_reg_config_t

Configuration structure for clock source/prescaler options.

Public Members

TimerCounter::TickSource source
unsigned long div
struct COM_config_t : public base_reg_config_t

Configuration structure for one COM setting.

Public Members

COM up
COM down
COM bottom
COM top
struct mode_config_t : public base_reg_config_t

Configuration structure for timer modes.

Public Members

OVF ovf

Controls when the OVerFlow interrupt flag is set.

Top top

Controls the counter value used for TOP.

unsigned int fixed_top_exp

Controls the fixed top value when top is set to Top_OnFixed. The fixed value is (2^n - 1), where n = (fixed_top_exp + 8)

OCR ocr

Controls when the OC compare values are updated from the registers.

bool double_slope

Controls the slope mode , false=single, true=double.

bool disable_foc

If true, a Forced Output Compare strobe has no effect.

unsigned int com_variant

Controls which COM config variant is used.

struct OC_config_t : public base_reg_config_t

Configuration structure for one compare channel.

Public Members

reg_addr_t reg_oc
vector_config_t vector
regbit_t rb_mode
regbit_t rb_force
struct vector_config_t

Configuration structure for one interrupt vector.

Public Members

int_vect_t num
unsigned char bit