aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1/usrp1_iface.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-08-31 16:44:30 -0700
committerNick Foster <nick@nerdnetworks.org>2010-08-31 16:44:30 -0700
commitb96088b692a5c44974919ee36e253b6ea8c51972 (patch)
tree5200ca3a1b589a83aca06e91c559154ddea82249 /host/lib/usrp/usrp1/usrp1_iface.cpp
parentad55e25aeb273fb7278c6d5175cd0df01fc90924 (diff)
downloaduhd-b96088b692a5c44974919ee36e253b6ea8c51972.tar.gz
uhd-b96088b692a5c44974919ee36e253b6ea8c51972.tar.bz2
uhd-b96088b692a5c44974919ee36e253b6ea8c51972.zip
EEPROM burning in UHD. Changed some USB device handle stuff. Added usrp_init_eeprom.cpp. Hacked up the firmware makefile to behave and to generate .bin EEPROM images instead of IHX.
Diffstat (limited to 'host/lib/usrp/usrp1/usrp1_iface.cpp')
-rw-r--r--host/lib/usrp/usrp1/usrp1_iface.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp
index 8756a21c9..4bc18dd16 100644
--- a/host/lib/usrp/usrp1/usrp1_iface.cpp
+++ b/host/lib/usrp/usrp1/usrp1_iface.cpp
@@ -109,18 +109,19 @@ public:
******************************************************************/
static const size_t max_i2c_data_bytes = 64;
+ //TODO: make this handle EEPROM page sizes. right now you can't write over a 16-byte boundary.
+ //to accomplish this you'll have to have addr offset as a separate parameter.
+
void write_i2c(boost::uint8_t addr, const byte_vector_t &bytes)
{
UHD_ASSERT_THROW(bytes.size() < max_i2c_data_bytes);
unsigned char buff[max_i2c_data_bytes];
- std::copy(bytes.begin(), bytes.end(), buff);
+ std::copy(bytes.begin(), bytes.end(), buff);
- int ret = _ctrl_transport->usrp_control_write(VRQ_I2C_WRITE,
- addr & 0xff,
- 0,
- buff,
- bytes.size());
+ int ret = _ctrl_transport->usrp_i2c_write(addr & 0xff,
+ buff,
+ bytes.size());
// TODO throw and catch i2c failures during eeprom read
if (iface_debug && (ret < 0))
@@ -132,11 +133,9 @@ public:
UHD_ASSERT_THROW(num_bytes < max_i2c_data_bytes);
unsigned char buff[max_i2c_data_bytes];
- int ret = _ctrl_transport->usrp_control_read(VRQ_I2C_READ,
- addr & 0xff,
- 0,
- buff,
- num_bytes);
+ int ret = _ctrl_transport->usrp_i2c_read(addr & 0xff,
+ buff,
+ num_bytes);
// TODO throw and catch i2c failures during eeprom read
if (iface_debug && ((ret < 0) || (unsigned)ret < (num_bytes))) {