summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-08-31 17:32:55 -0700
committerNick Foster <nick@nerdnetworks.org>2010-08-31 17:32:55 -0700
commit7b066a4593646b6023f56283ff02cf0e4ee099a6 (patch)
tree1eae4b569139df3f1aae4095911281f17ee99cf0 /host/lib
parent0616872e35ac6429c19c2495bf4e378551bdd60e (diff)
downloaduhd-7b066a4593646b6023f56283ff02cf0e4ee099a6.tar.gz
uhd-7b066a4593646b6023f56283ff02cf0e4ee099a6.tar.bz2
uhd-7b066a4593646b6023f56283ff02cf0e4ee099a6.zip
Added usrp_serial_burner.cpp and capabilities for setting serial number in mboard_impl. Have not yet added read support.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/usrp1/mboard_impl.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp1/mboard_impl.cpp b/host/lib/usrp/usrp1/mboard_impl.cpp
index 1409855cb..8555577f5 100644
--- a/host/lib/usrp/usrp1/mboard_impl.cpp
+++ b/host/lib/usrp/usrp1/mboard_impl.cpp
@@ -19,6 +19,7 @@
#include "usrp_commands.h"
#include "fpga_regs_standard.h"
#include "fpga_regs_common.h"
+#include "usrp_i2c_addr.h"
#include <uhd/usrp/misc_utils.hpp>
#include <uhd/usrp/mboard_props.hpp>
#include <uhd/usrp/dboard_props.hpp>
@@ -321,11 +322,18 @@ void usrp1_impl::mboard_set(const wax::obj &key, const wax::obj &val)
{
if(key.type() == typeid(std::string)) {
if(key.as<std::string>() == "load_eeprom") {
- std::string usrp1_fpga_image = val.as<std::string>();
- std::cout << "USRP1 EEPROM image: " << usrp1_fpga_image << std::endl;
+ std::string usrp1_eeprom_image = val.as<std::string>();
+ std::cout << "USRP1 EEPROM image: " << usrp1_eeprom_image << std::endl;
_ctrl_transport->usrp_load_eeprom(val.as<std::string>());
}
+ if(key.as<std::string>() == "serial") {
+ std::string sernum = val.as<std::string>();
+ uhd::byte_vector_t buf(sernum.begin(), sernum.end());
+ buf.insert(buf.begin(), 248);
+ _iface->write_i2c(I2C_DEV_EEPROM, buf);
+ }
+
return;
}