|
SatCat5
|
Microchip SAM V71 implementation of the "InterruptController" API.
Control object for registering interrupt handlers and handling nested calls to atomic_start, atomic_end, etc. Children should implement the specified platform-specific methods.
User should instantiate and configure a global "satcat5::irq::Handler", then pass a pointer to this object. User is responsible for populating interrupt handlers and calling irq_handler with the handler object. In addition, because SatCat does not allow negative IRQ Nums and some IRQ Nums are negative the NVIC_USER_IRQ_OFFSET is applied when creating interrupt handlers. The ControllerSAMV71 will then revert this offset before calling NVIC API functions.
Example instantation:
Definition at line 53 of file hal_samv71/interrupts.h.
#include <interrupts.h>
Public Member Functions | |
| ControllerSAMV71 () | |
| Constructor. | |
| void | irq_start (satcat5::util::TimeRef *timer=0) |
| Initialize SAMV71 controller and start SatCat5 interrupts. | |
| void | irq_handler (satcat5::irq::Handler *obj) |
| IRQ Handler. | |
| 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 | |
| void | irq_pause () override |
| Prevent preemption from "pause" until "resume". More... | |
| void | irq_resume () override |
| Disable hardware interrupts. | |
| void | irq_register (satcat5::irq::Handler *obj) override |
| Re-enable hardware interrupts. More... | |
| void | irq_unregister (satcat5::irq::Handler *obj) override |
| Un-register the callback for an interrupt handler. More... | |
| void | irq_acknowledge (satcat5::irq::Handler *obj) override |
| Post-handler acknowledgement, notification, and cleanup. More... | |
Static Protected Member Functions | |
| static void | interrupt_static (satcat5::irq::Handler *obj) |
| Static interrupt service routine. More... | |
|
inherited |
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.
|
staticprotectedinherited |
Static interrupt service routine.
Child MUST call this method whenever an interrupt occurs.
Definition at line 125 of file satcat5/interrupts.cc.
|
overrideprotectedvirtual |
Post-handler acknowledgement, notification, and cleanup.
Child SHOULD override this method if such action is required.
Reimplemented from satcat5::irq::Controller.
Definition at line 68 of file hal_samv71/interrupts.cc.
|
overrideprotectedvirtual |
Prevent preemption from "pause" until "resume".
May be implemented by mutex, disabling interrupts, etc. Child MUST override these two methods.
Implements satcat5::irq::Controller.
Definition at line 39 of file hal_samv71/interrupts.cc.
|
overrideprotectedvirtual |
Re-enable hardware interrupts.
Register the callback for an interrupt-handler. Child MUST override this method.
Implements satcat5::irq::Controller.
Definition at line 49 of file hal_samv71/interrupts.cc.
|
overrideprotectedvirtual |
Un-register the callback for an interrupt handler.
Child MUST override this method.
Implements satcat5::irq::Controller.
Definition at line 60 of file hal_samv71/interrupts.cc.
|
inherited |
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.