diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-10-31 14:30:52 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-11-08 08:02:22 -0800 |
commit | 99c2730bc9db270560671f2d7d173768465ed51f (patch) | |
tree | bc4df495734a075ebe2f7917cf67dec6fb7d8177 /host/lib/usrp/e300 | |
parent | 218f4b0b63927110df9dbbaa8353c346eee2d98a (diff) | |
download | uhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.gz uhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.bz2 uhd-99c2730bc9db270560671f2d7d173768465ed51f.zip |
Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with
stdint.h (The 'correct' replacement would be <cstdint>, but not all of our
compilers support that).
Diffstat (limited to 'host/lib/usrp/e300')
-rw-r--r-- | host/lib/usrp/e300/e300_eeprom_manager.cpp | 40 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_eeprom_manager.hpp | 48 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_fifo_config.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_fpga_defs.hpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_global_regs.cpp | 34 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_global_regs.hpp | 12 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_i2c.cpp | 106 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_i2c.hpp | 46 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_impl.cpp | 70 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_impl.hpp | 66 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_io_impl.cpp | 36 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_network.cpp | 36 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_remote_codec_ctrl.cpp | 116 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_remote_codec_ctrl.hpp | 50 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_sensor_manager.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_sensor_manager.hpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_spi.cpp | 18 |
17 files changed, 362 insertions, 362 deletions
diff --git a/host/lib/usrp/e300/e300_eeprom_manager.cpp b/host/lib/usrp/e300/e300_eeprom_manager.cpp index 00200747d..d43ca3d4c 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.cpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.cpp @@ -21,7 +21,7 @@ namespace uhd { namespace usrp { namespace e300 { -static const std::string _bytes_to_string(const boost::uint8_t* bytes, size_t max_len) +static const std::string _bytes_to_string(const uint8_t* bytes, size_t max_len) { std::string out; for (size_t i = 0; i < max_len; i++) { @@ -31,7 +31,7 @@ static const std::string _bytes_to_string(const boost::uint8_t* bytes, size_t ma return out; } -static void _string_to_bytes(const std::string &string, size_t max_len, boost::uint8_t* buffer) +static void _string_to_bytes(const std::string &string, size_t max_len, uint8_t* buffer) { byte_vector_t bytes; const size_t len = std::min(string.size(), max_len); @@ -56,7 +56,7 @@ const mboard_eeprom_t& e300_eeprom_manager::read_mb_eeprom(void) { boost::mutex::scoped_lock(_mutex); - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(mb_eeprom_map_t)); mb_eeprom_map_t *map_ptr = reinterpret_cast<mb_eeprom_map_t*>(&bytes[0]); memset(map_ptr, 0xff, sizeof(mb_eeprom_map_t)); @@ -68,9 +68,9 @@ const mboard_eeprom_t& e300_eeprom_manager::read_mb_eeprom(void) mb_eeprom_map_t &map = *map_ptr; _mb_eeprom["product"] = boost::lexical_cast<std::string>( - uhd::ntohx<boost::uint16_t>(map.hw_product)); + uhd::ntohx<uint16_t>(map.hw_product)); _mb_eeprom["revision"] = boost::lexical_cast<std::string>( - uhd::ntohx<boost::uint16_t>(map.hw_revision)); + uhd::ntohx<uint16_t>(map.hw_revision)); _mb_eeprom["serial"] = _bytes_to_string( map.serial, MB_SERIAL_LEN); @@ -87,7 +87,7 @@ const dboard_eeprom_t& e300_eeprom_manager::read_db_eeprom(void) { boost::mutex::scoped_lock(_mutex); - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(db_eeprom_map_t)); db_eeprom_map_t *map_ptr = reinterpret_cast<db_eeprom_map_t*>(&bytes[0]); memset(map_ptr, 0xff, sizeof(db_eeprom_map_t)); @@ -99,10 +99,10 @@ const dboard_eeprom_t& e300_eeprom_manager::read_db_eeprom(void) db_eeprom_map_t &map = *map_ptr; _db_eeprom.id = uhd::usrp::dboard_id_t::from_uint16( - uhd::ntohx<boost::uint16_t>(map.hw_product)); + uhd::ntohx<uint16_t>(map.hw_product)); _db_eeprom.revision = boost::lexical_cast<std::string>( - uhd::ntohx<boost::uint16_t>(map.hw_revision)); + uhd::ntohx<uint16_t>(map.hw_revision)); _db_eeprom.serial = _bytes_to_string( map.serial, DB_SERIAL_LEN); @@ -113,7 +113,7 @@ void e300_eeprom_manager::write_db_eeprom(const dboard_eeprom_t& eeprom) { boost::mutex::scoped_lock(_mutex); _db_eeprom = eeprom; - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(db_eeprom_map_t)); @@ -131,13 +131,13 @@ void e300_eeprom_manager::write_db_eeprom(const dboard_eeprom_t& eeprom) map.data_version_minor = E310_DB_MAP_MINOR; if (_db_eeprom.id != dboard_id_t::none()) { - map.hw_product = uhd::htonx<boost::uint16_t>( + map.hw_product = uhd::htonx<uint16_t>( _db_eeprom.id.to_uint16()); } if (not _db_eeprom.revision.empty()) { - map.hw_revision = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_db_eeprom.revision)); + map.hw_revision = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_db_eeprom.revision)); } if (not _db_eeprom.serial.empty()) { @@ -151,7 +151,7 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) { boost::mutex::scoped_lock(_mutex); _mb_eeprom = eeprom; - std::vector<boost::uint8_t> bytes; + std::vector<uint8_t> bytes; bytes.resize(sizeof(mb_eeprom_map_t)); @@ -170,12 +170,12 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) if (_mb_eeprom.has_key("product")) { - map.hw_product = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["product"])); + map.hw_product = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["product"])); } if (_mb_eeprom.has_key("revision")) { - map.hw_revision = uhd::htonx<boost::uint16_t>( - boost::lexical_cast<boost::uint16_t>(_mb_eeprom["revision"])); + map.hw_revision = uhd::htonx<uint16_t>( + boost::lexical_cast<uint16_t>(_mb_eeprom["revision"])); } if (_mb_eeprom.has_key("serial")) { _string_to_bytes(_mb_eeprom["serial"], MB_SERIAL_LEN, map.serial); @@ -198,13 +198,13 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) e300_eeprom_manager::mboard_t e300_eeprom_manager::get_mb_type(void) const { boost::mutex::scoped_lock(_mutex); - boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + uint16_t pid = boost::lexical_cast<uint16_t>( _mb_eeprom["product"]); return get_mb_type(pid); } e300_eeprom_manager::mboard_t e300_eeprom_manager::get_mb_type( - boost::uint16_t pid) + uint16_t pid) { switch (pid) { case E300_MB_PID: @@ -225,7 +225,7 @@ e300_eeprom_manager::mboard_t e300_eeprom_manager::get_mb_type( std::string e300_eeprom_manager::get_mb_type_string(void) const { boost::mutex::scoped_lock(_mutex); - boost::uint16_t product = boost::lexical_cast<boost::uint16_t>( + uint16_t product = boost::lexical_cast<uint16_t>( _mb_eeprom["product"]); switch (product) { case E300_MB_PID: diff --git a/host/lib/usrp/e300/e300_eeprom_manager.hpp b/host/lib/usrp/e300/e300_eeprom_manager.hpp index b06eeada9..14acfba26 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.hpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.hpp @@ -28,18 +28,18 @@ namespace uhd { namespace usrp { namespace e300 { -static const boost::uint16_t E300_MB_PID = 0x77d1; -static const boost::uint16_t E310_SG1_MB_PID = 0x77d2; -static const boost::uint16_t E310_SG3_MB_PID = 0x77d3; +static const uint16_t E300_MB_PID = 0x77d1; +static const uint16_t E310_SG1_MB_PID = 0x77d2; +static const uint16_t E310_SG3_MB_PID = 0x77d3; -static const boost::uint16_t E300_DB_PID = 0x0100; -static const boost::uint16_t E310_DB_PID = 0x0110; +static const uint16_t E300_DB_PID = 0x0100; +static const uint16_t E310_DB_PID = 0x0110; -static const boost::uint16_t E310_MB_MAP_MAJOR = 0x0001; -static const boost::uint16_t E310_MB_MAP_MINOR = 0x0000; +static const uint16_t E310_MB_MAP_MAJOR = 0x0001; +static const uint16_t E310_MB_MAP_MINOR = 0x0000; -static const boost::uint16_t E310_DB_MAP_MAJOR = 0x0001; -static const boost::uint16_t E310_DB_MAP_MINOR = 0x0000; +static const uint16_t E310_DB_MAP_MAJOR = 0x0001; +static const uint16_t E310_DB_MAP_MINOR = 0x0000; class e300_eeprom_manager : boost::noncopyable { @@ -72,7 +72,7 @@ public: enum mboard_t {USRP_E300_MB, USRP_E310_SG1_MB, USRP_E310_SG3_MB, UNKNOWN}; mboard_t get_mb_type(void) const; - static mboard_t get_mb_type(boost::uint16_t pid); + static mboard_t get_mb_type(uint16_t pid); std::string get_mb_type_string(void) const; private: // types @@ -86,37 +86,37 @@ private: // types struct mb_eeprom_map_t { // Data format version - boost::uint16_t data_version_major; - boost::uint16_t data_version_minor; + uint16_t data_version_major; + uint16_t data_version_minor; // NIC mac address - boost::uint8_t mac_addr[6]; + uint8_t mac_addr[6]; // HW identification info - boost::uint16_t hw_product; - boost::uint16_t hw_revision; + uint16_t hw_product; + uint16_t hw_revision; // serial - boost::uint8_t serial[MB_SERIAL_LEN]; - boost::uint8_t pad[20 - MB_SERIAL_LEN]; + uint8_t serial[MB_SERIAL_LEN]; + uint8_t pad[20 - MB_SERIAL_LEN]; //User specific - boost::uint8_t user_name[MB_NAME_LEN]; + uint8_t user_name[MB_NAME_LEN]; }; struct db_eeprom_map_t { // Data format version - boost::uint16_t data_version_major; - boost::uint16_t data_version_minor; + uint16_t data_version_major; + uint16_t data_version_minor; // HW identification info - boost::uint16_t hw_product; - boost::uint16_t hw_revision; + uint16_t hw_product; + uint16_t hw_revision; // serial - boost::uint8_t serial[DB_SERIAL_LEN]; - boost::uint8_t pad[20 - DB_SERIAL_LEN]; + uint8_t serial[DB_SERIAL_LEN]; + uint8_t pad[20 - DB_SERIAL_LEN]; }; private: // members diff --git a/host/lib/usrp/e300/e300_fifo_config.cpp b/host/lib/usrp/e300/e300_fifo_config.cpp index ac4ace7f2..4138bb581 100644 --- a/host/lib/usrp/e300/e300_fifo_config.cpp +++ b/host/lib/usrp/e300/e300_fifo_config.cpp @@ -17,7 +17,7 @@ #ifdef E300_NATIVE -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/config.hpp> // constants coded into the fpga parameters @@ -141,15 +141,15 @@ struct __mem_addrz_t /*********************************************************************** * peek n' poke mmapped space **********************************************************************/ -UHD_INLINE void zf_poke32(const boost::uint32_t addr, const boost::uint32_t data) +UHD_INLINE void zf_poke32(const uint32_t addr, const uint32_t data) { - volatile boost::uint32_t *p = reinterpret_cast<boost::uint32_t *>(addr); + volatile uint32_t *p = reinterpret_cast<uint32_t *>(addr); *p = data; } -UHD_INLINE boost::uint32_t zf_peek32(const boost::uint32_t addr) +UHD_INLINE uint32_t zf_peek32(const uint32_t addr) { - volatile const boost::uint32_t *p = reinterpret_cast<const boost::uint32_t *>(addr); + volatile const uint32_t *p = reinterpret_cast<const uint32_t *>(addr); return *p; } @@ -206,7 +206,7 @@ public: //UHD_MSG(status) << boost::format("data 0x%x") % addrs.data << std::endl; //UHD_MSG(status) << boost::format("ctrl 0x%x") % addrs.ctrl << std::endl; - const boost::uint32_t sig = zf_peek32(_addrs.ctrl + ARBITER_RD_SIG); + const uint32_t sig = zf_peek32(_addrs.ctrl + ARBITER_RD_SIG); UHD_ASSERT_THROW((sig >> 16) == 0xACE0); zf_poke32(_addrs.ctrl + ARBITER_WR_CLEAR, 1); @@ -240,7 +240,7 @@ public: { if (zf_peek32(_addrs.ctrl + ARBITER_RB_STATUS_OCC)) { - const boost::uint32_t sts = zf_peek32(_addrs.ctrl + ARBITER_RB_STATUS); + const uint32_t sts = zf_peek32(_addrs.ctrl + ARBITER_RB_STATUS); UHD_ASSERT_THROW((sts >> 7) & 0x1); //assert OK UHD_ASSERT_THROW((sts & 0xf) == _addrs.which); //expected tag zf_poke32(_addrs.ctrl + ARBITER_WR_STS_RDY, 1); //pop from sts fifo diff --git a/host/lib/usrp/e300/e300_fpga_defs.hpp b/host/lib/usrp/e300/e300_fpga_defs.hpp index 36dd47383..af54c0a9a 100644 --- a/host/lib/usrp/e300/e300_fpga_defs.hpp +++ b/host/lib/usrp/e300/e300_fpga_defs.hpp @@ -21,8 +21,8 @@ namespace uhd { namespace usrp { namespace e300 { namespace fpga { static const size_t NUM_RADIOS = 2; -static const boost::uint32_t COMPAT_MAJOR = 16; -static const boost::uint32_t COMPAT_MINOR = 0; +static const uint32_t COMPAT_MAJOR = 16; +static const uint32_t COMPAT_MINOR = 0; }}}} // namespace diff --git a/host/lib/usrp/e300/e300_global_regs.cpp b/host/lib/usrp/e300/e300_global_regs.cpp index 3ba895826..bfd166e67 100644 --- a/host/lib/usrp/e300/e300_global_regs.cpp +++ b/host/lib/usrp/e300/e300_global_regs.cpp @@ -17,7 +17,7 @@ #include "e300_global_regs.hpp" -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/exception.hpp> #include <uhd/utils/byteswap.hpp> #include <cstring> @@ -36,14 +36,14 @@ public: { } - boost::uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) + uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) { // setup readback register _poke32(_ctrl_base + global_regs::SR_CORE_READBACK, addr); return _peek32(_ctrl_base); } - void poke32(const uhd::wb_iface::wb_addr_type addr, const boost::uint32_t data) + void poke32(const uhd::wb_iface::wb_addr_type addr, const uint32_t data) { _poke32(_ctrl_base + static_cast<size_t>(addr), data); } @@ -52,15 +52,15 @@ public: private: const size_t _ctrl_base; - UHD_INLINE void _poke32(const boost::uint32_t addr, const boost::uint32_t data) + UHD_INLINE void _poke32(const uint32_t addr, const uint32_t data) { - volatile boost::uint32_t *p = reinterpret_cast<boost::uint32_t *>(addr); + volatile uint32_t *p = reinterpret_cast<uint32_t *>(addr); *p = data; } - UHD_INLINE boost::uint32_t _peek32(const boost::uint32_t addr) + UHD_INLINE uint32_t _peek32(const uint32_t addr) { - volatile const boost::uint32_t *p = reinterpret_cast<const boost::uint32_t *>(addr); + volatile const uint32_t *p = reinterpret_cast<const uint32_t *>(addr); return *p; } }; @@ -81,12 +81,12 @@ public: { } - boost::uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) + uint32_t peek32(const uhd::wb_iface::wb_addr_type addr) { global_regs_transaction_t transaction; - transaction.is_poke = uhd::htonx<boost::uint32_t>(0); - transaction.addr = uhd::htonx<boost::uint32_t>( - static_cast<boost::uint32_t>(addr)); + transaction.is_poke = uhd::htonx<uint32_t>(0); + transaction.addr = uhd::htonx<uint32_t>( + static_cast<uint32_t>(addr)); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) @@ -100,16 +100,16 @@ public: throw std::runtime_error("global_regs_zc_impl recv timeout"); std::memcpy(&transaction, buff->cast<const void *>(), sizeof(transaction)); } - return uhd::ntohx<boost::uint32_t>(transaction.data); + return uhd::ntohx<uint32_t>(transaction.data); } - void poke32(const uhd::wb_iface::wb_addr_type addr, const boost::uint32_t data) + void poke32(const uhd::wb_iface::wb_addr_type addr, const uint32_t data) { global_regs_transaction_t transaction; - transaction.is_poke = uhd::htonx<boost::uint32_t>(1); - transaction.addr = uhd::htonx<boost::uint32_t>( - static_cast<boost::uint32_t>(addr)); - transaction.data = uhd::htonx<boost::uint32_t>(data); + transaction.is_poke = uhd::htonx<uint32_t>(1); + transaction.addr = uhd::htonx<uint32_t>( + static_cast<uint32_t>(addr)); + transaction.data = uhd::htonx<uint32_t>(data); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) diff --git a/host/lib/usrp/e300/e300_global_regs.hpp b/host/lib/usrp/e300/e300_global_regs.hpp index 12693da79..3b6b26239 100644 --- a/host/lib/usrp/e300/e300_global_regs.hpp +++ b/host/lib/usrp/e300/e300_global_regs.hpp @@ -24,10 +24,10 @@ namespace uhd { namespace usrp { namespace e300 { struct global_regs_transaction_t { - boost::uint32_t is_poke; - boost::uint32_t addr; - boost::uint32_t data; - boost::uint32_t pad; + uint32_t is_poke; + uint32_t addr; + uint32_t data; + uint32_t pad; }; class global_regs : boost::noncopyable, public virtual uhd::wb_iface @@ -63,12 +63,12 @@ public: static const size_t PPS_EXT = 3; }; -UHD_INLINE boost::uint32_t XB_ADDR(const boost::uint32_t addr) +UHD_INLINE uint32_t XB_ADDR(const uint32_t addr) { return global_regs::SR_CORE_XBAR + (addr << 2); } -UHD_INLINE boost::uint32_t DST_ADDR(const boost::uint32_t addr) +UHD_INLINE uint32_t DST_ADDR(const uint32_t addr) { return global_regs::SR_CORE_DST + (addr << 2); } diff --git a/host/lib/usrp/e300/e300_i2c.cpp b/host/lib/usrp/e300/e300_i2c.cpp index d8f535a98..b3e872aff 100644 --- a/host/lib/usrp/e300/e300_i2c.cpp +++ b/host/lib/usrp/e300/e300_i2c.cpp @@ -37,14 +37,14 @@ public: } void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint8_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = WRITE | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); @@ -55,14 +55,14 @@ public: } } - boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) + uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) { i2c_transaction_t transaction; transaction.type = READ | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) @@ -80,14 +80,14 @@ public: } void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint16_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = WRITE | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); @@ -98,14 +98,14 @@ public: } } - boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) + uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) { i2c_transaction_t transaction; transaction.type = READ | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); if (not buff or buff->size() < sizeof(transaction)) @@ -145,14 +145,14 @@ public: } void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint8_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = i2c::WRITE | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; _xport->send( @@ -161,14 +161,14 @@ public: sizeof(transaction))); } - boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) + uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) { i2c_transaction_t transaction; transaction.type = i2c::READ | ONEBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = 0; _xport->send( @@ -176,7 +176,7 @@ public: &transaction, sizeof(transaction))); - boost::uint8_t buff[sizeof(i2c_transaction_t)] = {}; + uint8_t buff[sizeof(i2c_transaction_t)] = {}; const size_t nbytes = _xport->recv( boost::asio::buffer(buff), 0.100); if (not (nbytes == sizeof(transaction))) @@ -186,14 +186,14 @@ public: } void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint16_t reg, + const uint8_t value) { i2c_transaction_t transaction; transaction.type = i2c::WRITE | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = value; _xport->send( @@ -202,14 +202,14 @@ public: sizeof(transaction))); } - boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) + uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) { i2c_transaction_t transaction; transaction.type = i2c::READ | TWOBYTE; transaction.addr = addr; - transaction.reg = uhd::htonx<boost::uint16_t>(reg); + transaction.reg = uhd::htonx<uint16_t>(reg); transaction.data = 0; _xport->send( @@ -217,7 +217,7 @@ public: &transaction, sizeof(transaction))); - boost::uint8_t buff[sizeof(i2c_transaction_t)] = {}; + uint8_t buff[sizeof(i2c_transaction_t)] = {}; const size_t nbytes = _xport->recv( boost::asio::buffer(buff), 0.100); if (not (nbytes == sizeof(transaction))) @@ -248,7 +248,7 @@ i2c::sptr i2c::make_simple_udp( #include <sys/ioctl.h> #include <boost/thread.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> namespace uhd { namespace usrp { namespace e300 { @@ -268,11 +268,11 @@ public: } void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint8_t reg, + const uint8_t value) { - boost::uint8_t outbuf[2]; + uint8_t outbuf[2]; i2c_rdwr_ioctl_data packets; i2c_msg messages[1]; @@ -294,20 +294,20 @@ public: boost::this_thread::sleep(boost::posix_time::milliseconds(5)); } - boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) + uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) { i2c_rdwr_ioctl_data packets; i2c_msg messages[2]; - boost::uint8_t outbuf = reg; + uint8_t outbuf = reg; messages[0].addr = addr; messages[0].flags = 0; messages[0].len = sizeof(outbuf); messages[0].buf = &outbuf; - boost::uint8_t inbuf; + uint8_t inbuf; messages[1].addr = addr; messages[1].flags = I2C_M_RD; messages[1].len = sizeof(inbuf); @@ -325,11 +325,11 @@ public: // the daughterboard uses 16 bit addresses void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) + const uint8_t addr, + const uint16_t reg, + const uint8_t value) { - boost::uint8_t outbuf[3]; + uint8_t outbuf[3]; i2c_rdwr_ioctl_data packets; i2c_msg messages[1]; @@ -354,15 +354,15 @@ public: // the daughterboard eeprom uses 16 bit addresses - boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) + uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) { i2c_rdwr_ioctl_data packets; i2c_msg messages[2]; // always little endian - boost::uint8_t outbuf[2]; + uint8_t outbuf[2]; outbuf[0] = (reg >> 8) & 0xff; outbuf[1] = reg & 0xff; @@ -371,7 +371,7 @@ public: messages[0].len = sizeof(outbuf); messages[0].buf = outbuf; - boost::uint8_t inbuf; + uint8_t inbuf; messages[1].addr = addr; messages[1].flags = I2C_M_RD; messages[1].len = sizeof(inbuf); diff --git a/host/lib/usrp/e300/e300_i2c.hpp b/host/lib/usrp/e300/e300_i2c.hpp index 6cca7ab70..98a1f80aa 100644 --- a/host/lib/usrp/e300/e300_i2c.hpp +++ b/host/lib/usrp/e300/e300_i2c.hpp @@ -19,7 +19,7 @@ #define INCLUDED_E300_I2C_HPP #include <boost/noncopyable.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <boost/shared_ptr.hpp> #include <uhd/transport/zero_copy.hpp> @@ -27,10 +27,10 @@ namespace uhd { namespace usrp { namespace e300 { struct i2c_transaction_t { - boost::uint16_t reg; - boost::uint8_t addr; - boost::uint8_t data; - boost::uint8_t type; + uint16_t reg; + uint8_t addr; + uint8_t data; + uint8_t type; }; class i2c : public boost::noncopyable @@ -44,32 +44,32 @@ public: const std::string &ip_addr, const std::string &port); - virtual boost::uint8_t get_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg) = 0; + virtual uint8_t get_i2c_reg8( + const uint8_t addr, + const uint8_t reg) = 0; - virtual boost::uint8_t get_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg) = 0; + virtual uint8_t get_i2c_reg16( + const uint8_t addr, + const uint16_t reg) = 0; virtual void set_i2c_reg8( - const boost::uint8_t addr, - const boost::uint8_t reg, - const boost::uint8_t value) = 0; + const uint8_t addr, + const uint8_t reg, + const uint8_t value) = 0; virtual void set_i2c_reg16( - const boost::uint8_t addr, - const boost::uint16_t reg, - const boost::uint8_t value) = 0; + const uint8_t addr, + const uint16_t reg, + const uint8_t value) = 0; - static const boost::uint8_t DB_EEPROM_ADDR = 0x50; - static const boost::uint8_t MB_EEPROM_ADDR = 0x51; + static const uint8_t DB_EEPROM_ADDR = 0x50; + static const uint8_t MB_EEPROM_ADDR = 0x51; - static const boost::uint8_t WRITE = 0x1; - static const boost::uint8_t READ = 0x0; - static const boost::uint8_t TWOBYTE = 0x4; - static const boost::uint8_t ONEBYTE = 0x2; + static const uint8_t WRITE = 0x1; + static const uint8_t READ = 0x0; + static const uint8_t TWOBYTE = 0x4; + static const uint8_t ONEBYTE = 0x2; }; }}}; diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp index 114686b4f..84f50c67b 100644 --- a/host/lib/usrp/e300/e300_impl.cpp +++ b/host/lib/usrp/e300/e300_impl.cpp @@ -104,7 +104,7 @@ static std::vector<std::string> discover_ip_addrs( // loop for replies until timeout while (true) { - boost::uint8_t buff[sizeof(i2c_transaction_t)] = {}; + uint8_t buff[sizeof(i2c_transaction_t)] = {}; const size_t nbytes = udp_bcast_xport->recv(boost::asio::buffer(buff), 0.050); if (nbytes == 0) break; //No more responses @@ -273,7 +273,7 @@ static device::sptr e300_make(const device_addr_t &device_addr) void get_e3x0_fpga_images(const uhd::device_addr_t &device_addr, std::string &fpga_image, std::string &idle_image){ - const boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + const uint16_t pid = boost::lexical_cast<uint16_t>( device_addr["product"]); //extract the FPGA path for the e300 @@ -526,11 +526,11 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) gpio_atr_3000::sptr fp_gpio = gpio_atr_3000::make(_radio_perifs[0].ctrl, radio::sr_addr(radio::FP_GPIO), radio::RB32_FP_GPIO); BOOST_FOREACH(const gpio_attr_map_t::value_type attr, gpio_attr_map) { - _tree->create<boost::uint32_t>(mb_path / "gpio" / "INT0" / attr.second) + _tree->create<uint32_t>(mb_path / "gpio" / "INT0" / attr.second) .add_coerced_subscriber(boost::bind(&gpio_atr_3000::set_gpio_attr, fp_gpio, attr.first, _1)) .set(0); } - _tree->create<boost::uint8_t>(mb_path / "gpio" / "INT0" / "READBACK") + _tree->create<uint8_t>(mb_path / "gpio" / "INT0" / "READBACK") .set_publisher(boost::bind(&gpio_atr_3000::read_gpio, fp_gpio)); @@ -639,7 +639,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) uhd::sensor_value_t e300_impl::_get_fe_pll_lock(const bool is_tx) { - const boost::uint32_t st = + const uint32_t st = _global_regs->peek32(global_regs::RB32_CORE_PLL); const bool locked = is_tx ? ((st & 0x1) > 0) : ((st & 0x2) > 0); return sensor_value_t("LO", locked, "locked", "unlocked"); @@ -712,16 +712,16 @@ void e300_impl::_register_loopback_self_test(wb_iface::sptr iface) for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); - iface->poke32(radio::sr_addr(radio::TEST), boost::uint32_t(hash)); - test_fail = iface->peek32(radio::RB32_TEST) != boost::uint32_t(hash); + iface->poke32(radio::sr_addr(radio::TEST), uint32_t(hash)); + test_fail = iface->peek32(radio::RB32_TEST) != uint32_t(hash); if (test_fail) break; //exit loop on any failure } UHD_MSG(status) << ((test_fail)? " fail" : "pass") << std::endl; } -boost::uint32_t e300_impl::_get_version(compat_t which) +uint32_t e300_impl::_get_version(compat_t which) { - const boost::uint16_t compat_num + const uint16_t compat_num = _global_regs->peek32(global_regs::RB32_CORE_COMPAT); switch(which) { @@ -736,18 +736,18 @@ boost::uint32_t e300_impl::_get_version(compat_t which) std::string e300_impl::_get_version_hash(void) { - const boost::uint32_t git_hash + const uint32_t git_hash = _global_regs->peek32(global_regs::RB32_CORE_GITHASH); return str(boost::format("%7x%s") % (git_hash & 0x0FFFFFFF) % ((git_hash & 0xF000000) ? "-dirty" : "")); } -boost::uint32_t e300_impl::_allocate_sid(const sid_config_t &config) +uint32_t e300_impl::_allocate_sid(const sid_config_t &config) { - const boost::uint32_t stream = (config.dst_prefix | (config.router_dst_there << 2)) & 0xff; + const uint32_t stream = (config.dst_prefix | (config.router_dst_there << 2)) & 0xff; - const boost::uint32_t sid = 0 + const uint32_t sid = 0 | (E300_DEVICE_HERE << 24) | (_sid_framer << 16) | (config.router_addr_there << 8) @@ -785,7 +785,7 @@ boost::uint32_t e300_impl::_allocate_sid(const sid_config_t &config) return sid; } -void e300_impl::_setup_dest_mapping(const boost::uint32_t sid, const size_t which_stream) +void e300_impl::_setup_dest_mapping(const uint32_t sid, const size_t which_stream) { UHD_LOG << boost::format("Setting up dest map for 0x%lx to be stream %d") % (sid & 0xff) % which_stream << std::endl; @@ -825,44 +825,44 @@ void e300_impl::_sync_times() } size_t e300_impl::_get_axi_dma_channel( - boost::uint8_t destination, - boost::uint8_t prefix) + uint8_t destination, + uint8_t prefix) { - static const boost::uint32_t RADIO_GRP_SIZE = 4; - static const boost::uint32_t RADIO0_GRP = 0; - static const boost::uint32_t RADIO1_GRP = 1; + static const uint32_t RADIO_GRP_SIZE = 4; + static const uint32_t RADIO0_GRP = 0; + static const uint32_t RADIO1_GRP = 1; - boost::uint32_t radio_grp = (destination == E300_XB_DST_R0) ? RADIO0_GRP : RADIO1_GRP; + uint32_t radio_grp = (destination == E300_XB_DST_R0) ? RADIO0_GRP : RADIO1_GRP; return ((radio_grp * RADIO_GRP_SIZE) + prefix); } -boost::uint16_t e300_impl::_get_udp_port( - boost::uint8_t destination, - boost::uint8_t prefix) +uint16_t e300_impl::_get_udp_port( + uint8_t destination, + uint8_t prefix) { if (destination == E300_XB_DST_R0) { if (prefix == E300_RADIO_DEST_PREFIX_CTRL) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_CTRL_PORT0); + return boost::lexical_cast<uint16_t>(E300_SERVER_CTRL_PORT0); else if (prefix == E300_RADIO_DEST_PREFIX_TX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_TX_PORT0); + return boost::lexical_cast<uint16_t>(E300_SERVER_TX_PORT0); else if (prefix == E300_RADIO_DEST_PREFIX_RX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_RX_PORT0); + return boost::lexical_cast<uint16_t>(E300_SERVER_RX_PORT0); } else if (destination == E300_XB_DST_R1) { if (prefix == E300_RADIO_DEST_PREFIX_CTRL) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_CTRL_PORT1); + return boost::lexical_cast<uint16_t>(E300_SERVER_CTRL_PORT1); else if (prefix == E300_RADIO_DEST_PREFIX_TX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_TX_PORT1); + return boost::lexical_cast<uint16_t>(E300_SERVER_TX_PORT1); else if (prefix == E300_RADIO_DEST_PREFIX_RX) - return boost::lexical_cast<boost::uint16_t>(E300_SERVER_RX_PORT1); + return boost::lexical_cast<uint16_t>(E300_SERVER_RX_PORT1); } throw uhd::value_error(str(boost::format("No UDP port defined for combination: %u %u") % destination % prefix)); } e300_impl::both_xports_t e300_impl::_make_transport( - const boost::uint8_t &destination, - const boost::uint8_t &prefix, + const uint8_t &destination, + const uint8_t &prefix, const uhd::transport::zero_copy_xport_params ¶ms, - boost::uint32_t &sid) + uint32_t &sid) { both_xports_t xports; @@ -890,7 +890,7 @@ e300_impl::both_xports_t e300_impl::_make_transport( } else if (_xport_path == ETH) { // lookup which udp port we need // to use to create our transport - const boost::uint16_t port = _get_udp_port( + const uint16_t port = _get_udp_port( destination, prefix); @@ -950,7 +950,7 @@ void e300_impl::_setup_radio(const size_t dspno) //////////////////////////////////////////////////////////////////// // make a transport, grab a sid - boost::uint32_t ctrl_sid; + uint32_t ctrl_sid; both_xports_t ctrl_xports = _make_transport( dspno ? E300_XB_DST_R1 : E300_XB_DST_R0, E300_RADIO_DEST_PREFIX_CTRL, @@ -1102,7 +1102,7 @@ void e300_impl::_update_enables(void) void e300_impl::_update_gpio_state(void) { - boost::uint32_t misc_reg = 0 + uint32_t misc_reg = 0 | (_misc.pps_sel << gpio_t::PPS_SEL) | (_misc.mimo << gpio_t::MIMO) | (_misc.codec_arst << gpio_t::CODEC_ARST) diff --git a/host/lib/usrp/e300/e300_impl.hpp b/host/lib/usrp/e300/e300_impl.hpp index e9a0b4b9a..632424438 100644 --- a/host/lib/usrp/e300/e300_impl.hpp +++ b/host/lib/usrp/e300/e300_impl.hpp @@ -85,18 +85,18 @@ static const size_t E300_RX_FC_REQUEST_FREQ = 32; // per flow ctrl window static const size_t E300_TX_FC_RESPONSE_FREQ = 8; // per flow ctrl window // crossbar settings -static const boost::uint8_t E300_RADIO_DEST_PREFIX_TX = 0; -static const boost::uint8_t E300_RADIO_DEST_PREFIX_CTRL = 1; -static const boost::uint8_t E300_RADIO_DEST_PREFIX_RX = 2; +static const uint8_t E300_RADIO_DEST_PREFIX_TX = 0; +static const uint8_t E300_RADIO_DEST_PREFIX_CTRL = 1; +static const uint8_t E300_RADIO_DEST_PREFIX_RX = 2; -static const boost::uint8_t E300_XB_DST_AXI = 0; -static const boost::uint8_t E300_XB_DST_R0 = 1; -static const boost::uint8_t E300_XB_DST_R1 = 2; -static const boost::uint8_t E300_XB_DST_CE0 = 3; -static const boost::uint8_t E300_XB_DST_CE1 = 4; +static const uint8_t E300_XB_DST_AXI = 0; +static const uint8_t E300_XB_DST_R0 = 1; +static const uint8_t E300_XB_DST_R1 = 2; +static const uint8_t E300_XB_DST_CE0 = 3; +static const uint8_t E300_XB_DST_CE1 = 4; -static const boost::uint8_t E300_DEVICE_THERE = 2; -static const boost::uint8_t E300_DEVICE_HERE = 0; +static const uint8_t E300_DEVICE_THERE = 2; +static const uint8_t E300_DEVICE_HERE = 0; static const size_t E300_R0_CTRL_STREAM = (0 << 2) | E300_RADIO_DEST_PREFIX_CTRL; static const size_t E300_R0_TX_DATA_STREAM = (0 << 2) | E300_RADIO_DEST_PREFIX_TX; @@ -137,10 +137,10 @@ private: // types // sid convenience struct struct sid_config_t { - boost::uint8_t router_addr_there; - boost::uint8_t dst_prefix; //2bits - boost::uint8_t router_dst_there; - boost::uint8_t router_dst_here; + uint8_t router_addr_there; + uint8_t dst_prefix; //2bits + uint8_t router_dst_there; + uint8_t router_dst_here; }; // perifs in the radio core @@ -192,16 +192,16 @@ private: // types rx_bandsel_a(0), rx_bandsel_b(0), rx_bandsel_c(0) {} - boost::uint32_t pps_sel; - boost::uint32_t mimo; - boost::uint32_t codec_arst; + uint32_t pps_sel; + uint32_t mimo; + uint32_t codec_arst; - boost::uint32_t tx_bandsels; - boost::uint32_t rx_bandsel_a; - boost::uint32_t rx_bandsel_b; - boost::uint32_t rx_bandsel_c; + uint32_t tx_bandsels; + uint32_t rx_bandsel_a; + uint32_t rx_bandsel_b; + uint32_t rx_bandsel_c; - boost::uint32_t time_sync; + uint32_t time_sync; static const size_t PPS_SEL = 0; static const size_t MIMO = 2; @@ -216,30 +216,30 @@ private: // types private: // methods void _register_loopback_self_test(uhd::wb_iface::sptr iface); - boost::uint32_t _get_version(compat_t which); + uint32_t _get_version(compat_t which); std::string _get_version_hash(void); void _setup_radio(const size_t which_radio); - boost::uint32_t _allocate_sid(const sid_config_t &config); + uint32_t _allocate_sid(const sid_config_t &config); void _setup_dest_mapping( - const boost::uint32_t sid, + const uint32_t sid, const size_t which_stream); size_t _get_axi_dma_channel( - boost::uint8_t destination, - boost::uint8_t prefix); + uint8_t destination, + uint8_t prefix); - boost::uint16_t _get_udp_port( - boost::uint8_t destination, - boost::uint8_t prefix); + uint16_t _get_udp_port( + uint8_t destination, + uint8_t prefix); both_xports_t _make_transport( - const boost::uint8_t &destination, - const boost::uint8_t &prefix, + const uint8_t &destination, + const uint8_t &prefix, const uhd::transport::zero_copy_xport_params ¶ms, - boost::uint32_t &sid); + uint32_t &sid); double _get_tick_rate(void){return _tick_rate;} double _set_tick_rate(const double rate); diff --git a/host/lib/usrp/e300/e300_io_impl.cpp b/host/lib/usrp/e300/e300_io_impl.cpp index c84042e98..2514b7f40 100644 --- a/host/lib/usrp/e300/e300_io_impl.cpp +++ b/host/lib/usrp/e300/e300_io_impl.cpp @@ -35,7 +35,7 @@ using namespace uhd::transport; namespace uhd { namespace usrp { namespace e300 { -static const boost::uint32_t HW_SEQ_NUM_MASK = 0xfff; +static const uint32_t HW_SEQ_NUM_MASK = 0xfff; /*********************************************************************** * update streamer rates @@ -169,7 +169,7 @@ void e300_impl::_update_subdev_spec( * VITA stuff **********************************************************************/ static void e300_if_hdr_unpack_le( - const boost::uint32_t *packet_buff, + const uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -177,7 +177,7 @@ static void e300_if_hdr_unpack_le( } static void e300_if_hdr_pack_le( - boost::uint32_t *packet_buff, + uint32_t *packet_buff, vrt::if_packet_info_t &if_packet_info ){ if_packet_info.link_type = vrt::if_packet_info_t::LINK_TYPE_CHDR; @@ -240,7 +240,7 @@ static size_t get_rx_flow_control_window(size_t frame_size, size_t sw_buff_size, } static void handle_rx_flowctrl( - const boost::uint32_t sid, + const uint32_t sid, zero_copy_if::sptr xport, boost::shared_ptr<e300_rx_fc_cache_t> fc_cache, const size_t last_seq) @@ -254,7 +254,7 @@ static void handle_rx_flowctrl( { throw uhd::runtime_error("handle_rx_flowctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //recover seq32 size_t& seq_sw = fc_cache->last_seq_in; @@ -268,7 +268,7 @@ static void handle_rx_flowctrl( vrt::if_packet_info_t packet_info; packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT; packet_info.num_payload_words32 = RXFC_PACKET_LEN_IN_WORDS; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = seq_sw; packet_info.sob = false; packet_info.eob = false; @@ -283,11 +283,11 @@ static void handle_rx_flowctrl( e300_if_hdr_pack_le(pkt, packet_info); //load payload - pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htowx<boost::uint32_t>(0); - pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htowx<boost::uint32_t>(seq_sw); + pkt[packet_info.num_header_words32+RXFC_CMD_CODE_OFFSET] = uhd::htowx<uint32_t>(0); + pkt[packet_info.num_header_words32+RXFC_SEQ_NUM_OFFSET] = uhd::htowx<uint32_t>(seq_sw); //send the buffer over the interface - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); } @@ -326,8 +326,8 @@ static void handle_tx_async_msgs(boost::shared_ptr<e300_tx_fc_cache_t> fc_cache, //extract packet info vrt::if_packet_info_t if_packet_info; - if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); - const boost::uint32_t *packet_buff = buff->cast<const boost::uint32_t *>(); + if_packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); + const uint32_t *packet_buff = buff->cast<const uint32_t *>(); //unpacking can fail try @@ -350,7 +350,7 @@ static void handle_tx_async_msgs(boost::shared_ptr<e300_tx_fc_cache_t> fc_cache, //fill in the async metadata async_metadata_t metadata; - load_metadata_from_buff(uhd::wtohx<boost::uint32_t>, + load_metadata_from_buff(uhd::wtohx<uint32_t>, metadata, if_packet_info, packet_buff, get_tick_rate(), fc_cache->stream_channel); @@ -434,7 +434,7 @@ rx_streamer::sptr e300_impl::get_rx_stream(const uhd::stream_args_t &args_) radio_perifs_t &perif = _radio_perifs[radio_index]; // make a transport, grab a sid - boost::uint32_t data_sid; + uint32_t data_sid; both_xports_t data_xports = _make_transport( radio_index ? E300_XB_DST_R1 : E300_XB_DST_R0, E300_RADIO_DEST_PREFIX_RX, @@ -443,8 +443,8 @@ rx_streamer::sptr e300_impl::get_rx_stream(const uhd::stream_args_t &args_) //calculate packet size static const size_t hdr_size = 0 - + vrt::num_vrl_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::num_vrl_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used @@ -548,7 +548,7 @@ tx_streamer::sptr e300_impl::get_tx_stream(const uhd::stream_args_t &args_) // make a transport, grab a sid - boost::uint32_t data_sid; + uint32_t data_sid; both_xports_t data_xports = _make_transport( radio_index ? E300_XB_DST_R1 : E300_XB_DST_R0, E300_RADIO_DEST_PREFIX_TX, @@ -557,8 +557,8 @@ tx_streamer::sptr e300_impl::get_tx_stream(const uhd::stream_args_t &args_) //calculate packet size static const size_t hdr_size = 0 - + vrt::num_vrl_words32*sizeof(boost::uint32_t) - + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) + + vrt::num_vrl_words32*sizeof(uint32_t) + + vrt::max_if_hdr_words32*sizeof(uint32_t) + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer - sizeof(vrt::if_packet_info_t().cid) //no class id ever used - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp index 0aa5a21ae..e68f2a54d 100644 --- a/host/lib/usrp/e300/e300_network.cpp +++ b/host/lib/usrp/e300/e300_network.cpp @@ -190,7 +190,7 @@ static void e300_codec_ctrl_tunnel( std::memcpy(out, in, sizeof(codec_xact_t)); std::string which_str; - switch (uhd::ntohx<boost::uint32_t>(in->which)) { + switch (uhd::ntohx<uint32_t>(in->which)) { case codec_xact_t::CHAIN_TX1: which_str = "TX1"; break; case codec_xact_t::CHAIN_TX2: @@ -203,7 +203,7 @@ static void e300_codec_ctrl_tunnel( which_str = ""; break; } - switch (uhd::ntohx<boost::uint32_t>(in->action)) { + switch (uhd::ntohx<uint32_t>(in->action)) { case codec_xact_t::ACTION_SET_GAIN: out->gain = _codec_ctrl->set_gain(which_str, in->gain); break; @@ -212,10 +212,10 @@ static void e300_codec_ctrl_tunnel( break; case codec_xact_t::ACTION_SET_ACTIVE_CHANS: _codec_ctrl->set_active_chains( - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<0), - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<1), - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<2), - uhd::ntohx<boost::uint32_t>(in->bits) & (1<<3)); + uhd::ntohx<uint32_t>(in->bits) & (1<<0), + uhd::ntohx<uint32_t>(in->bits) & (1<<1), + uhd::ntohx<uint32_t>(in->bits) & (1<<2), + uhd::ntohx<uint32_t>(in->bits) & (1<<3)); break; case codec_xact_t::ACTION_TUNE: out->freq = _codec_ctrl->tune(which_str, in->freq); @@ -225,7 +225,7 @@ static void e300_codec_ctrl_tunnel( break; case codec_xact_t::ACTION_SET_LOOPBACK: _codec_ctrl->data_port_loopback( - uhd::ntohx<boost::uint32_t>(in->bits) & 1); + uhd::ntohx<uint32_t>(in->bits) & 1); break; case codec_xact_t::ACTION_GET_RSSI: out->rssi = _codec_ctrl->get_rssi(which_str).to_real(); @@ -254,7 +254,7 @@ static void e300_codec_ctrl_tunnel( default: UHD_MSG(status) << "Got unknown request?!" << std::endl; //Zero out actions to fail this request on client - out->action = uhd::htonx<boost::uint32_t>(0); + out->action = uhd::htonx<uint32_t>(0); } socket->send_to(asio::buffer(out_buff, 64), *endpoint); @@ -298,11 +298,11 @@ static void e300_global_regs_tunnel( global_regs_transaction_t *in = reinterpret_cast<global_regs_transaction_t *>(in_buff); - if(uhd::ntohx<boost::uint32_t>(in->is_poke)) { - regs->poke32(uhd::ntohx<boost::uint32_t>(in->addr), uhd::ntohx<boost::uint32_t>(in->data)); + if(uhd::ntohx<uint32_t>(in->is_poke)) { + regs->poke32(uhd::ntohx<uint32_t>(in->addr), uhd::ntohx<uint32_t>(in->data)); } else { - in->data = uhd::htonx<boost::uint32_t>(regs->peek32(uhd::ntohx<boost::uint32_t>(in->addr))); + in->data = uhd::htonx<uint32_t>(regs->peek32(uhd::ntohx<uint32_t>(in->addr))); socket->send_to(asio::buffer(in_buff, 16), *endpoint); } } @@ -347,10 +347,10 @@ static void e300_sensor_tunnel( if (uhd::ntohx(in->which) == ZYNQ_TEMP) { sensor_value_t temp = sensor_manager->get_mb_temp(); // TODO: This is ugly ... use proper serialization - in->value = uhd::htonx<boost::uint32_t>( + in->value = uhd::htonx<uint32_t>( e300_sensor_manager::pack_float_in_uint32_t(temp.to_real())); } else if (uhd::ntohx(in->which) == REF_LOCK) { - in->value = uhd::htonx<boost::uint32_t>( + in->value = uhd::htonx<uint32_t>( sensor_manager->get_ref_lock().to_bool() ? 1 : 0); } else UHD_MSG(status) << "Got unknown request?!" << std::endl; @@ -401,9 +401,9 @@ static void e300_i2c_tunnel( if(in->type & i2c::WRITE) { i2c->set_i2c_reg8( in->addr, - uhd::ntohx<boost::uint16_t>(in->reg), in->data); + uhd::ntohx<uint16_t>(in->reg), in->data); } else { - in->data = i2c->get_i2c_reg8(in->addr, uhd::ntohx<boost::uint16_t>(in->reg)); + in->data = i2c->get_i2c_reg8(in->addr, uhd::ntohx<uint16_t>(in->reg)); socket->send_to(asio::buffer(in_buff, sizeof(in_buff)), *endpoint); } @@ -412,9 +412,9 @@ static void e300_i2c_tunnel( if(in->type & i2c::WRITE) { i2c->set_i2c_reg16( in->addr, - uhd::ntohx<boost::uint16_t>(in->reg), in->data); + uhd::ntohx<uint16_t>(in->reg), in->data); } else { - in->data = i2c->get_i2c_reg16(in->addr, uhd::ntohx<boost::uint16_t>(in->reg)); + in->data = i2c->get_i2c_reg16(in->addr, uhd::ntohx<uint16_t>(in->reg)); socket->send_to(asio::buffer(in_buff, sizeof(in_buff)), *endpoint); } @@ -571,7 +571,7 @@ network_server_impl::network_server_impl(const uhd::device_addr_t &device_addr) // Else load the FPGA image based on the product ID } else { //extract the FPGA path for the e300 - const boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + const uint16_t pid = boost::lexical_cast<uint16_t>( _eeprom_manager->get_mb_eeprom()["product"]); std::string fpga_image; switch(e300_eeprom_manager::get_mb_type(pid)) { diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp index 6ec39131d..b7c46c17d 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp @@ -17,7 +17,7 @@ #include "e300_remote_codec_ctrl.hpp" -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/exception.hpp> #include <uhd/utils/byteswap.hpp> #include <cstring> @@ -36,17 +36,17 @@ public: { } - void set_timed_spi(uhd::spi_iface::sptr, boost::uint32_t ) {}; - void set_safe_spi(uhd::spi_iface::sptr, boost::uint32_t ) {}; + void set_timed_spi(uhd::spi_iface::sptr, uint32_t ) {}; + void set_safe_spi(uhd::spi_iface::sptr, uint32_t ) {}; double set_gain(const std::string &which, const double value) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_GAIN); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_GAIN); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.gain = value; @@ -57,9 +57,9 @@ public: double set_clock_rate(const double rate) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>( + _args.action = uhd::htonx<uint32_t>( transaction_t::ACTION_SET_CLOCK_RATE); - _args.which = uhd::htonx<boost::uint32_t>( + _args.which = uhd::htonx<uint32_t>( transaction_t::CHAIN_NONE); /*Unused*/ _args.rate = rate; @@ -70,12 +70,12 @@ public: void set_active_chains(bool tx1, bool tx2, bool rx1, bool rx2) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>( + _args.action = uhd::htonx<uint32_t>( transaction_t::ACTION_SET_ACTIVE_CHANS); /*Unused*/ - _args.which = uhd::htonx<boost::uint32_t>( + _args.which = uhd::htonx<uint32_t>( transaction_t::CHAIN_NONE); - _args.bits = uhd::htonx<boost::uint32_t>( + _args.bits = uhd::htonx<uint32_t>( (tx1 ? (1<<0) : 0) | (tx2 ? (1<<1) : 0) | (rx1 ? (1<<2) : 0) | @@ -87,11 +87,11 @@ public: double tune(const std::string &which, const double value) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_TUNE); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_TUNE); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.freq = value; @@ -102,11 +102,11 @@ public: double get_freq(const std::string &which) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_FREQ); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_GET_FREQ); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _transact(); @@ -116,9 +116,9 @@ public: void data_port_loopback(const bool on) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_LOOPBACK); - _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ - _args.bits = uhd::htonx<boost::uint32_t>(on ? 1 : 0); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_LOOPBACK); + _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ + _args.bits = uhd::htonx<uint32_t>(on ? 1 : 0); _transact(); } @@ -126,11 +126,11 @@ public: sensor_value_t get_rssi(const std::string &which) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_RSSI); - if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_GET_RSSI); + if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); - _args.bits = uhd::htonx<boost::uint32_t>(0); + _args.bits = uhd::htonx<uint32_t>(0); _transact(); return sensor_value_t("RSSI", _retval.rssi, "dB"); @@ -139,9 +139,9 @@ public: sensor_value_t get_temperature() { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_TEMPERATURE); - _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ - _args.bits = uhd::htonx<boost::uint32_t>(0); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_GET_TEMPERATURE); + _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_NONE); /*Unused*/ + _args.bits = uhd::htonx<uint32_t>(0); _transact(); return sensor_value_t("temp", _retval.temp, "C"); @@ -150,11 +150,11 @@ public: void set_dc_offset_auto(const std::string &which, const bool on) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_DC_OFFSET_AUTO); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_DC_OFFSET_AUTO); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.use_dc_correction = on ? 1 : 0; @@ -164,11 +164,11 @@ public: void set_iq_balance_auto(const std::string &which, const bool on) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_IQ_BALANCE_AUTO); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_IQ_BALANCE_AUTO); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.use_iq_correction = on ? 1 : 0; @@ -178,11 +178,11 @@ public: void set_agc(const std::string &which, bool enable) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_AGC); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_AGC); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.use_agc = enable ? 1 : 0; @@ -192,12 +192,12 @@ public: void set_agc_mode(const std::string &which, const std::string &mode) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_AGC_MODE); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_AGC_MODE); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); if(mode == "slow") { @@ -215,11 +215,11 @@ public: double set_bw_filter(const std::string &which, const double bw) { _clear(); - _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_BW); - if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); - else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); - else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); - else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + _args.action = uhd::htonx<uint32_t>(transaction_t::ACTION_SET_BW); + if (which == "TX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<uint32_t>(transaction_t::CHAIN_RX2); else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); _args.bw = bw; diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp index 43723e0d5..9453a6b39 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp @@ -27,8 +27,8 @@ class e300_remote_codec_ctrl : public uhd::usrp::ad9361_ctrl { public: struct transaction_t { - boost::uint32_t action; - boost::uint32_t which; + uint32_t action; + uint32_t which; union { double rate; double gain; @@ -36,34 +36,34 @@ public: double rssi; double temp; double bw; - boost::uint32_t use_dc_correction; - boost::uint32_t use_iq_correction; - boost::uint32_t use_agc; - boost::uint32_t agc_mode; - boost::uint64_t bits; + uint32_t use_dc_correction; + uint32_t use_iq_correction; + uint32_t use_agc; + uint32_t agc_mode; + uint64_t bits; }; //Actions - static const boost::uint32_t ACTION_SET_GAIN = 10; - static const boost::uint32_t ACTION_SET_CLOCK_RATE = 11; - static const boost::uint32_t ACTION_SET_ACTIVE_CHANS = 12; - static const boost::uint32_t ACTION_TUNE = 13; - static const boost::uint32_t ACTION_SET_LOOPBACK = 14; - static const boost::uint32_t ACTION_GET_RSSI = 15; - static const boost::uint32_t ACTION_GET_TEMPERATURE = 16; - static const boost::uint32_t ACTION_SET_DC_OFFSET_AUTO = 17; - static const boost::uint32_t ACTION_SET_IQ_BALANCE_AUTO = 18; - static const boost::uint32_t ACTION_SET_AGC = 19; - static const boost::uint32_t ACTION_SET_AGC_MODE = 20; - static const boost::uint32_t ACTION_SET_BW = 21; - static const boost::uint32_t ACTION_GET_FREQ = 22; + static const uint32_t ACTION_SET_GAIN = 10; + static const uint32_t ACTION_SET_CLOCK_RATE = 11; + static const uint32_t ACTION_SET_ACTIVE_CHANS = 12; + static const uint32_t ACTION_TUNE = 13; + static const uint32_t ACTION_SET_LOOPBACK = 14; + static const uint32_t ACTION_GET_RSSI = 15; + static const uint32_t ACTION_GET_TEMPERATURE = 16; + static const uint32_t ACTION_SET_DC_OFFSET_AUTO = 17; + static const uint32_t ACTION_SET_IQ_BALANCE_AUTO = 18; + static const uint32_t ACTION_SET_AGC = 19; + static const uint32_t ACTION_SET_AGC_MODE = 20; + static const uint32_t ACTION_SET_BW = 21; + static const uint32_t ACTION_GET_FREQ = 22; //Values for "which" - static const boost::uint32_t CHAIN_NONE = 0; - static const boost::uint32_t CHAIN_TX1 = 1; - static const boost::uint32_t CHAIN_TX2 = 2; - static const boost::uint32_t CHAIN_RX1 = 3; - static const boost::uint32_t CHAIN_RX2 = 4; + static const uint32_t CHAIN_NONE = 0; + static const uint32_t CHAIN_TX1 = 1; + static const uint32_t CHAIN_TX2 = 2; + static const uint32_t CHAIN_RX1 = 3; + static const uint32_t CHAIN_RX2 = 4; }; static sptr make(uhd::transport::zero_copy_if::sptr xport); diff --git a/host/lib/usrp/e300/e300_sensor_manager.cpp b/host/lib/usrp/e300/e300_sensor_manager.cpp index a4319fa4b..b96656e5e 100644 --- a/host/lib/usrp/e300/e300_sensor_manager.cpp +++ b/host/lib/usrp/e300/e300_sensor_manager.cpp @@ -55,7 +55,7 @@ public: { boost::mutex::scoped_lock(_mutex); sensor_transaction_t transaction; - transaction.which = uhd::htonx<boost::uint32_t>(ZYNQ_TEMP); + transaction.which = uhd::htonx<uint32_t>(ZYNQ_TEMP); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(1.0); @@ -80,7 +80,7 @@ public: buff->cast<const void *>(), sizeof(transaction)); } - UHD_ASSERT_THROW(uhd::ntohx<boost::uint32_t>(transaction.which) == ZYNQ_TEMP); + UHD_ASSERT_THROW(uhd::ntohx<uint32_t>(transaction.which) == ZYNQ_TEMP); // TODO: Use proper serialization here ... return sensor_value_t( "temp", @@ -93,7 +93,7 @@ public: { boost::mutex::scoped_lock(_mutex); sensor_transaction_t transaction; - transaction.which = uhd::htonx<boost::uint32_t>(REF_LOCK); + transaction.which = uhd::htonx<uint32_t>(REF_LOCK); { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(1.0); @@ -118,7 +118,7 @@ public: buff->cast<const void *>(), sizeof(transaction)); } - UHD_ASSERT_THROW(uhd::ntohx<boost::uint32_t>(transaction.which) == REF_LOCK); + UHD_ASSERT_THROW(uhd::ntohx<uint32_t>(transaction.which) == REF_LOCK); // TODO: Use proper serialization here ... return sensor_value_t("Ref", (uhd::ntohx(transaction.value) > 0), "locked", "unlocked"); } @@ -185,10 +185,10 @@ public: //PPSLOOP_LOCKED_MASK is asserted in the following cases: //- (Time source = GPS or External) AND (Loop is locked and is in fine adj mode) //- Time source is Internal - static const boost::uint32_t PPSLOOP_LOCKED_MASK = 0x04; - static const boost::uint32_t REFPLL_LOCKED_MASK = 0x20; + static const uint32_t PPSLOOP_LOCKED_MASK = 0x04; + static const uint32_t REFPLL_LOCKED_MASK = 0x20; - const boost::uint32_t status = + const uint32_t status = _global_regs->peek32(global_regs::RB32_CORE_MISC); bool ref_locked = (status & PPSLOOP_LOCKED_MASK) && (status & REFPLL_LOCKED_MASK); diff --git a/host/lib/usrp/e300/e300_sensor_manager.hpp b/host/lib/usrp/e300/e300_sensor_manager.hpp index 1252e07b9..c2d31bff7 100644 --- a/host/lib/usrp/e300/e300_sensor_manager.hpp +++ b/host/lib/usrp/e300/e300_sensor_manager.hpp @@ -16,7 +16,7 @@ // #include <boost/noncopyable.hpp> -#include <boost/cstdint.hpp> +#include <stdint.h> #include <uhd/transport/zero_copy.hpp> #include <uhd/types/sensors.hpp> @@ -30,10 +30,10 @@ namespace uhd { namespace usrp { namespace e300 { struct sensor_transaction_t { - boost::uint32_t which; + uint32_t which; union { - boost::uint32_t value; - boost::uint32_t value64; + uint32_t value; + uint32_t value64; }; }; @@ -59,13 +59,13 @@ public: static sptr make_local(global_regs::sptr global_regs); // Note: This is a hack - static boost::uint32_t pack_float_in_uint32_t(const float &v) + static uint32_t pack_float_in_uint32_t(const float &v) { - const boost::uint32_t *cast = reinterpret_cast<const boost::uint32_t*>(&v); + const uint32_t *cast = reinterpret_cast<const uint32_t*>(&v); return *cast; } - static float unpack_float_from_uint32_t(const boost::uint32_t &v) + static float unpack_float_from_uint32_t(const uint32_t &v) { const float *cast = reinterpret_cast<const float*>(&v); return *cast; diff --git a/host/lib/usrp/e300/e300_spi.cpp b/host/lib/usrp/e300/e300_spi.cpp index 74d348555..906b32474 100644 --- a/host/lib/usrp/e300/e300_spi.cpp +++ b/host/lib/usrp/e300/e300_spi.cpp @@ -75,20 +75,20 @@ public: close(_fd); } - boost::uint32_t transact_spi(int, const uhd::spi_config_t &, - boost::uint32_t data, size_t num_bits, + uint32_t transact_spi(int, const uhd::spi_config_t &, + uint32_t data, size_t num_bits, bool) { int ret(0); struct spi_ioc_transfer tr; - boost::uint8_t *tx_data = reinterpret_cast<boost::uint8_t *>(&data); + uint8_t *tx_data = reinterpret_cast<uint8_t *>(&data); UHD_ASSERT_THROW(num_bits == 24); - boost::uint8_t tx[] = {tx_data[2], tx_data[1], tx_data[0]}; + uint8_t tx[] = {tx_data[2], tx_data[1], tx_data[0]}; - boost::uint8_t rx[3]; + uint8_t rx[3]; tr.tx_buf = (unsigned long) &tx[0]; tr.rx_buf = (unsigned long) &rx[0]; tr.len = num_bits >> 3; @@ -107,10 +107,10 @@ public: private: int _fd; - boost::uint8_t _mode; - boost::uint32_t _speed; - boost::uint8_t _bits; - boost::uint16_t _delay; + uint8_t _mode; + uint32_t _speed; + uint8_t _bits; + uint16_t _delay; }; spi::sptr spi::make(const std::string &device) |