9 #include <satcat5/cfgbus_interrupt.h>
10 #include <satcat5/pkt_buffer.h>
36 {
return m_cmd_queued == 0;}
45 u8* txbuff,
unsigned txsize,
46 u8* rxbuff,
unsigned rxsize);
70 static const unsigned REGADDR_IRQ;
71 static const unsigned REGADDR_CFG;
72 static const unsigned REGADDR_STATUS;
73 static const unsigned REGADDR_DATA;
89 unsigned const m_cmd_max;
91 unsigned m_cmd_queued;
92 unsigned m_new_wralloc;
93 unsigned m_new_rdalloc;
Event-handler for individual ConfigBus interrupts.
Partial driver for the multipurpose serial peripheral.
u8 get_percent_full() const
How full is the transmit queue? (0-100%)
bool idle() const
Is the queue empty and the bus idle?
MultiSerial(satcat5::cfg::ConfigBus *cfg, unsigned devaddr, unsigned maxpkt, u8 *txbuff, unsigned txsize, u8 *rxbuff, unsigned rxsize)
Set all parameters for this Multiserial instance.
void data_rcvd(satcat5::io::Readable *src) override
The data_rcvd() callback is polled whenever data is available.
satcat5::io::PacketBuffer m_tx
Buffer for hardware commands.
void poll_demand()
Deferred event handler, called after request().
satcat5::io::PacketBuffer m_rx
Buffer for reply data.
virtual void read_done(unsigned cidx)=0
Callback when each transaction is finished.
unsigned write_finish()
Enqueue transaction after calling write_check().
bool write_check(unsigned ncmd, unsigned nread)
Is there enough space in the software queue? If it returns true, write each opcode and then call writ...
void irq_event()
Interrupt service routine.
Pointer-like wrapper for one or more ConfigBus registers.
Event-handler interface for newly received data.
The PacketBuffer class is a wrapper for a circular buffer, with optional logic to support retention o...
u8 get_percent_full() const
Get overall buffer occupancy as percentage full (0-100%).
Abstract API for reading byte-streams and packets.
An "OnDemand" object is polled only on request.