Go to the source code of this file.
Functions | |
VDevice * | vdev_new (char *name, int base, int size, VDevFP_Read rd, VDevFP_Write wr, VDevFP_Reset reset, VDevFP_RegName reg_name) |
void | vdev_construct (VDevice *dev, char *name, int base, int size, VDevFP_Read rd, VDevFP_Write wr, VDevFP_Reset reset, VDevFP_RegName reg_name) |
void | vdev_destroy (void *dev) |
int | vdev_name_cmp (AvrClass *c1, AvrClass *c2) |
int | vdev_addr_cmp (AvrClass *c1, AvrClass *c2) |
uint8_t | vdev_read (VDevice *dev, int addr) |
void | vdev_write (VDevice *dev, int addr, uint8_t val) |
void | vdev_reset (VDevice *dev) |
void | vdev_set_core (VDevice *dev, AvrClass *core) |
AvrClass * | vdev_get_core (VDevice *dev) |
int | vdev_get_base (VDevice *dev) |
int | vdev_get_size (VDevice *dev) |
char * | vdev_get_name (VDevice *dev) |
char * | vdev_get_reg_name (VDevice *dev, int addr) |
These functions are the base for all other devices mapped into the device space.
Definition in file device.c.
|
Create a new VDevice. Definition at line 62 of file device.c. References avr_new, class_overload_destroy(), vdev_construct(), and vdev_destroy(). |
|
Constructor for a VDevice. Definition at line 76 of file device.c. References avr_error, and class_construct(). Referenced by adc_construct(), adc_intr_construct(), ocreg16_construct(), port_construct(), spi_construct(), spi_intr_construct(), timer0_construct(), timer16_construct(), timer_intr_construct(), uart0_construct(), uart0_intr_construct(), usb_construct(), usb_intr_construct(), and vdev_new(). |
|
Destructor for a VDevice. Definition at line 97 of file device.c. References class_destroy(). Referenced by adc_destroy(), adc_intr_destroy(), port_destroy(), spi_destroy(), spi_intr_destroy(), timer0_destroy(), timer_intr_destroy(), uart_destroy(), uart_intr_destroy(), usb_destroy(), usb_intr_destroy(), and vdev_new(). |
|
Compare the names of 2 devices.
Referenced by mem_get_vdevice_by_name(). |
|
Checks if a address is in the device's address range.
Referenced by mem_get_vdevice_by_addr(). |
|
Reads the device's value in the register at addr. Definition at line 147 of file device.c. Referenced by mem_io_fetch(), and mem_read(). |
|
Writes an value to the register at addr. Definition at line 154 of file device.c. Referenced by mem_write(). |
|
Resets a device. |
|
Set the core field. |
|
Get the core field.
|
|
Get the device's base address. |
|
Set the device's size (the number of bytes of the address space it consumes). |
|
Get the device's name. Definition at line 193 of file device.c. Referenced by mem_io_fetch(). |
|
Get the name of a device's register name associated with the given address. Definition at line 201 of file device.c. Referenced by mem_io_fetch(). |