From 7b066a4593646b6023f56283ff02cf0e4ee099a6 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Tue, 31 Aug 2010 17:32:55 -0700 Subject: Added usrp_serial_burner.cpp and capabilities for setting serial number in mboard_impl. Have not yet added read support. --- host/lib/usrp/usrp1/mboard_impl.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/usrp1') 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 #include #include @@ -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() == "load_eeprom") { - std::string usrp1_fpga_image = val.as(); - std::cout << "USRP1 EEPROM image: " << usrp1_fpga_image << std::endl; + std::string usrp1_eeprom_image = val.as(); + std::cout << "USRP1 EEPROM image: " << usrp1_eeprom_image << std::endl; _ctrl_transport->usrp_load_eeprom(val.as()); } + if(key.as() == "serial") { + std::string sernum = val.as(); + uhd::byte_vector_t buf(sernum.begin(), sernum.end()); + buf.insert(buf.begin(), 248); + _iface->write_i2c(I2C_DEV_EEPROM, buf); + } + return; } -- cgit v1.2.3