IORegHandler Class Reference

yasimavr: IORegHandler Class Reference
yasimavr
Loading...
Searching...
No Matches
IORegHandler Class Referenceabstract

#include <sim_ioreg.h>

Inheritance diagram for IORegHandler:
IORegDispatcher InterruptFlag Peripheral ArchAVR_ACP ArchAVR_ADC ArchAVR_ExtInt ArchAVR_Fuses ArchAVR_MiscRegCtrl ArchAVR_NVM ArchAVR_ResetCtrl ArchAVR_SPI ArchAVR_TWI ArchAVR_Timer ArchAVR_USART ArchAVR_USI ArchAVR_WDT ArchXT_ACP ArchXT_ADC ArchXT_Fuses ArchXT_MiscRegCtrl ArchXT_NVM ArchXT_PortMuxCtrl ArchXT_RTC ArchXT_ResetCtrl ArchXT_SPI ArchXT_TWI ArchXT_TimerA ArchXT_TimerB ArchXT_USART ArchXT_USERROW ArchXT_WDT DummyController InterruptController Port SleepController VREF

Public Member Functions

virtual ~IORegHandler ()=default
 
virtual uint8_t ioreg_read_handler (reg_addr_t addr, uint8_t value)=0
 
virtual uint8_t ioreg_peek_handler (reg_addr_t addr, uint8_t value)=0
 
virtual void ioreg_write_handler (reg_addr_t addr, const ioreg_write_t &data)=0
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~IORegHandler()

virtual IORegHandler::~IORegHandler ( )
virtualdefault

Member Function Documentation

◆ ioreg_peek_handler()

virtual uint8_t IORegHandler::ioreg_peek_handler ( reg_addr_t  addr,
uint8_t  value 
)
pure virtual

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

Parameters
addraddress of the register read, in I/O address space
valuecurrent cached value of the register
Returns
actual value of the register

Implemented in ArchAVR_SPI, ArchAVR_Timer, ArchXT_RTC, ArchXT_SPI, ArchXT_TimerA, ArchXT_TimerB, ArchXT_TWI, ArchXT_USART, IORegDispatcher, and Peripheral.

◆ ioreg_read_handler()

virtual uint8_t IORegHandler::ioreg_read_handler ( reg_addr_t  addr,
uint8_t  value 
)
pure virtual

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

Parameters
addraddress of the register read, in I/O address space
valuecurrent cached value of the register
Returns
actual value of the register

Implemented in ArchAVR_ADC, ArchAVR_SPI, ArchAVR_Timer, ArchAVR_USART, ArchXT_ADC, ArchXT_MiscRegCtrl, ArchXT_Port, ArchXT_RTC, ArchXT_SPI, ArchXT_TimerA, ArchXT_TimerB, ArchXT_TWI, ArchXT_USART, IORegDispatcher, and Peripheral.

◆ ioreg_write_handler()

virtual void IORegHandler::ioreg_write_handler ( reg_addr_t  addr,
const ioreg_write_t data 
)
pure virtual

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
addraddress of the register read, in I/O address space
datastruct containing the data change.

Implemented in ArchAVR_IntCtrl, ArchAVR_ACP, ArchAVR_ADC, ArchAVR_ExtInt, ArchAVR_ResetCtrl, ArchAVR_NVM, ArchAVR_Port, ArchAVR_SPI, ArchAVR_Timer, ArchAVR_TWI, ArchAVR_USART, ArchAVR_USI, ArchAVR_WDT, ArchXT_ACP, ArchXT_ADC, ArchXT_VREF, ArchXT_IntCtrl, ArchXT_ResetCtrl, ArchXT_MiscRegCtrl, ArchXT_PortMuxCtrl, ArchXT_USERROW, ArchXT_NVM, ArchXT_Port, ArchXT_RTC, ArchXT_SPI, ArchXT_TimerA, ArchXT_TimerB, ArchXT_TWI, ArchXT_USART, ArchXT_WDT, Peripheral, and IORegDispatcher.


The documentation for this class was generated from the following file: