UHD  003.004.002-0-unknown
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions
uhd::i2c_iface Class Reference

#include <serial.hpp>

Inheritance diagram for uhd::i2c_iface:
uhd::usrp::dboard_iface

List of all members.

Public Types

typedef boost::shared_ptr
< i2c_iface
sptr

Public Member Functions

virtual void write_i2c (boost::uint8_t addr, const byte_vector_t &buf)=0
virtual byte_vector_t read_i2c (boost::uint8_t addr, size_t num_bytes)=0
virtual void write_eeprom (boost::uint8_t addr, boost::uint8_t offset, const byte_vector_t &buf)
virtual byte_vector_t read_eeprom (boost::uint8_t addr, boost::uint8_t offset, size_t num_bytes)

Detailed Description

The i2c interface class: Provides i2c and eeprom functionality. A subclass should only have to implement the i2c routines. An eeprom implementation comes for free with the interface.

The eeprom routines are implemented on top of i2c. The built in eeprom implementation only does single byte reads and byte writes over the i2c interface, so it should be portable across multiple eeproms. Override the eeprom routines if this is not acceptable.


Member Typedef Documentation

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

Reimplemented in uhd::usrp::dboard_iface.


Member Function Documentation

virtual byte_vector_t uhd::i2c_iface::read_eeprom ( boost::uint8_t  addr,
boost::uint8_t  offset,
size_t  num_bytes 
)
virtual

Read bytes from an eeprom.

Parameters:
addrthe address
offsetbyte offset
num_bytesnumber of bytes to read
Returns:
a vector of bytes
virtual byte_vector_t uhd::i2c_iface::read_i2c ( boost::uint8_t  addr,
size_t  num_bytes 
)
pure virtual

Read bytes over the i2c.

Parameters:
addrthe address
num_bytesnumber of bytes to read
Returns:
a vector of bytes
virtual void uhd::i2c_iface::write_eeprom ( boost::uint8_t  addr,
boost::uint8_t  offset,
const byte_vector_t buf 
)
virtual

Write bytes to an eeprom.

Parameters:
addrthe address
offsetbyte offset
bufthe vector of bytes
virtual void uhd::i2c_iface::write_i2c ( boost::uint8_t  addr,
const byte_vector_t buf 
)
pure virtual

Write bytes over the i2c.

Parameters:
addrthe address
bufthe vector of bytes

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