Class ArchXT_RTC

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class ArchXT_RTC : public Peripheral

Implementation of a RTC controller for XT core series.

Includes a Periodic Interrupt Timer system

Unsupported features:

  • External clock source

  • Crystal error correction

  • Events outputs

  • Synchronization Busy flags

Public Functions

explicit ArchXT_RTC(const ArchXT_RTCConfig &config)
virtual ~ArchXT_RTC()
virtual bool init(Device &device) override

Virtual method called when the device is initialised. This is where the peripheral can allocate its I/O registers, interrupts or connect signals.

Returns:

boolean indicates the success of all allocations.

virtual void reset() override

Virtual method called when the device is reset. Note that resetting I/O registers is only necessary here if their reset value is not zero.

virtual uint8_t ioreg_read_handler(reg_addr_t addr, uint8_t value) override

Virtual method called when the CPU is reading a I/O register allocated by this peripheral. The value has not been read yet so the module can modify it before the CPU gets it.

Parameters:
  • addr – the register address in I/O 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) override

Virtual method called when a debug probe is peeking the value of a register. The value has not been read yet so the module can modify it before the CPU gets it. The difference between a peek and a read is that a peek should not modify the state of the peripheral. By default, ioreg_read_handler is called to obtain the value.

Parameters:
  • addr – the register address in I/O 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) override

Virtual method called when the CPU is writing a I/O register allocated by this peripheral. The value has already been written.

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

  • value – the new register content

virtual void sleep(bool on, SleepMode mode) override

Virtual method called when the device enters or exits a sleep mode.

Parameters:
  • on – true when entering a sleep mode, false when exiting it.

  • mode – one of the enum SleepMode values

class TimerHook : public SignalHook

Public Functions

inline explicit TimerHook(ArchXT_RTC &ctl)
inline virtual void raised(const signal_data_t &sigdata, int hooktag) override

Pure virtual callback called during signal raises.

Parameters:
  • sigdata – Data structure passed on when raising a signal

  • hooktag – integer passed on when connecting a hook to a signal. For hooks connected to several signals, it provides a mean to identify the caller.