SatCat5
hal_ublaze/interrupts.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 // Xilinx Microblaze implementation of the "InterruptController" class
6 
7 #pragma once
8 
9 #include <satcat5/interrupts.h>
10 #include <xparameters.h>
11 
12 // Check if BSP will include the XIntc driver before proceeding.
13 #if XPAR_XINTC_NUM_INSTANCES > 0
14 
15 #include <xintc.h>
16 
17 namespace satcat5 {
18  namespace irq {
40  class ControllerMicroblaze : public satcat5::irq::Controller {
41  public:
43  explicit ControllerMicroblaze(XIntc* xintc);
44 
46  void irq_start(
47  u16 dev_id, // Xilinx device-ID
48  satcat5::util::TimeRef* timer = 0, // Diagnostic timer
49  u32 opts = XIN_SVC_ALL_ISRS_OPTION); // Xilinx option flags
50 
51  protected:
52  // Hardware-abstraction overrides.
53  void irq_pause() override;
54  void irq_resume() override;
55  void irq_register(satcat5::irq::Handler* obj) override;
56  void irq_unregister(satcat5::irq::Handler* obj) override;
57  void irq_acknowledge(satcat5::irq::Handler* obj) override;
58 
59  private:
60  XIntc* const m_xintc;
61  };
62  }
63 }
64 
65 #endif // XPAR_XINTC_NUM_INSTANCES > 0
Platform-agnostic interrupt controller.
Parent object for receiving interrupt-handler callbacks.
The TimeRef API provides access to a monotonic time-counter.
Definition: timeref.h:142
Platform-agnostic API for interrupt management.