aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/n230/n230_eeprom_manager.hpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2016-01-05 09:52:22 -0800
committerAshish Chaudhari <ashish@ettus.com>2016-01-05 17:35:14 -0800
commit863ca545d629e0e40a21e085572440e764de882d (patch)
treeb33a602f6308c4c0838131239ab5a600a3546355 /host/lib/usrp/n230/n230_eeprom_manager.hpp
parentb3077692a3f49e517510b53e99129dd4f24209c7 (diff)
downloaduhd-863ca545d629e0e40a21e085572440e764de882d.tar.gz
uhd-863ca545d629e0e40a21e085572440e764de882d.tar.bz2
uhd-863ca545d629e0e40a21e085572440e764de882d.zip
n230: Added N230 device support
Diffstat (limited to 'host/lib/usrp/n230/n230_eeprom_manager.hpp')
-rw-r--r--host/lib/usrp/n230/n230_eeprom_manager.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/host/lib/usrp/n230/n230_eeprom_manager.hpp b/host/lib/usrp/n230/n230_eeprom_manager.hpp
new file mode 100644
index 000000000..612124d89
--- /dev/null
+++ b/host/lib/usrp/n230/n230_eeprom_manager.hpp
@@ -0,0 +1,58 @@
+//
+// Copyright 2013-2014 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
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#ifndef INCLUDED_N230_EEPROM_MANAGER_HPP
+#define INCLUDED_N230_EEPROM_MANAGER_HPP
+
+#include "../../../firmware/usrp3/n230/n230_fw_host_iface.h"
+#include <boost/thread/mutex.hpp>
+#include <uhd/transport/udp_simple.hpp>
+#include <uhd/types/dict.hpp>
+#include <uhd/usrp/mboard_eeprom.hpp>
+
+namespace uhd { namespace usrp { namespace n230 {
+
+class n230_eeprom_manager : boost::noncopyable
+{
+public:
+ n230_eeprom_manager(const std::string& addr);
+
+ const mboard_eeprom_t& read_mb_eeprom();
+ void write_mb_eeprom(const mboard_eeprom_t& eeprom);
+
+ inline const mboard_eeprom_t& get_mb_eeprom() {
+ return _mb_eeprom;
+ }
+
+private: //Functions
+ void _transact(const boost::uint32_t command);
+ void _flush_xport();
+
+private: //Members
+ mboard_eeprom_t _mb_eeprom;
+ transport::udp_simple::sptr _udp_xport;
+ n230_flash_prog_t _request;
+ n230_flash_prog_t _response;
+ boost::uint32_t _seq_num;
+ boost::mutex _mutex;
+
+ static const double UDP_TIMEOUT_IN_SEC;
+};
+
+}}} //namespace
+
+#endif /* INCLUDED_N230_EEPROM_MANAGER_HPP */