aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_iface.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-23 19:21:47 -0700
committerJosh Blum <josh@joshknows.com>2010-04-23 19:21:47 -0700
commit039eceb4b208b2ca5a3465d2f16c8d5a7c7276c7 (patch)
tree3227f8f1656db4b4ae4c7f932ba7a3a24f6065db /host/lib/usrp/usrp2/usrp2_iface.hpp
parent0c3af59014f1ef3f03c099a15e74d3cdc629ef7e (diff)
downloaduhd-039eceb4b208b2ca5a3465d2f16c8d5a7c7276c7.tar.gz
uhd-039eceb4b208b2ca5a3465d2f16c8d5a7c7276c7.tar.bz2
uhd-039eceb4b208b2ca5a3465d2f16c8d5a7c7276c7.zip
Moved reading the eeprom (dboard ids) onto the host.
Created a eeprom parser for the format in the dboard. Removed the support from the microblaze code.
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_iface.hpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.hpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp
index 6667c8998..938359677 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.hpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.hpp
@@ -25,6 +25,15 @@
#include <boost/cstdint.hpp>
#include "fw_common.h"
+////////////////////////////////////////////////////////////////////////
+// I2C addresses
+////////////////////////////////////////////////////////////////////////
+#define I2C_DEV_EEPROM 0x50 // 24LC02[45]: 7-bits 1010xxx
+#define I2C_ADDR_MBOARD (I2C_DEV_EEPROM | 0x0)
+#define I2C_ADDR_TX_DB (I2C_DEV_EEPROM | 0x4)
+#define I2C_ADDR_RX_DB (I2C_DEV_EEPROM | 0x5)
+////////////////////////////////////////////////////////////////////////
+
/*!
* The usrp2 interface class:
* Provides a set of functions to implementation layer.
@@ -94,6 +103,52 @@ public:
) = 0;
/*!
+ * Write bytes over the i2c.
+ * \param addr the address
+ * \param buf the vector of bytes
+ */
+ virtual void write_i2c(
+ boost::uint8_t addr,
+ const uhd::byte_vector_t &buf
+ ) = 0;
+
+ /*!
+ * Read bytes over the i2c.
+ * \param addr the address
+ * \param num_bytes number of bytes to read
+ * \return a vector of bytes
+ */
+ virtual uhd::byte_vector_t read_i2c(
+ boost::uint8_t addr,
+ size_t num_bytes
+ ) = 0;
+
+ /*!
+ * Write bytes to an eeprom.
+ * \param addr the address
+ * \param offset byte offset
+ * \param buf the vector of bytes
+ */
+ virtual void write_eeprom(
+ boost::uint8_t addr,
+ boost::uint8_t offset,
+ const uhd::byte_vector_t &buf
+ ) = 0;
+
+ /*!
+ * Read bytes from an eeprom.
+ * \param addr the address
+ * \param offset byte offset
+ * \param num_bytes number of bytes to read
+ * \return a vector of bytes
+ */
+ virtual uhd::byte_vector_t read_eeprom(
+ boost::uint8_t addr,
+ boost::uint8_t offset,
+ size_t num_bytes
+ ) = 0;
+
+ /*!
* Get the master clock frequency.
* \return the frequency in Hz
*/