ArchXT_IntCtrl Class Reference

yasimavr: ArchXT_IntCtrl Class Reference
yasimavr
Loading...
Searching...
No Matches

Implementation of a Interrupt Controller for XT core series. More...

#include <arch_xt_misc.h>

Inheritance diagram for ArchXT_IntCtrl:
InterruptController Peripheral IORegHandler

Classes

struct  vect_info_t
 

Public Member Functions

 ArchXT_IntCtrl (const ArchXT_IntCtrlConfig &config)
 
virtual bool init (Device &device) override
 
virtual void ioreg_write_handler (reg_addr_t addr, const ioreg_write_t &data) override
 
virtual void cpu_reti () override
 
- Public Member Functions inherited from InterruptController
 InterruptController (unsigned int vector_count)
 
virtual void reset (int flags) override
 
virtual bool ctlreq (ctlreq_id_t req, ctlreq_data_t *data) override
 
virtual void sleep (bool on, SleepMode mode) override
 
bool cpu_has_irq () const
 
IRQ_t cpu_get_irq () const
 
void cpu_ack_irq ()
 
- Public Member Functions inherited from Peripheral
 Peripheral (ctl_id_t id)
 
virtual ~Peripheral ()
 
ctl_id_t id () const
 Unique identifier of the peripheral.
 
std::string name () const
 The name of the peripheral.
 
virtual uint8_t ioreg_read_handler (reg_addr_t addr, uint8_t value) override
 
virtual uint8_t ioreg_peek_handler (reg_addr_t addr, uint8_t value) override
 
 Peripheral (const Peripheral &)=delete
 
Peripheraloperator= (const Peripheral &)=delete
 
- Public Member Functions inherited from IORegHandler
virtual ~IORegHandler ()=default
 

Protected Member Functions

virtual void cpu_ack_irq (int_vect_t vector) override
 
virtual IRQ_t get_next_irq () const override
 
- Protected Member Functions inherited from InterruptController
bool interrupt_raised (int_vect_t vector) const
 Interrupt state getter.
 
int_vect_t intr_count () const
 Interrupt table size getter.
 
void set_interrupt_raised (int_vect_t vector, bool raised)
 Interrupt state setter.
 
void update_irq ()
 
- Protected Member Functions inherited from Peripheral
Devicedevice () const
 Access to the device. It is null before init() is called.
 
Loggerlogger ()
 Logging object associated with this peripheral.
 
bool register_interrupt (int_vect_t vector, InterruptHandler &handler) const
 
Signalget_signal (ctl_id_t ctl_id) const
 
void add_ioreg (const regmask_t &rm, IORegister::BitMode bitmode=IORegister::RW)
 
void add_ioreg (const regbit_compound_t &rbc, IORegister::BitMode bitmode=IORegister::RW)
 
void add_ioreg (reg_addr_t addr, IORegister::BitMode bitmode=IORegister::RW)
 
void add_ioreg (reg_addr_t addr, bitmask_t mask, IORegister::BitMode bitmode=IORegister::RW)
 
uint8_t read_ioreg (const regbit_t &rb) const
 
uint64_t read_ioreg (const regbit_compound_t &rbc) const
 
uint8_t read_ioreg (reg_addr_t addr) const
 
uint8_t read_ioreg (reg_addr_t addr, const bitspec_t &bs) const
 
bool test_ioreg (const regbit_t &rb) const
 
bool test_ioreg (const regbit_compound_t &rbc) const
 
bool test_ioreg (reg_addr_t addr, const bitspec_t &bs) const
 
bool test_ioreg (reg_addr_t addr, bitmask_t bm=0xFF) const
 
void write_ioreg (reg_addr_t addr, bitmask_t bm, uint8_t value)
 
void write_ioreg (const regbit_t &rb, uint8_t value)
 
void write_ioreg (const regbit_compound_t &rbc, uint64_t value)
 
void write_ioreg (reg_addr_t addr, uint8_t value)
 
void write_ioreg (reg_addr_t addr, const bitspec_t &bs, uint8_t value)
 
void set_ioreg (reg_addr_t addr, bitmask_t bm=0xFF)
 
void set_ioreg (const regbit_t &rb)
 
void set_ioreg (const regbit_compound_t &rbc)
 
void set_ioreg (reg_addr_t addr, const bitspec_t &bs)
 
void clear_ioreg (reg_addr_t addr, bitmask_t bm=0xFF)
 
void clear_ioreg (const regbit_t &rb)
 
void clear_ioreg (const regbit_compound_t &rbc)
 
void clear_ioreg (reg_addr_t addr, const bitspec_t &bs)
 

Additional Inherited Members

- Public Types inherited from InterruptController
enum  SignalId { Signal_StateChange }
 
enum  State {
  State_Raised = 0x01 , State_Cancelled = 0x10 , State_Acknowledged = 0x20 , State_Returned = 0x30 ,
  State_RaisedFromSleep = 0x41 , State_Reset = 0x50
}
 
- Static Public Attributes inherited from InterruptController
static constexpr IRQ_t NO_INTERRUPT = { AVR_INTERRUPT_NONE, 0, false }
 

Detailed Description

Implementation of a Interrupt Controller for XT core series.

Constructor & Destructor Documentation

◆ ArchXT_IntCtrl()

ArchXT_IntCtrl::ArchXT_IntCtrl ( const ArchXT_IntCtrlConfig config)
explicit

Member Function Documentation

◆ cpu_ack_irq()

void ArchXT_IntCtrl::cpu_ack_irq ( int_vect_t  vector)
overrideprotectedvirtual

Called by the CPU when it acknowledges a vector, i.e. it is about to execute the vector address in the flash.
The base implementation calls the ACK handler of the vector and raise the signal with the "Acknowledged" state.

Reimplemented from InterruptController.

◆ cpu_reti()

void ArchXT_IntCtrl::cpu_reti ( )
overridevirtual

Called by the CPU when returning from an ISR (executing a RETI instruction).
The base implementation calls update_irq to determine the next vector to be given to the CPU.

Reimplemented from InterruptController.

◆ get_next_irq()

InterruptController::IRQ_t ArchXT_IntCtrl::get_next_irq ( ) const
overrideprotectedvirtual

Abstract method indicating which vector should be executed next. Architecture specific behaviors can be implemented here to take into account priority arbitration between vectors.

Note
implementations should assume the GIE flag is set.
Returns
IRQ to be executed next or NO_INTERRUPT

Implements InterruptController.

◆ init()

bool ArchXT_IntCtrl::init ( Device device)
overridevirtual

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.

Reimplemented from Peripheral.

◆ ioreg_write_handler()

void ArchXT_IntCtrl::ioreg_write_handler ( reg_addr_t  addr,
const ioreg_write_t value 
)
overridevirtual

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

Parameters
addrthe register address in I/O space
valuethe new register content

Reimplemented from Peripheral.


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