Class IO_RegHandler
Defined in File sim_ioreg.h
Inheritance Relationships
Derived Types
public IO_RegDispatcher(Class IO_RegDispatcher)public Peripheral(Class Peripheral)
Class Documentation
-
class IO_RegHandler
Abstract interface for I/O register handlers The handler is notified when the register is accessed by the CPU It is meant to be implemented by I/O peripherals
Subclassed by IO_RegDispatcher, Peripheral
Public Functions
-
virtual ~IO_RegHandler() = default
-
virtual uint8_t ioreg_read_handler(reg_addr_t addr, uint8_t value) = 0
Callback for a CPU I/O read access. On-the-fly modifications of the register content are possible.
- Parameters:
addr – address of the register read, in I/O address space
-
virtual void ioreg_write_handler(reg_addr_t addr, const ioreg_write_t &data) = 0
Callback for a CPU I/O write access. Note that the register has already been updated so it’s ok for the callback to overwrite it. (a typical use case is implementing write-one-to-clear bits)
- Parameters:
addr – address of the register read, in I/O address space
data – struct containing the data change.
-
virtual ~IO_RegHandler() = default