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/e300_i2c.cpp | |
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/e300_i2c.cpp')
-rw-r--r-- | host/lib/usrp/e300/e300_i2c.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
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); |