SatCat5
satcat5::udp::ConfigBus Class Referencefinal

Detailed Description

Definition at line 130 of file cfgbus_remote.h.

Inheritance diagram for satcat5::udp::ConfigBus:
[legend]
Collaboration diagram for satcat5::udp::ConfigBus:
[legend]

Public Member Functions

 ConfigBus (satcat5::udp::Dispatch *udp)
 
void connect (const satcat5::ip::Addr &dstaddr)
 
void close ()
 
bool ready () const
 
satcat5::cfg::IoStatus read_array (unsigned regaddr, unsigned count, u32 *result) override
 Bulk read from consecutive registers.
 
satcat5::cfg::IoStatus read_repeat (unsigned regaddr, unsigned count, u32 *result) override
 Repeated read from the same register.
 
satcat5::cfg::IoStatus write_array (unsigned regaddr, unsigned count, const u32 *data) override
 Bulk write to consecutive registers.
 
satcat5::cfg::IoStatus write_repeat (unsigned regaddr, unsigned count, const u32 *data) override
 Repeated write to the same register.
 
void set_timeout_rd (unsigned usec)
 Adjust read timeout (0 = Non-blocking).
 
void set_timeout_wr (unsigned usec)
 Adjust write timeout (0 = Non-blocking).
 
void set_irq_polling (unsigned msec)
 Adjust polling rate for interrupt status (0 = None).
 
unsigned get_regaddr (unsigned dev, unsigned reg) const
 Convert device + register to combined address.
 
void register_irq (satcat5::cfg::Interrupt *obj)
 Add an interrupt handler. More...
 
void unregister_irq (satcat5::cfg::Interrupt *obj)
 Remove an interrupt handler.
 
unsigned count_irq () const
 Count attached interrupt handlers.
 
satcat5::cfg::Register get_register (unsigned dev, unsigned reg=0)
 Create register-map object for the given device address. More...
 
void irq_poll ()
 Poll all registered ConfigBus interrupt handlers. More...
 
void timer_once (unsigned msec)
 Configure a one-time notification after X milliseconds.
 
void timer_every (unsigned msec)
 Configure a repeating notification every X milliseconds.
 
void timer_stop ()
 Stop all future notifications.
 
unsigned timer_interval () const
 Accessor for recurring timer interval, if one is set.
 
unsigned timer_remaining () const
 Accessor for time to next event, if one is set.
 
satcat5::cfg::IoStatus read (unsigned regaddr, u32 &rdval) override
 Basic read and write operations (ConfigBus API).
 
satcat5::cfg::IoStatus write (unsigned regaddr, u32 wrval) override
 Basic read and write operations (ConfigBus API).
 

Static Public Member Functions

static unsigned count_timer ()
 Count all objects of this type, including idle timers.
 

Protected Member Functions

satcat5::ip::Addr dstaddr () const
 
satcat5::eth::MacAddr dstmac () const
 
satcat5::udp::Port dstport () const
 
satcat5::eth::Dispatcheth () const
 
satcat5::net::Dispatchiface () const
 
satcat5::ip::Addr gateway () const
 
satcat5::udp::Port srcport () const
 
satcat5::udp::Dispatchudp () const
 
void frame_rcvd (satcat5::io::LimitedRead &src) override
 Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value. More...
 
void timer_event () override
 Child class MUST override this method.
 
satcat5::cfg::IoStatus send_and_wait (u8 opcode, unsigned addr, unsigned len, const u32 *ptr, unsigned timeout)
 Send, then wait if requested.
 
bool send_command (u8 opcode, unsigned addr, unsigned len, const u32 *ptr)
 Send the specified opcode.
 
satcat5::cfg::IoStatus wait_response (unsigned timeout)
 Busywait until response is received.
 

Protected Attributes

satcat5::udp::Address m_addr
 
satcat5::net::Address *const m_dst
 MAC address for the remote interface.
 
unsigned m_timeout_rd
 
unsigned m_timeout_wr
 
u32 m_status
 
u8 m_sequence
 
u8 m_response_opcode
 
u32 * m_response_ptr
 
unsigned m_response_len
 
satcat5::cfg::IoStatus m_response_status
 
volatile u32 * m_base_ptr
 
satcat5::util::List< satcat5::cfg::Interruptm_irq_list
 
satcat5::net::Type m_filter
 Incoming packet filter.
 

Private Member Functions

void query (unsigned elapsed_msec)
 

Private Attributes

satcat5::net::Protocolm_next
 Linked list of Protocols.
 
unsigned m_trem
 
unsigned m_tnext
 

Member Function Documentation

◆ frame_rcvd()

void ConfigBusRemote::frame_rcvd ( satcat5::io::LimitedRead src)
overrideprotectedvirtualinherited

Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.

The child class SHOULD read the frame contents from the provided "src" object, which is only valid until the function returns.

To send a reply:

  • Call m_iface->open_reply() to obtain a Writable object. (This also writes out any applicable frame headers.)
  • Write frame contents, then call write_finalize().

The child class MUST override this method.

Implements satcat5::net::Protocol.

Definition at line 134 of file cfgbus_remote.cc.

◆ get_register()

Register ConfigBus::get_register ( unsigned  dev,
unsigned  reg = 0 
)
inherited

Create register-map object for the given device address.

(Or for a specific register, if the register address is specified.)

Definition at line 101 of file cfgbus_core.cc.

◆ irq_poll()

void ConfigBus::irq_poll ( )
inherited

Poll all registered ConfigBus interrupt handlers.

Issue callbacks to any that may have triggered. (This method should not usually be called directly.)

Definition at line 111 of file cfgbus_core.cc.

◆ register_irq()

void ConfigBus::register_irq ( satcat5::cfg::Interrupt obj)
inherited

Add an interrupt handler.

Each ConfigBus interface has a single interrupt signal, which is the logical OR of interrupts from all attached peripherals. When any peripheral raises its interrupt signal, call irq_poll().

Definition at line 80 of file cfgbus_core.cc.


The documentation for this class was generated from the following files: