aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/usrp/dboard_eeprom.hpp35
-rw-r--r--host/include/uhd/usrp/dboard_props.hpp2
-rw-r--r--host/include/uhd/usrp/mboard_props.hpp2
-rw-r--r--host/include/uhd/utils/algorithm.hpp14
4 files changed, 19 insertions, 34 deletions
diff --git a/host/include/uhd/usrp/dboard_eeprom.hpp b/host/include/uhd/usrp/dboard_eeprom.hpp
index 108027b46..394d71dd6 100644
--- a/host/include/uhd/usrp/dboard_eeprom.hpp
+++ b/host/include/uhd/usrp/dboard_eeprom.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,33 +26,32 @@
namespace uhd{ namespace usrp{
struct UHD_API dboard_eeprom_t{
- /*!
- * The dboard id that was read from eeprom or will be set to eeprom.
- */
+
+ //! The ID for the daughterboard type
dboard_id_t id;
+ //! The unique serial number
+ std::string serial;
+
/*!
- * Create a dboard eeprom struct from the bytes read out of eeprom.
- * The constructor will parse out the dboard id from a vector of bytes.
- * To be valid, the bytes vector should be at least num_bytes() long.
- * If the parsing fails due to bad checksum or incomplete length,
- * the dboard id in this struct will be set to dboard_id::NONE.
- * \param bytes the vector of bytes
+ * Create an empty dboard eeprom struct.
*/
- dboard_eeprom_t(const uhd::byte_vector_t &bytes = uhd::byte_vector_t(0));
+ dboard_eeprom_t(void);
/*!
- * Get the bytes that would be written to dboard eeprom.
- * \return a vector of bytes
+ * Load the object with bytes from the eeprom.
+ * \param iface the serial interface with i2c
+ * \param addr the i2c address for the eeprom
*/
- uhd::byte_vector_t get_eeprom_bytes(void);
+ void load(i2c_iface &iface, boost::uint8_t addr);
/*!
- * Get the number of bytes in the dboard eeprom segment.
- * Use this value when reading out of the dboard eeprom.
- * \return the number of bytes used by dboard eeprom
+ * Store the object to bytes in the eeprom.
+ * \param iface the serial interface with i2c
+ * \param addr the i2c address for the eeprom
*/
- static size_t num_bytes(void);
+ void store(i2c_iface &iface, boost::uint8_t addr);
+
};
}} //namespace
diff --git a/host/include/uhd/usrp/dboard_props.hpp b/host/include/uhd/usrp/dboard_props.hpp
index 32ec1c1bf..35721ab47 100644
--- a/host/include/uhd/usrp/dboard_props.hpp
+++ b/host/include/uhd/usrp/dboard_props.hpp
@@ -31,7 +31,7 @@ namespace uhd{ namespace usrp{
DBOARD_PROP_NAME, //ro, std::string
DBOARD_PROP_SUBDEV, //ro, wax::obj
DBOARD_PROP_SUBDEV_NAMES, //ro, prop_names_t
- DBOARD_PROP_DBOARD_ID, //rw, dboard_id_t
+ DBOARD_PROP_DBOARD_EEPROM, //rw, dboard_eeprom_t
DBOARD_PROP_DBOARD_IFACE, //ro, dboard_iface::sptr
DBOARD_PROP_CODEC, //ro, wax::obj
DBOARD_PROP_GAIN_GROUP //ro, gain_group
diff --git a/host/include/uhd/usrp/mboard_props.hpp b/host/include/uhd/usrp/mboard_props.hpp
index 2145ab446..180c4eeb3 100644
--- a/host/include/uhd/usrp/mboard_props.hpp
+++ b/host/include/uhd/usrp/mboard_props.hpp
@@ -47,7 +47,7 @@ namespace uhd{ namespace usrp{
MBOARD_PROP_CLOCK_CONFIG, //rw, clock_config_t
MBOARD_PROP_TIME_NOW, //rw, time_spec_t
MBOARD_PROP_TIME_PPS, //wo, time_spec_t
- MBOARD_PROP_EEPROM_MAP //wr, mboard_eeprom_t::sptr
+ MBOARD_PROP_EEPROM_MAP //wr, mboard_eeprom_t
};
}} //namespace
diff --git a/host/include/uhd/utils/algorithm.hpp b/host/include/uhd/utils/algorithm.hpp
index 5e2230371..d3a07db96 100644
--- a/host/include/uhd/utils/algorithm.hpp
+++ b/host/include/uhd/utils/algorithm.hpp
@@ -30,20 +30,6 @@
namespace std{
/*!
- * A wrapper around std::copy that takes ranges instead of iterators.
- *
- * Copy the elements of the source range into the destination range.
- * The destination range should be at least as large as the source range.
- *
- * \param src the range of elements to copy from
- * \param dst the range of elements to be filled
- */
- template<typename RangeSrc, typename RangeDst> inline
- void copy(const RangeSrc &src, RangeDst &dst){
- std::copy(boost::begin(src), boost::end(src), boost::begin(dst));
- }
-
- /*!
* A wrapper around std::sort that takes a range instead of an iterator.
*
* The elements are sorted into ascending order using the less-than operator.