SimAVR
AVR Simulator
Extern Interrupt

Data Structures

struct  avr_extint_t
 This module is just a "relay" for the pin change IRQ in the IO port module. More...
 

Macros

#define AVR_IOCTL_EXTINT_GETIRQ()   AVR_IOCTL_DEF('i','n','t',' ')
 Get the internal IRQ corresponding to the INT. More...
 
#define AVR_EXTINT_DECLARE(_index, _portname, _portpin)
 Declares a typical INT into a avr_extint_t in a core. More...
 
#define AVR_ASYNC_EXTINT_DECLARE(_index, _portname, _portpin)
 Asynchronous External Interrupt, for example INT2 on the m16 and m32 Uses only 1 interrupt sense control bit. More...
 
#define AVR_EXTINT_MEGA_DECLARE(_index, _portname, _portpin, _EICR)
 
#define AVR_EXTINT_TINY_DECLARE(_index, _portname, _portpin, _IFR)
 

Typedefs

typedef struct avr_extint_t avr_extint_t
 This module is just a "relay" for the pin change IRQ in the IO port module. More...
 

Enumerations

enum  {
  EXTINT_IRQ_OUT_INT0 = 0, EXTINT_IRQ_OUT_INT1, EXTINT_IRQ_OUT_INT2, EXTINT_IRQ_OUT_INT3,
  EXTINT_IRQ_OUT_INT4, EXTINT_IRQ_OUT_INT5, EXTINT_IRQ_OUT_INT6, EXTINT_IRQ_OUT_INT7,
  EXTINT_COUNT
}
 

Functions

void avr_extint_init (avr_t *avr, avr_extint_t *p)
 

Detailed Description

Macro Definition Documentation

#define AVR_ASYNC_EXTINT_DECLARE (   _index,
  _portname,
  _portpin 
)
Value:
.eint[_index] = { \
.port_ioctl = AVR_IOCTL_IOPORT_GETIRQ(_portname), \
.port_pin = _portpin, \
.isc = { AVR_IO_REGBIT(MCUCSR, ISC##_index) }, \
.vector = { \
.enable = AVR_IO_REGBIT(GICR, INT##_index), \
.raised = AVR_IO_REGBIT(GIFR, INTF##_index), \
.vector = INT##_index##_vect, \
}, \
}
#define AVR_IOCTL_IOPORT_GETIRQ(_name)
add port name (uppercase) to get the real IRQ
Definition: avr_ioport.h:49
#define AVR_IO_REGBIT(_io, _bit)
Definition: sim_regbit.h:150

Asynchronous External Interrupt, for example INT2 on the m16 and m32 Uses only 1 interrupt sense control bit.

#define AVR_EXTINT_DECLARE (   _index,
  _portname,
  _portpin 
)
Value:
.eint[_index] = { \
.port_ioctl = AVR_IOCTL_IOPORT_GETIRQ(_portname), \
.port_pin = _portpin, \
.isc = { AVR_IO_REGBIT(EICRA, ISC##_index##0), AVR_IO_REGBIT(EICRA, ISC##_index##1) }, \
.vector = { \
.enable = AVR_IO_REGBIT(EIMSK, INT##_index), \
.raised = AVR_IO_REGBIT(EIFR, INTF##_index), \
.vector = INT##_index##_vect, \
}, \
}
#define AVR_IOCTL_IOPORT_GETIRQ(_name)
add port name (uppercase) to get the real IRQ
Definition: avr_ioport.h:49
#define AVR_IO_REGBIT(_io, _bit)
Definition: sim_regbit.h:150

Declares a typical INT into a avr_extint_t in a core.

this is a shortcut since INT declarations are pretty standard. The Tinies as well as the atmega1280 are slightly different. See sim_tinyx5.h and sim_mega1280.h

#define AVR_EXTINT_MEGA_DECLARE (   _index,
  _portname,
  _portpin,
  _EICR 
)
Value:
.eint[_index] = { \
.port_ioctl = AVR_IOCTL_IOPORT_GETIRQ(_portname), \
.port_pin = _portpin, \
.isc = { AVR_IO_REGBIT(EICR##_EICR, ISC##_index##0), AVR_IO_REGBIT(EICR##_EICR, ISC##_index##1) }, \
.vector = { \
.enable = AVR_IO_REGBIT(EIMSK, INT##_index), \
.raised = AVR_IO_REGBIT(EIFR, INTF##_index), \
.vector = INT##_index##_vect, \
}, \
}
#define AVR_IOCTL_IOPORT_GETIRQ(_name)
add port name (uppercase) to get the real IRQ
Definition: avr_ioport.h:49
#define AVR_IO_REGBIT(_io, _bit)
Definition: sim_regbit.h:150
#define AVR_EXTINT_TINY_DECLARE (   _index,
  _portname,
  _portpin,
  _IFR 
)
Value:
.eint[_index] = { \
.port_ioctl = AVR_IOCTL_IOPORT_GETIRQ(_portname), \
.port_pin = _portpin, \
.isc = { AVR_IO_REGBIT(MCUCR, ISC##_index##0), AVR_IO_REGBIT(MCUCR, ISC##_index##1) }, \
.vector = { \
.enable = AVR_IO_REGBIT(GIMSK, INT##_index), \
.raised = AVR_IO_REGBIT(_IFR, INTF##_index), \
.vector = INT##_index##_vect, \
}, \
}
#define AVR_IOCTL_IOPORT_GETIRQ(_name)
add port name (uppercase) to get the real IRQ
Definition: avr_ioport.h:49
#define AVR_IO_REGBIT(_io, _bit)
Definition: sim_regbit.h:150
#define AVR_IOCTL_EXTINT_GETIRQ ( )    AVR_IOCTL_DEF('i','n','t',' ')

Get the internal IRQ corresponding to the INT.

Typedef Documentation

typedef struct avr_extint_t avr_extint_t

This module is just a "relay" for the pin change IRQ in the IO port module.

We hook up to their IRQ and raise out interrupt vectors as needed

"isc" is handled, apart from the "level" mode that doesn't make sense here (?)

Enumeration Type Documentation

anonymous enum
Enumerator
EXTINT_IRQ_OUT_INT0 
EXTINT_IRQ_OUT_INT1 
EXTINT_IRQ_OUT_INT2 
EXTINT_IRQ_OUT_INT3 
EXTINT_IRQ_OUT_INT4 
EXTINT_IRQ_OUT_INT5 
EXTINT_IRQ_OUT_INT6 
EXTINT_IRQ_OUT_INT7 
EXTINT_COUNT 

Function Documentation

void avr_extint_init ( avr_t avr,
avr_extint_t p 
)

Here is the call graph for this function:

Here is the caller graph for this function: