SimAVR
AVR Simulator
avr_timer.h File Reference
#include "sim_avr.h"
Include dependency graph for avr_timer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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)