SimAVR
AVR Simulator
Timer

Data Structures

struct  avr_timer_wgm_t
 
struct  avr_timer_comp_t
 
struct  avr_timer_t
 

Macros

#define AVR_IOCTL_TIMER_GETIRQ(_name)   AVR_IOCTL_DEF('t','m','r',(_name))
 Get the internal IRQ corresponding to the INT. More...
 
#define AVR_TIMER_WGM_NORMAL8()   { .kind = avr_timer_wgm_normal, .size=8 }
 
#define AVR_TIMER_WGM_NORMAL16()   { .kind = avr_timer_wgm_normal, .size=16 }
 
#define AVR_TIMER_WGM_CTC()   { .kind = avr_timer_wgm_ctc, .top = avr_timer_wgm_reg_ocra }
 
#define AVR_TIMER_WGM_ICCTC()   { .kind = avr_timer_wgm_ctc, .top = avr_timer_wgm_reg_icr }
 
#define AVR_TIMER_WGM_FASTPWM8()   { .kind = avr_timer_wgm_fast_pwm, .size=8 }
 
#define AVR_TIMER_WGM_FASTPWM9()   { .kind = avr_timer_wgm_fast_pwm, .size=9 }
 
#define AVR_TIMER_WGM_FASTPWM10()   { .kind = avr_timer_wgm_fast_pwm, .size=10 }
 
#define AVR_TIMER_WGM_FCPWM8()   { .kind = avr_timer_wgm_fc_pwm, .size=8 }
 
#define AVR_TIMER_WGM_FCPWM9()   { .kind = avr_timer_wgm_fc_pwm, .size=9 }
 
#define AVR_TIMER_WGM_FCPWM10()   { .kind = avr_timer_wgm_fc_pwm, .size=10 }
 
#define AVR_TIMER_WGM_OCPWM()   { .kind = avr_timer_wgm_pwm, .top = avr_timer_wgm_reg_ocra }
 
#define AVR_TIMER_WGM_ICPWM()   { .kind = avr_timer_wgm_pwm, .top = avr_timer_wgm_reg_icr }
 

Typedefs

typedef struct avr_timer_wgm_t avr_timer_wgm_t
 
typedef struct avr_timer_comp_t avr_timer_comp_t
 
typedef struct avr_timer_comp_tavr_timer_comp_p
 
typedef struct avr_timer_t avr_timer_t
 

Enumerations

enum  { AVR_TIMER_COMPA = 0, AVR_TIMER_COMPB, AVR_TIMER_COMPC, AVR_TIMER_COMP_COUNT }
 
enum  { TIMER_IRQ_OUT_PWM0 = 0, TIMER_IRQ_OUT_PWM1, TIMER_IRQ_OUT_COMP, TIMER_IRQ_COUNT = TIMER_IRQ_OUT_COMP + AVR_TIMER_COMP_COUNT }
 
enum  {
  avr_timer_wgm_none = 0, avr_timer_wgm_normal, avr_timer_wgm_ctc, avr_timer_wgm_pwm,
  avr_timer_wgm_fast_pwm, avr_timer_wgm_fc_pwm
}
 Waveform generation modes. More...
 
enum  { avr_timer_com_normal = 0, avr_timer_com_toggle, avr_timer_com_clear, avr_timer_com_set }
 Compare output modes. More...
 
enum  { avr_timer_wgm_reg_constant = 0, avr_timer_wgm_reg_ocra, avr_timer_wgm_reg_icr }
 

Functions

void avr_timer_init (avr_t *avr, avr_timer_t *port)
 

Detailed Description

Macro Definition Documentation

#define AVR_IOCTL_TIMER_GETIRQ (   _name)    AVR_IOCTL_DEF('t','m','r',(_name))

Get the internal IRQ corresponding to the INT.

#define AVR_TIMER_WGM_CTC ( )    { .kind = avr_timer_wgm_ctc, .top = avr_timer_wgm_reg_ocra }
#define AVR_TIMER_WGM_FASTPWM10 ( )    { .kind = avr_timer_wgm_fast_pwm, .size=10 }
#define AVR_TIMER_WGM_FASTPWM8 ( )    { .kind = avr_timer_wgm_fast_pwm, .size=8 }
#define AVR_TIMER_WGM_FASTPWM9 ( )    { .kind = avr_timer_wgm_fast_pwm, .size=9 }
#define AVR_TIMER_WGM_FCPWM10 ( )    { .kind = avr_timer_wgm_fc_pwm, .size=10 }
#define AVR_TIMER_WGM_FCPWM8 ( )    { .kind = avr_timer_wgm_fc_pwm, .size=8 }
#define AVR_TIMER_WGM_FCPWM9 ( )    { .kind = avr_timer_wgm_fc_pwm, .size=9 }
#define AVR_TIMER_WGM_ICCTC ( )    { .kind = avr_timer_wgm_ctc, .top = avr_timer_wgm_reg_icr }
#define AVR_TIMER_WGM_ICPWM ( )    { .kind = avr_timer_wgm_pwm, .top = avr_timer_wgm_reg_icr }
#define AVR_TIMER_WGM_NORMAL16 ( )    { .kind = avr_timer_wgm_normal, .size=16 }
#define AVR_TIMER_WGM_NORMAL8 ( )    { .kind = avr_timer_wgm_normal, .size=8 }
#define AVR_TIMER_WGM_OCPWM ( )    { .kind = avr_timer_wgm_pwm, .top = avr_timer_wgm_reg_ocra }

Typedef Documentation

typedef struct avr_timer_t avr_timer_t

Enumeration Type Documentation

anonymous enum
Enumerator
AVR_TIMER_COMPA 
AVR_TIMER_COMPB 
AVR_TIMER_COMPC 
AVR_TIMER_COMP_COUNT 
anonymous enum
Enumerator
TIMER_IRQ_OUT_PWM0 
TIMER_IRQ_OUT_PWM1 
TIMER_IRQ_OUT_COMP 

comparator pins output IRQ

TIMER_IRQ_COUNT 
anonymous enum

Waveform generation modes.

Enumerator
avr_timer_wgm_none 
avr_timer_wgm_normal 
avr_timer_wgm_ctc 
avr_timer_wgm_pwm 
avr_timer_wgm_fast_pwm 
avr_timer_wgm_fc_pwm 
anonymous enum

Compare output modes.

Enumerator
avr_timer_com_normal 

Normal mode, OCnx disconnected.

avr_timer_com_toggle 

Toggle OCnx on compare match.

avr_timer_com_clear 

clear OCnx on compare match

avr_timer_com_set 

set OCnx on compare match

anonymous enum
Enumerator
avr_timer_wgm_reg_constant 
avr_timer_wgm_reg_ocra 
avr_timer_wgm_reg_icr 

Function Documentation

void avr_timer_init ( avr_t avr,
avr_timer_t port 
)

Here is the call graph for this function:

Here is the caller graph for this function: