Class IO_RegHandler

Inheritance Relationships

Derived Types

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

  • value – current cached value of the register

Returns:

actual value of the register

virtual uint8_t ioreg_peek_handler(reg_addr_t addr, uint8_t value) = 0

Callback for a I/O peek access. On-the-fly modifications of the register content are possible.

Parameters:
  • addr – address of the register read, in I/O address space

  • value – current cached value of the register

Returns:

actual value of the register

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.