Module for accessing simulated I/O ports. More...
Go to the source code of this file.
Functions | |
VDevice * | port_create (int addr, char *name, int rel_addr, void *data) |
void | port_ext_disable (Port *p) |
void | port_ext_enable (Port *p) |
void | port_add_ext_rd_wr (Port *p, PortFP_ExtRd ext_rd, PortFP_ExtWr ext_wr) |
Module for accessing simulated I/O ports.
Defines an abstract Port class as well as subclasses for each individual port.
Definition in file ports.c.
VDevice* port_create | ( | int | addr, |
char * | name, | ||
int | rel_addr, | ||
void * | data | ||
) |
void port_ext_disable | ( | Port * | p ) |
Disable external port functionality.
This is only used when dumping memory to core file. See mem_io_fetch().
void port_ext_enable | ( | Port * | p ) |
Enable external port functionality.
This is only used when dumping memory to core file. See mem_io_fetch().
void port_add_ext_rd_wr | ( | Port * | p, |
PortFP_ExtRd | ext_rd, | ||
PortFP_ExtWr | ext_wr | ||
) |
Attaches read and write functions to a particular port.
I think I may have this backwards. Having the virtual hardware supply functions for the core to call on every io read/write, might cause missed events (like edge triggered). I'm really not too sure how to handle this.
In the future, it might be better to have the core supply a function for the virtual hardware to call when data is written to the device. The device supplied function could then check if an interrupt should be generated or just simply write to the port data register.
For now, leave it as is since it's easier to test if you can block when the device is reading from the virtual hardware.
Definition at line 231 of file ports.c.
Referenced by avr_core_add_ext_rd_wr().