9 #include <satcat5/cfg_spi.h>
10 #include <satcat5/cfgbus_multiserial.h>
14 #ifndef SATCAT5_SPI_TXBUFF
15 #define SATCAT5_SPI_TXBUFF 256
18 #ifndef SATCAT5_SPI_RXBUFF
19 #define SATCAT5_SPI_RXBUFF 64
22 #ifndef SATCAT5_SPI_MAXCMD
23 #define SATCAT5_SPI_MAXCMD 16
60 u8 devidx,
const u8* wrdata, u8 rwbytes,
66 u8 devidx,
const u8* wrdata, u8 wrbytes, u8 rdbytes,
77 u8 m_txbuff[SATCAT5_SPI_TXBUFF];
78 u8 m_rxbuff[SATCAT5_SPI_RXBUFF];
Partial driver for the multipurpose serial peripheral.
SPI Event Handler callback for use with SpiGeneric.
Polymorphic API for a generic SPI interface.
Interface driver for the cfgbus_spi_controller block.
void configure(unsigned clkref_hz, unsigned baud_hz, unsigned mode=3)
Configure or reconfigure the SPI controller.
void read_done(unsigned cidx)
Callback when each transaction is finished.
bool busy() override
Is the SPI controller currently busy?
bool exchange(u8 devidx, const u8 *wrdata, u8 rwbytes, satcat5::cfg::SpiEventListener *callback=0) override
Queue a bus transaction that reads and writes concurrently.
bool query(u8 devidx, const u8 *wrdata, u8 wrbytes, u8 rdbytes, satcat5::cfg::SpiEventListener *callback=0) override
Queue a bus transation that reads, then writes.
Spi(ConfigBus *cfg, unsigned devaddr)
Link driver to a specific ConfigBus address.