SatCat5
satcat5::irq::Controller Class Referenceabstract

Detailed Description

Platform-agnostic interrupt controller.

SatCat5 interrupt-API concepts.

This is the parent class for platform-specific interrupt systems. This control object registers interrupt handlers and handles nested calls to atomic_start, atomic_end, etc. Children must implement the specified platform-specific methods.

Definition at line 83 of file satcat5/interrupts.h.

#include <interrupts.h>

Inheritance diagram for satcat5::irq::Controller:
[legend]

Public Member Functions

void init (satcat5::util::TimeRef *timer=0)
 Start the interrupt controller. More...
 
void stop ()
 Unregister ALL interrupt handlers. More...
 

Static Public Member Functions

static bool is_initialized ()
 Has init() been called?
 
static bool is_irq_context ()
 Are we currently servicing an interrupt?
 
static bool is_irq_or_locked ()
 Are we currently in a critical-section?
 

Protected Member Functions

 Controller ()
 Only children should create or destroy base class.
 
virtual void irq_register (satcat5::irq::Handler *obj)=0
 Re-enable hardware interrupts. More...
 
virtual void irq_unregister (satcat5::irq::Handler *obj)=0
 Un-register the callback for an interrupt handler. More...
 
virtual void irq_acknowledge (satcat5::irq::Handler *obj)
 Post-handler acknowledgement, notification, and cleanup. More...
 
virtual void irq_pause ()=0
 Prevent preemption from "pause" until "resume". More...
 
virtual void irq_resume ()=0
 Disable hardware interrupts.
 

Static Protected Member Functions

static void interrupt_static (satcat5::irq::Handler *obj)
 Static interrupt service routine. More...
 

Member Function Documentation

◆ init()

void satcat5::irq::Controller::init ( satcat5::util::TimeRef timer = 0)

Start the interrupt controller.

Link all registered irq::Handler objects (see below). The timer argument is optional but allows collection of statistics about time spent in each interrupt handler. If none is provided, statistics use SATCAT5_CLOCK. The platform-specific implementation MUST call this function exactly once, when it is ready to begin servicing interrupts.

Definition at line 83 of file satcat5/interrupts.cc.

◆ interrupt_static()

void satcat5::irq::Controller::interrupt_static ( satcat5::irq::Handler obj)
staticprotected

Static interrupt service routine.

Child MUST call this method whenever an interrupt occurs.

Definition at line 125 of file satcat5/interrupts.cc.

◆ irq_acknowledge()

void satcat5::irq::Controller::irq_acknowledge ( satcat5::irq::Handler obj)
protectedvirtual

Post-handler acknowledgement, notification, and cleanup.

Child SHOULD override this method if such action is required.

Reimplemented in satcat5::irq::ControllerNull, satcat5::sam::ControllerSAMV71, and satcat5::freertos::ControllerFreeRTOS.

Definition at line 119 of file satcat5/interrupts.cc.

◆ irq_pause()

virtual void satcat5::irq::Controller::irq_pause ( )
protectedpure virtual

Prevent preemption from "pause" until "resume".

May be implemented by mutex, disabling interrupts, etc. Child MUST override these two methods.

Implemented in satcat5::irq::ControllerNull, satcat5::sam::ControllerSAMV71, and satcat5::freertos::ControllerFreeRTOS.

◆ irq_register()

virtual void satcat5::irq::Controller::irq_register ( satcat5::irq::Handler obj)
protectedpure virtual

Re-enable hardware interrupts.

Register the callback for an interrupt-handler. Child MUST override this method.

Implemented in satcat5::irq::ControllerNull, satcat5::sam::ControllerSAMV71, and satcat5::freertos::ControllerFreeRTOS.

◆ irq_unregister()

virtual void satcat5::irq::Controller::irq_unregister ( satcat5::irq::Handler obj)
protectedpure virtual

Un-register the callback for an interrupt handler.

Child MUST override this method.

Implemented in satcat5::irq::ControllerNull, satcat5::sam::ControllerSAMV71, and satcat5::freertos::ControllerFreeRTOS.

◆ stop()

void satcat5::irq::Controller::stop ( )

Unregister ALL interrupt handlers.

(For safety, this must be called before the destructor, since cleanup may require the use of various virtual methods.)

Definition at line 65 of file satcat5/interrupts.cc.


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