SimAVR
AVR Simulator
sim_interrupts.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include "sim_interrupts.h"
#include "sim_avr.h"
#include "sim_core.h"
Include dependency graph for sim_interrupts.c:

Macros

#define INT_FIFO_SIZE   (sizeof(table->pending) / sizeof(avr_int_vector_t *))
 
#define INT_FIFO_MOD(_v)   ((_v) & (INT_FIFO_SIZE - 1))
 

Functions

void avr_interrupt_init (avr_t *avr)
 Initializes the interrupt table. More...
 
void avr_interrupt_reset (avr_t *avr)
 Reset the interrupt table and the fifo. More...
 
void avr_register_vector (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. More...
 
int avr_has_pending_interrupts (avr_t *avr)
 Return non-zero if the AVR core has any pending interrupts. More...
 
int avr_is_interrupt_pending (avr_t *avr, avr_int_vector_t *vector)
 Return nonzero if a specific interrupt vector is pending. More...
 
int avr_is_interrupt_enabled (avr_t *avr, avr_int_vector_t *vector)
 
int avr_raise_interrupt (avr_t *avr, avr_int_vector_t *vector)
 Raise an interrupt (if enabled). More...
 
void avr_clear_interrupt (avr_t *avr, avr_int_vector_t *vector)
 Clear the "pending" status of an interrupt. More...
 
int avr_clear_interrupt_if (avr_t *avr, avr_int_vector_t *vector, uint8_t old)
 Clear the interrupt (inc pending) if "raised" flag is 1. More...
 
avr_irq_tavr_get_interrupt_irq (avr_t *avr, uint8_t v)
 Return the IRQ that is raised when the vector is enabled and called/cleared this allows tracing of pending interrupts. More...
 
void avr_service_interrupts (avr_t *avr)
 Called by the core at each cycle to check whether an interrupt is pending. More...
 

Macro Definition Documentation

#define INT_FIFO_MOD (   _v)    ((_v) & (INT_FIFO_SIZE - 1))
#define INT_FIFO_SIZE   (sizeof(table->pending) / sizeof(avr_int_vector_t *))

Function Documentation

int avr_is_interrupt_enabled ( avr_t avr,
avr_int_vector_t vector 
)

Here is the call graph for this function: