|
SatCat5
|
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>
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... | |
| 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.
|
staticprotected |
Static interrupt service routine.
Child MUST call this method whenever an interrupt occurs.
Definition at line 125 of file satcat5/interrupts.cc.
|
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.
|
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.
|
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.
|
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.
| 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.