36 #ifndef SATCAT5_CFGBUS_DIRECT
37 #define SATCAT5_CFGBUS_DIRECT 0
63 void operator=(u32 wrval);
64 void write_repeat(
unsigned count,
const u32* data);
79 bool operator!()
const;
89 #if SATCAT5_CFGBUS_DIRECT
91 #define SATCAT5_NULL_REGISTER 0
94 #define SATCAT5_NULL_REGISTER satcat5::cfg::WrappedRegisterPtr(0,0)
107 constexpr
auto IOSTATUS_OK =
108 satcat5::cfg::IoStatus::OK;
109 constexpr
auto IOSTATUS_BUSERROR =
110 satcat5::cfg::IoStatus::BUSERROR;
111 constexpr
auto IOSTATUS_CMDERROR =
112 satcat5::cfg::IoStatus::CMDERROR;
113 constexpr
auto IOSTATUS_TIMEOUT =
114 satcat5::cfg::IoStatus::TIMEOUT;
135 unsigned regaddr,
unsigned count, u32* result);
138 unsigned regaddr,
unsigned count, u32* result);
141 unsigned regaddr,
unsigned count,
const u32* data);
144 unsigned regaddr,
unsigned count,
const u32* data);
177 volatile u32* m_base_ptr;
215 {
return m_base_ptr + addr;}
IoStatus
Status codes for ConfigBus read/write operations.
const unsigned MAX_TOTAL_REGS
Fixed ConfigBus gateware interface parameters.
const unsigned REGS_PER_DEVICE
Fixed ConfigBus gateware interface parameters.
const unsigned MAX_DEVICES
Fixed ConfigBus gateware interface parameters.
const unsigned DEVS_PER_CFGBUS
Fixed ConfigBus gateware interface parameters.
const unsigned REGADDR_ANY
Shortcut for don't-care register address.
virtual satcat5::cfg::IoStatus read(unsigned regaddr, u32 &rdval)=0
Basic single-register read operation.
satcat5::cfg::Register get_register(unsigned dev, unsigned reg=0)
Create register-map object for the given device address.
void irq_poll()
Poll all registered ConfigBus interrupt handlers.
virtual satcat5::cfg::IoStatus write(unsigned regaddr, u32 wrval)=0
Basic single-register write operation.
virtual satcat5::cfg::IoStatus read_repeat(unsigned regaddr, unsigned count, u32 *result)
Bulk-read the same register N times.
unsigned get_regaddr(unsigned dev, unsigned reg) const
Convert device + register to combined address.
virtual satcat5::cfg::IoStatus write_repeat(unsigned regaddr, unsigned count, const u32 *data)
Bulk-write the same register N times.
void unregister_irq(satcat5::cfg::Interrupt *obj)
Remove an interrupt handler.
virtual satcat5::cfg::IoStatus write_array(unsigned regaddr, unsigned count, const u32 *data)
Bulk-write with auto-increment (regaddr, regaddr+1, ...)
void register_irq(satcat5::cfg::Interrupt *obj)
Add an interrupt handler.
unsigned count_irq() const
Count attached interrupt handlers.
virtual satcat5::cfg::IoStatus read_array(unsigned regaddr, unsigned count, u32 *result)
Bulk-read with auto-increment (regaddr, regaddr+1, ...) Bulk read/write operations are more efficient...
Memory-mapped local ConfigBus.
satcat5::cfg::IoStatus write(unsigned regaddr, u32 val) override
Basic single-register write operation.
void * get_device_mmap(unsigned dev) const
Get a raw pointer to the designated device-address.
volatile u32 * get_register_mmap(unsigned addr) const
Get a raw pointer to the designated combined-address.
void irq_event() override
Method called whenever an interrupt is triggered.
satcat5::cfg::IoStatus read(unsigned regaddr, u32 &val) override
Basic single-register read operation.
ConfigBusMmap(void *base_ptr, int irq)
Constructor accepts the base pointer for the memory-map interface, and the interrupt-index for the sh...
Event-handler for individual ConfigBus interrupts.
Generic wrapper for a specific ConfigBus register.
Pointer-like wrapper for one or more ConfigBus registers.
Parent object for receiving interrupt-handler callbacks.
Templated functions for manipulating singly-linked lists.
Platform-agnostic API for interrupt management.