diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-11-08 08:41:46 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-11-08 08:41:46 -0800 |
commit | 9b852f5f243e5cf68662b7152b5fa331a83e55fb (patch) | |
tree | 159ffe0761f78dd87e2ecc97abea14494abab4ff /host/lib/usrp/e300/e300_i2c.cpp | |
parent | c66cb1bad0d881394f3519bd94f4693cceab4c64 (diff) | |
parent | 99c2730bc9db270560671f2d7d173768465ed51f (diff) | |
download | uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.tar.gz uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.tar.bz2 uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.zip |
Merge branch 'maint'
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); |