USRP Hardware Driver and USRP Manual Version: 4.1.0.3
UHD and USRP Manual
uhd::spi_iface Class Referenceabstract

#include <uhd/types/serial.hpp>

Public Types

typedef std::shared_ptr< spi_ifacesptr
 

Public Member Functions

virtual ~spi_iface (void)
 
virtual uint32_t transact_spi (int which_slave, const spi_config_t &config, uint32_t data, size_t num_bits, bool readback)=0
 
virtual uint32_t read_spi (int which_slave, const spi_config_t &config, uint32_t data, size_t num_bits)
 
virtual void write_spi (int which_slave, const spi_config_t &config, uint32_t data, size_t num_bits)
 

Detailed Description

The SPI interface class. Provides routines to transact SPI and do other useful things which haven't been defined yet.

Member Typedef Documentation

◆ sptr

typedef std::shared_ptr<spi_iface> uhd::spi_iface::sptr

Constructor & Destructor Documentation

◆ ~spi_iface()

virtual uhd::spi_iface::~spi_iface ( void  )
virtual

Member Function Documentation

◆ read_spi()

virtual uint32_t uhd::spi_iface::read_spi ( int  which_slave,
const spi_config_t config,
uint32_t  data,
size_t  num_bits 
)
virtual

Read from the SPI bus.

Parameters
which_slavethe slave device number
configspi config args
datathe bits to write out (be sure to set write bit)
num_bitshow many bits in data
Returns
spi data

◆ transact_spi()

virtual uint32_t uhd::spi_iface::transact_spi ( int  which_slave,
const spi_config_t config,
uint32_t  data,
size_t  num_bits,
bool  readback 
)
pure virtual

Perform a spi transaction.

Parameters
which_slavethe slave device number
configspi config args
datathe bits to write
num_bitshow many bits in data
readbacktrue to readback a value
Returns
spi data if readback set

◆ write_spi()

virtual void uhd::spi_iface::write_spi ( int  which_slave,
const spi_config_t config,
uint32_t  data,
size_t  num_bits 
)
virtual

Write to the SPI bus.

Parameters
which_slavethe slave device number
configspi config args
datathe bits to write
num_bitshow many bits in data

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