SimAVR
AVR Simulator
|
Data Structures | |
struct | avr_io_t |
IO module base struct Modules uses that as their first member in their own struct. More... | |
Macros | |
#define | AVR_IOCTL_DEF(_a, _b, _c, _d) (((_a) << 24)|((_b) << 16)|((_c) << 8)|((_d))) |
Used by the ioports to implement their own features see avr_eeprom. More... | |
#define | AVR_IOMEM_IRQ_ALL 8 |
Typedefs | |
typedef struct avr_io_t | avr_io_t |
IO module base struct Modules uses that as their first member in their own struct. More... | |
Functions | |
void | avr_register_io (avr_t *avr, avr_io_t *io) |
Registers an IO module, so it's run(), reset() etc are called. More... | |
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. More... | |
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. More... | |
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. More... | |
int | avr_ioctl (avr_t *avr, uint32_t ctl, void *io_param) |
Call every IO modules until one responds to this. More... | |
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. More... | |
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. More... | |
void | avr_deallocate_ios (avr_t *avr) |
Terminates all IOs and remove from them from the io chain. More... | |
#define AVR_IOCTL_DEF | ( | _a, | |
_b, | |||
_c, | |||
_d | |||
) | (((_a) << 24)|((_b) << 16)|((_c) << 8)|((_d))) |
Used by the ioports to implement their own features see avr_eeprom.
#define AVR_IOMEM_IRQ_ALL 8 |
IO module base struct Modules uses that as their first member in their own struct.
void avr_deallocate_ios | ( | avr_t * | avr | ) |
Terminates all IOs and remove from them from the io chain.
Get the specific irq for a module, check AVR_IOCTL_IOPORT_GETIRQ for example.
Sets an IO module "official" IRQs and the ioctl used to get to them.
If 'irqs' is NULL, * 'count' will be allocated
int avr_ioctl | ( | avr_t * | avr, |
uint32_t | ctl, | ||
void * | io_param | ||
) |
Call every IO modules until one responds to this.
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.
This allows any code to hook an IRQ in any io address, for example tracing changes of values into a register Note that the values do not "magically" change, they change only when the AVR code attempt to read and write at that address the "index" is a bit number, or ALL bits if index == 8
Registers an IO module, so it's run(), reset() etc are called.
This is called by the AVR core init functions, you /could/ register an external one after instantiation, for whatever purpose...
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.
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.