UHD 003.004.003-0-unknown

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
uhd::spi_iface Class Referenceabstract

`#include <serial.hpp>`

## Public Types
typedef boost::shared_ptr < spi_iface > | sptr

## Public Member Functions
virtual boost::uint32_t | transact_spi (int which_slave, const spi_config_t &config, boost::uint32_t data, size_t num_bits, bool readback)=0
virtual boost::uint32_t | read_spi (int which_slave, const spi_config_t &config, boost::uint32_t data, size_t num_bits)
virtual void | write_spi (int which_slave, const spi_config_t &config, boost::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

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

## Member Function Documentation

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

Read from the SPI bus.

Parameters

  which_slave | the slave device number
  config | spi config args
  data | the bits to write out (be sure to set write bit)
  num_bits | how many bits in data

Returns
  spi data

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

Perform a spi transaction.

Parameters

  which_slave | the slave device number
  config | spi config args
  data | the bits to write
  num_bits | how many bits in data
  readback | true to readback a value

Returns
  spi data if readback set

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

Write to the SPI bus.

Parameters

  which_slave | the slave device number
  config | spi config args
  data | the bits to write
  num_bits | how many bits in data

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

- include/uhd/types/serial.hpp