107 struct avr_io_t * next
Definition: sim_io.h:44
void avr_register_io(avr_t *avr, avr_io_t *io)
Registers an IO module, so it's run(), reset() etc are called.
Definition: sim_io.c:44
int avr_ioctl(avr_t *avr, uint32_t ctl, void *io_param)
Call every IO modules until one responds to this.
Definition: sim_io.c:30
avr_t * avr
avr we are attached to
Definition: sim_io.h:45
avr_irq_t * avr_iomem_getirq(avr_t *avr, avr_io_addr_t addr, const char *name, int index)
Get the IRQ for an absolute IO address.
Definition: sim_io.c:153
uint16_t avr_io_addr_t
Definition: sim_avr_types.h:37
void avr_register_io_write(avr_t *avr, avr_io_addr_t addr, avr_io_write_t write, void *param)
Register a callback for when the IO register is written. callback has to set the memory itself...
Definition: sim_io.c:83
uint32_t irq_ioctl_get
used to get irqs from this module
Definition: sim_io.h:50
int(* ioctl)(struct avr_io_t *io, uint32_t ctl, void *io_param)
Called externally. allow access to io modules and so on.
Definition: sim_io.h:57
avr_t * avr
Definition: run_avr.c:54
void(* dealloc)(struct avr_io_t *io)
Optional, a function to free up allocated system resources.
Definition: sim_io.h:59
const char * kind
pretty name, for debug
Definition: sim_io.h:46
void(* avr_io_write_t)(struct avr_t *avr, avr_io_addr_t addr, uint8_t v, void *param)
Definition: sim_avr.h:63
int irq_count
number of (optional) irqs
Definition: sim_io.h:51
struct avr_io_t avr_io_t
IO module base struct Modules uses that as their first member in their own struct.
struct avr_irq_t * irq
optional external IRQs
Definition: sim_io.h:52
const char * name
Definition: sim_irq.h:79
uint8_t(* avr_io_read_t)(struct avr_t *avr, avr_io_addr_t addr, void *param)
Definition: sim_avr.h:62
void avr_register_io_read(avr_t *avr, avr_io_addr_t addr, avr_io_read_t read, void *param)
Register a callback for when IO register "addr" is read.
Definition: sim_io.c:52
avr_irq_t * avr_io_setirqs(avr_io_t *io, uint32_t ctl, int count, avr_irq_t *irqs)
Sets an IO module "official" IRQs and the ioctl used to get to them.
Definition: sim_io.c:194
void(* reset)(struct avr_io_t *io)
Called at reset time.
Definition: sim_io.h:55
const char ** irq_names
IRQ names.
Definition: sim_io.h:48
Main AVR instance.
Definition: sim_avr.h:142
IO module base struct Modules uses that as their first member in their own struct.
Definition: sim_io.h:42
struct avr_irq_t * avr_io_getirq(avr_t *avr, uint32_t ctl, int index)
Get the specific irq for a module, check AVR_IOCTL_IOPORT_GETIRQ for example.
Definition: sim_io.c:140
Public IRQ structure.
Definition: sim_irq.h:76
void avr_deallocate_ios(avr_t *avr)
Terminates all IOs and remove from them from the io chain.
Definition: sim_io.c:270