From c9bf4798cc19e9ac9bf2fbcfeeae7ed26936b19d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 5 May 2011 14:58:18 -0700 Subject: usrp1: overload read_eeprom to handle multi-byte reads --- host/lib/usrp/usrp1/usrp1_iface.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp index f66337ef9..0942e2613 100644 --- a/host/lib/usrp/usrp1/usrp1_iface.cpp +++ b/host/lib/usrp/usrp1/usrp1_iface.cpp @@ -165,6 +165,17 @@ public: return out_bytes; } + //! overload read_eeprom to handle multi-byte reads + byte_vector_t read_eeprom( + boost::uint8_t addr, + boost::uint8_t offset, + size_t num_bytes + ){ + //do a zero byte write to start read cycle + this->write_i2c(addr, byte_vector_t(1, offset)); + return this->read_i2c(addr, num_bytes); //read all bytes + } + /******************************************************************* * SPI * -- cgit v1.2.3