95 struct avr_int_vector_t avr_int_vector_t
interrupt vector for the IO modules
struct avr_int_table_t * avr_int_table_p
void avr_register_vector(struct avr_t *avr, avr_int_vector_t *vector)
Register an interrupt vector. It's only needed if you want to use the "r_raised" flags.
Definition: sim_interrupts.c:51
avr_irq_t * avr_get_interrupt_irq(struct avr_t *avr, uint8_t v)
Return the IRQ that is raised when the vector is enabled and called/cleared this allows tracing of pe...
Definition: sim_interrupts.c:161
avr_irq_t irq
raised to 1 when queued, to zero when called
Definition: sim_interrupts.h:43
uint8_t pending_w
Definition: sim_interrupts.h:56
avr_t * avr
Definition: run_avr.c:54
Interrupt vectors, and their enable/clear registers.
Definition: sim_interrupts.h:51
int avr_clear_interrupt_if(struct avr_t *avr, avr_int_vector_t *vector, uint8_t old)
Clear the interrupt (inc pending) if "raised" flag is 1.
Definition: sim_interrupts.c:149
uint8_t trace
Definition: sim_interrupts.h:44
uint8_t pending
Definition: sim_interrupts.h:44
avr_int_vector_t * vector[64]
Definition: sim_interrupts.h:53
interrupt vector for the IO modules
Definition: sim_interrupts.h:37
avr_int_vector_t * pending[64]
needs to be >= vectors and a power of two
Definition: sim_interrupts.h:55
This 'structure' is a packed representation of an IO register 'bit' (or consecutive bits)...
Definition: sim_avr_types.h:47
void avr_interrupt_reset(struct avr_t *avr)
Reset the interrupt table and the fifo.
Definition: sim_interrupts.c:40
int avr_raise_interrupt(struct avr_t *avr, avr_int_vector_t *vector)
Raise an interrupt (if enabled).
Definition: sim_interrupts.c:89
uint8_t pending_r
fifo cursors
Definition: sim_interrupts.h:56
struct avr_int_table_t avr_int_table_t
Interrupt vectors, and their enable/clear registers.
void avr_clear_interrupt(struct avr_t *avr, avr_int_vector_t *vector)
Clear the "pending" status of an interrupt.
Definition: sim_interrupts.c:136
int avr_is_interrupt_pending(struct avr_t *avr, avr_int_vector_t *vector)
Return nonzero if a specific interrupt vector is pending.
Definition: sim_interrupts.c:77
avr_regbit_t raised
IO register index for the register where the "raised" flag is (optional)
Definition: sim_interrupts.h:41
avr_regbit_t enable
IO register index for the "interrupt enable" flag for this vector.
Definition: sim_interrupts.h:40
void avr_interrupt_init(struct avr_t *avr)
Initializes the interrupt table.
Definition: sim_interrupts.c:33
int avr_has_pending_interrupts(struct avr_t *avr)
Return non-zero if the AVR core has any pending interrupts.
Definition: sim_interrupts.c:70
void avr_service_interrupts(struct avr_t *avr)
Called by the core at each cycle to check whether an interrupt is pending.
Definition: sim_interrupts.c:175
Main AVR instance.
Definition: sim_avr.h:142
Public IRQ structure.
Definition: sim_irq.h:76
uint8_t vector_count
Definition: sim_interrupts.h:54
uint8_t raise_sticky
1 if the interrupt flag (= the raised regbit) is not cleared
Definition: sim_interrupts.h:44
uint8_t vector
vector number, zero (reset) is reserved
Definition: sim_interrupts.h:39