SatCat5
satcat5::cfg::SpiGeneric Class Referenceabstract

Detailed Description

Polymorphic API for a generic SPI interface.

This a generic interface for issuing SPI transactions, to be implemented by any SPI controller.

See also
cfg::Spi. The child class must define all three virtual methods.

Definition at line 26 of file cfg_spi.h.

#include <cfg_spi.h>

Inheritance diagram for satcat5::cfg::SpiGeneric:
[legend]

Public Member Functions

virtual bool busy ()=0
 Is the SPI controller currently busy?
 
virtual bool exchange (u8 devidx, const u8 *wrdata, u8 rwbytes, satcat5::cfg::SpiEventListener *callback=0)=0
 Queue an exchange transaction (simultaneous write+read). More...
 
virtual bool query (u8 devidx, const u8 *wrdata, u8 wrbytes, u8 rdbytes, satcat5::cfg::SpiEventListener *callback=0)=0
 Queue a query transaction (write, read, or write-then-read). More...
 

Member Function Documentation

◆ exchange()

virtual bool satcat5::cfg::SpiGeneric::exchange ( u8  devidx,
const u8 *  wrdata,
u8  rwbytes,
satcat5::cfg::SpiEventListener callback = 0 
)
pure virtual

Queue an exchange transaction (simultaneous write+read).

Returns true if the command was added to the queue. Returns false if the user should try again later.

Implemented in satcat5::cfg::Spi, and satcat5::device::i2c::Sc18is602.

◆ query()

virtual bool satcat5::cfg::SpiGeneric::query ( u8  devidx,
const u8 *  wrdata,
u8  wrbytes,
u8  rdbytes,
satcat5::cfg::SpiEventListener callback = 0 
)
pure virtual

Queue a query transaction (write, read, or write-then-read).

Returns true if the command was added to the queue. Returns false if the user should try again later.

Implemented in satcat5::cfg::Spi, and satcat5::device::i2c::Sc18is602.


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