UHD
003.005.005-0-g3c6a906c
|
#include <serial.hpp>
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) |
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.
typedef boost::shared_ptr<i2c_iface> uhd::i2c_iface::sptr |
|
virtual |
Read bytes from an eeprom.
addr | the address |
offset | byte offset |
num_bytes | number of bytes to read |
|
pure virtual |
Read bytes over the i2c.
addr | the address |
num_bytes | number of bytes to read |
|
virtual |
Write bytes to an eeprom.
addr | the address |
offset | byte offset |
buf | the vector of bytes |
|
pure virtual |
Write bytes over the i2c.
addr | the address |
buf | the vector of bytes |