SatCat5
cfgbus_interrupt.h
1 // Copyright 2021-2025 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 // Event-handler for individual ConfigBus interrupts.
6 
7 #pragma once
8 
9 #include <satcat5/cfgbus_core.h>
10 #include <satcat5/list.h>
11 
12 namespace satcat5 {
13  namespace cfg {
19  class Interrupt {
20  public:
23  void irq_check();
24 
27  virtual void irq_event() = 0;
28 
33  void irq_enable();
34 
37  void irq_disable();
38 
39  protected:
46  explicit Interrupt(satcat5::cfg::ConfigBus* cfg);
47 
53  unsigned devaddr, unsigned regaddr);
54  ~Interrupt() SATCAT5_OPTIONAL_DTOR;
55 
56  private:
57  friend satcat5::cfg::ConfigBus;
58  friend satcat5::util::ListCore;
59  satcat5::cfg::ConfigBus* const m_cfg;
60  satcat5::cfg::Register m_ctrl;
61  satcat5::cfg::Interrupt* m_next;
62  };
63  }
64 }
ConfigBus core definitions.
Generic ConfigBus API.
Definition: cfgbus_core.h:124
Event-handler for individual ConfigBus interrupts.
void irq_disable()
Temporarily disable this interrupt.
Interrupt(satcat5::cfg::ConfigBus *cfg)
Nonstandard constructor.
virtual void irq_event()=0
Interrupt service routine.
void irq_check()
Check if this interrupt may need service.
void irq_enable()
Enable this interrupt.
Pointer-like wrapper for one or more ConfigBus registers.
Definition: cfgbus_core.h:76
Templated functions for manipulating singly-linked lists.