45 #ifndef SATCAT5_IRQ_STATS
46 #define SATCAT5_IRQ_STATS 1
67 const char*
const m_lbl;
199 Handler(
const char* lbl,
int irq);
200 ~
Handler() SATCAT5_OPTIONAL_DTOR;
203 virtual
void irq_event() = 0;
210 friend satcat5::irq::
Shared;
211 friend satcat5::util::ListCore;
225 ~
Adapter() SATCAT5_OPTIONAL_DTOR;
228 void irq_event()
override;
237 Shared(
const char* lbl,
int irq);
238 ~
Shared() SATCAT5_OPTIONAL_DTOR;
245 void irq_event()
override;
256 bool pre_test_reset();
266 #if SATCAT5_IRQ_STATS
Adapter connects a hardware interrupt to any OnDemand object.
AtomicLock(const char *lbl)
Creating this object starts a critical section.
void release()
Optionally release this lock before the destructor is called.
Platform-agnostic interrupt controller.
virtual void irq_resume()=0
Disable hardware interrupts.
virtual void irq_register(satcat5::irq::Handler *obj)=0
Re-enable hardware interrupts.
Controller()
Only children should create or destroy base class.
static bool is_irq_or_locked()
Are we currently in a critical-section?
virtual void irq_pause()=0
Prevent preemption from "pause" until "resume".
void init(satcat5::util::TimeRef *timer=0)
Start the interrupt controller.
virtual void irq_unregister(satcat5::irq::Handler *obj)=0
Un-register the callback for an interrupt handler.
static bool is_initialized()
Has init() been called?
void stop()
Unregister ALL interrupt handlers.
static bool is_irq_context()
Are we currently servicing an interrupt?
virtual void irq_acknowledge(satcat5::irq::Handler *obj)
Post-handler acknowledgement, notification, and cleanup.
static void interrupt_static(satcat5::irq::Handler *obj)
Static interrupt service routine.
A do-nothing placeholder implementation of irq::Controller .
void irq_unregister(satcat5::irq::Handler *obj) override
Un-register the callback for an interrupt handler.
void irq_acknowledge(satcat5::irq::Handler *obj) override
Post-handler acknowledgement, notification, and cleanup.
void irq_register(satcat5::irq::Handler *obj) override
Re-enable hardware interrupts.
void irq_resume() override
Disable hardware interrupts.
void irq_pause() override
Prevent preemption from "pause" until "resume".
Parent object for receiving interrupt-handler callbacks.
const char *const m_label
Human-readable label, for debugging.
const int m_irq_idx
IRQ index for this interrupt handler.
Shared interrupt handler calls all children for any parent event.
An "OnDemand" object is polled only on request.
Running maximum with label tracking.
The TimeRef API provides access to a monotonic time-counter.
Templated functions for manipulating singly-linked lists.
satcat5::util::RunningMax worst_irq
Statistics tracking for critical sections.
satcat5::util::RunningMax worst_stack
Statistics tracking for critical sections.
satcat5::util::RunningMax worst_lock
Statistics tracking for critical sections.
constexpr int IRQ_NONE
Special index "-1" indicates a disabled or unconnected interrupt.
Timestamp for measuring elapsed time.
TimeRef and TimeVal define the API for monotonic timers.
Basic type aliases and prototypes used throughout SatCat5.