SatCat5
satcat5::test::MockInterrupt Class Reference

Detailed Description

Mockup for a ConfigBus interrupt register.

Definition at line 255 of file sim_utils.h.

#include <sim_utils.h>

Inheritance diagram for satcat5::test::MockInterrupt:
[legend]
Collaboration diagram for satcat5::test::MockInterrupt:
[legend]

Public Member Functions

 MockInterrupt (satcat5::cfg::ConfigBus *cfg)
 No associated register, assumes interrupt has fired.
 
 MockInterrupt (satcat5::cfg::ConfigBus *cfg, unsigned regaddr)
 Poll the designated register to see if interrupt flag is set.
 
void fire ()
 Trigger a virtual interrupt.
 
unsigned count () const
 Returns the current counter value.
 
void count_reset ()
 Reset the counter to zero.
 
void irq_check ()
 Check if this interrupt may need service. More...
 
void irq_enable ()
 Enable this interrupt. More...
 
void irq_disable ()
 Temporarily disable this interrupt. More...
 

Protected Member Functions

void irq_event () override
 Interrupt service routine. More...
 

Protected Attributes

satcat5::cfg::ConfigBus *const m_cfg
 
unsigned m_regaddr
 
unsigned m_count
 

Private Attributes

satcat5::cfg::Register m_ctrl
 
satcat5::cfg::Interruptm_next
 

Member Function Documentation

◆ irq_check()

void Interrupt::irq_check ( )
inherited

Check if this interrupt may need service.

If the interrupt needs service, this calls irq_event.

Definition at line 46 of file cfgbus_interrupt.cc.

◆ irq_disable()

void Interrupt::irq_disable ( )
inherited

Temporarily disable this interrupt.

Interrupts are enabled by default, but some peripherals may wish to temporary toggle this setting. For use with standard "cfgbus_interrupt" only.

Definition at line 63 of file cfgbus_interrupt.cc.

◆ irq_enable()

void Interrupt::irq_enable ( )
inherited

Enable this interrupt.

Interrupts are enabled by default, but some peripherals may wish to temporary toggle this setting. For use with standard "cfgbus_interrupt" only.

Definition at line 58 of file cfgbus_interrupt.cc.

◆ irq_event()

void satcat5::test::MockInterrupt::irq_event ( )
inlineoverrideprotectedvirtual

Interrupt service routine.

(Child class must override this method.)

Implements satcat5::cfg::Interrupt.

Definition at line 267 of file sim_utils.h.


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