aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-10-31 14:30:52 -0700
committerMartin Braun <martin.braun@ettus.com>2016-11-08 08:02:22 -0800
commit99c2730bc9db270560671f2d7d173768465ed51f (patch)
treebc4df495734a075ebe2f7917cf67dec6fb7d8177 /host/lib/usrp/usrp1
parent218f4b0b63927110df9dbbaa8353c346eee2d98a (diff)
downloaduhd-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/usrp1')
-rw-r--r--host/lib/usrp/usrp1/codec_ctrl.cpp38
-rw-r--r--host/lib/usrp/usrp1/dboard_iface.cpp94
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp12
-rw-r--r--host/lib/usrp/usrp1/usrp1_calc_mux.hpp4
-rw-r--r--host/lib/usrp/usrp1/usrp1_iface.cpp44
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp30
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.hpp2
7 files changed, 112 insertions, 112 deletions
diff --git a/host/lib/usrp/usrp1/codec_ctrl.cpp b/host/lib/usrp/usrp1/codec_ctrl.cpp
index 8ba7b54ca..4c811d5e2 100644
--- a/host/lib/usrp/usrp1/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp1/codec_ctrl.cpp
@@ -23,7 +23,7 @@
#include <uhd/exception.hpp>
#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/byteswap.hpp>
-#include <boost/cstdint.hpp>
+#include <stdint.h>
#include <boost/format.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/math/special_functions/round.hpp>
@@ -70,8 +70,8 @@ private:
spi_iface::sptr _iface;
int _spi_slave;
ad9862_regs_t _ad9862_regs;
- void send_reg(boost::uint8_t addr);
- void recv_reg(boost::uint8_t addr);
+ void send_reg(uint8_t addr);
+ void recv_reg(uint8_t addr);
double coarse_tune(double codec_rate, double freq);
double fine_tune(double codec_rate, double freq);
@@ -124,7 +124,7 @@ usrp1_codec_ctrl_impl::usrp1_codec_ctrl_impl(spi_iface::sptr iface, int spi_slav
_ad9862_regs.clkout2_div_factor = ad9862_regs_t::CLKOUT2_DIV_FACTOR_2;
//write the register settings to the codec
- for (boost::uint8_t addr = 0; addr <= 25; addr++) {
+ for (uint8_t addr = 0; addr <= 25; addr++) {
this->send_reg(addr);
}
@@ -198,9 +198,9 @@ double usrp1_codec_ctrl_impl::get_rx_pga_gain(char which){
/***********************************************************************
* Codec Control AUX ADC Methods
**********************************************************************/
-static double aux_adc_to_volts(boost::uint8_t high, boost::uint8_t low)
+static double aux_adc_to_volts(uint8_t high, uint8_t low)
{
- return double(((boost::uint16_t(high) << 2) | low)*3.3)/0x3ff;
+ return double(((uint16_t(high) << 2) | low)*3.3)/0x3ff;
}
double usrp1_codec_ctrl_impl::read_aux_adc(aux_adc_t which){
@@ -243,19 +243,19 @@ void usrp1_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts)
{
//special case for aux dac d (aka sigma delta word)
if (which == AUX_DAC_D) {
- boost::uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff);
- _ad9862_regs.sig_delt_11_4 = boost::uint8_t(dac_word >> 4);
- _ad9862_regs.sig_delt_3_0 = boost::uint8_t(dac_word & 0xf);
+ uint16_t dac_word = uhd::clip(boost::math::iround(volts*0xfff/3.3), 0, 0xfff);
+ _ad9862_regs.sig_delt_11_4 = uint8_t(dac_word >> 4);
+ _ad9862_regs.sig_delt_3_0 = uint8_t(dac_word & 0xf);
this->send_reg(42);
this->send_reg(43);
return;
}
//calculate the dac word for aux dac a, b, c
- boost::uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff);
+ uint8_t dac_word = uhd::clip(boost::math::iround(volts*0xff/3.3), 0, 0xff);
//setup a lookup table for the aux dac params (reg ref, reg addr)
- typedef boost::tuple<boost::uint8_t*, boost::uint8_t> dac_params_t;
+ typedef boost::tuple<uint8_t*, uint8_t> dac_params_t;
uhd::dict<aux_dac_t, dac_params_t> aux_dac_to_params = boost::assign::map_list_of
(AUX_DAC_A, dac_params_t(&_ad9862_regs.aux_dac_a, 36))
(AUX_DAC_B, dac_params_t(&_ad9862_regs.aux_dac_b, 37))
@@ -264,7 +264,7 @@ void usrp1_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts)
//set the aux dac register
UHD_ASSERT_THROW(aux_dac_to_params.has_key(which));
- boost::uint8_t *reg_ref, reg_addr;
+ uint8_t *reg_ref, reg_addr;
boost::tie(reg_ref, reg_addr) = aux_dac_to_params[which];
*reg_ref = dac_word;
this->send_reg(reg_addr);
@@ -273,9 +273,9 @@ void usrp1_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts)
/***********************************************************************
* Codec Control SPI Methods
**********************************************************************/
-void usrp1_codec_ctrl_impl::send_reg(boost::uint8_t addr)
+void usrp1_codec_ctrl_impl::send_reg(uint8_t addr)
{
- boost::uint32_t reg = _ad9862_regs.get_write_reg(addr);
+ uint32_t reg = _ad9862_regs.get_write_reg(addr);
UHD_LOGV(often)
<< "codec control write reg: 0x"
@@ -285,16 +285,16 @@ void usrp1_codec_ctrl_impl::send_reg(boost::uint8_t addr)
spi_config_t::EDGE_RISE, reg, 16);
}
-void usrp1_codec_ctrl_impl::recv_reg(boost::uint8_t addr)
+void usrp1_codec_ctrl_impl::recv_reg(uint8_t addr)
{
- boost::uint32_t reg = _ad9862_regs.get_read_reg(addr);
+ uint32_t reg = _ad9862_regs.get_read_reg(addr);
UHD_LOGV(often)
<< "codec control read reg: 0x"
<< std::setw(8) << std::hex << reg << std::endl
;
- boost::uint32_t ret = _iface->read_spi(_spi_slave,
+ uint32_t ret = _iface->read_spi(_spi_slave,
spi_config_t::EDGE_RISE, reg, 16);
UHD_LOGV(often)
@@ -302,7 +302,7 @@ void usrp1_codec_ctrl_impl::recv_reg(boost::uint8_t addr)
<< std::setw(8) << std::hex << ret << std::endl
;
- _ad9862_regs.set_reg(addr, boost::uint16_t(ret));
+ _ad9862_regs.set_reg(addr, uint16_t(ret));
}
/***********************************************************************
@@ -356,7 +356,7 @@ double usrp1_codec_ctrl_impl::fine_tune(double codec_rate, double target_freq)
{
static const double scale_factor = std::pow(2.0, 24);
- boost::uint32_t freq_word = boost::uint32_t(
+ uint32_t freq_word = uint32_t(
boost::math::round(std::abs((target_freq / codec_rate) * scale_factor)));
double actual_freq = freq_word * codec_rate / scale_factor;
diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp
index 5640e8dae..645c0bfd3 100644
--- a/host/lib/usrp/usrp1/dboard_iface.cpp
+++ b/host/lib/usrp/usrp1/dboard_iface.cpp
@@ -107,35 +107,35 @@ public:
void write_aux_dac(unit_t, aux_dac_t, double);
double read_aux_adc(unit_t, aux_adc_t);
- void set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff);
- boost::uint32_t get_pin_ctrl(unit_t unit);
- void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask = 0xffffffff);
- boost::uint32_t get_atr_reg(unit_t unit, atr_reg_t reg);
- void set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff);
- boost::uint32_t get_gpio_ddr(unit_t unit);
- void set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask = 0xffffffff);
- boost::uint32_t get_gpio_out(unit_t unit);
- boost::uint32_t read_gpio(unit_t unit);
-
- void _set_pin_ctrl(unit_t, boost::uint16_t);
- void _set_atr_reg(unit_t, atr_reg_t, boost::uint16_t);
- void _set_gpio_ddr(unit_t, boost::uint16_t);
- void _set_gpio_out(unit_t, boost::uint16_t);
+ void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff);
+ uint32_t get_pin_ctrl(unit_t unit);
+ void set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff);
+ uint32_t get_atr_reg(unit_t unit, atr_reg_t reg);
+ void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff);
+ uint32_t get_gpio_ddr(unit_t unit);
+ void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff);
+ uint32_t get_gpio_out(unit_t unit);
+ uint32_t read_gpio(unit_t unit);
+
+ void _set_pin_ctrl(unit_t, uint16_t);
+ void _set_atr_reg(unit_t, atr_reg_t, uint16_t);
+ void _set_gpio_ddr(unit_t, uint16_t);
+ void _set_gpio_out(unit_t, uint16_t);
void set_command_time(const uhd::time_spec_t& t);
uhd::time_spec_t get_command_time(void);
- void write_i2c(boost::uint16_t, const byte_vector_t &);
- byte_vector_t read_i2c(boost::uint16_t, size_t);
+ void write_i2c(uint16_t, const byte_vector_t &);
+ byte_vector_t read_i2c(uint16_t, size_t);
void write_spi(unit_t unit,
const spi_config_t &config,
- boost::uint32_t data,
+ uint32_t data,
size_t num_bits);
- boost::uint32_t read_write_spi(unit_t unit,
+ uint32_t read_write_spi(unit_t unit,
const spi_config_t &config,
- boost::uint32_t data,
+ uint32_t data,
size_t num_bits);
void set_clock_rate(unit_t, double);
@@ -152,8 +152,8 @@ private:
const usrp1_impl::dboard_slot_t _dboard_slot;
const double &_master_clock_rate;
const dboard_id_t _rx_dboard_id;
- uhd::dict<unit_t, boost::uint16_t> _pin_ctrl, _gpio_out, _gpio_ddr;
- uhd::dict<unit_t, uhd::dict<atr_reg_t, boost::uint16_t> > _atr_regs;
+ uhd::dict<unit_t, uint16_t> _pin_ctrl, _gpio_out, _gpio_ddr;
+ uhd::dict<unit_t, uhd::dict<atr_reg_t, uint16_t> > _atr_regs;
};
/***********************************************************************
@@ -238,41 +238,41 @@ static T shadow_it(T &shadow, const T &value, const T &mask){
return shadow;
}
-void usrp1_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint32_t value, boost::uint32_t mask){
- _set_pin_ctrl(unit, shadow_it(_pin_ctrl[unit], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)));
+void usrp1_dboard_iface::set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask){
+ _set_pin_ctrl(unit, shadow_it(_pin_ctrl[unit], static_cast<uint16_t>(value), static_cast<uint16_t>(mask)));
}
-boost::uint32_t usrp1_dboard_iface::get_pin_ctrl(unit_t unit){
+uint32_t usrp1_dboard_iface::get_pin_ctrl(unit_t unit){
return _pin_ctrl[unit];
}
-void usrp1_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint32_t value, boost::uint32_t mask){
- _set_atr_reg(unit, reg, shadow_it(_atr_regs[unit][reg], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)));
+void usrp1_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask){
+ _set_atr_reg(unit, reg, shadow_it(_atr_regs[unit][reg], static_cast<uint16_t>(value), static_cast<uint16_t>(mask)));
}
-boost::uint32_t usrp1_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){
+uint32_t usrp1_dboard_iface::get_atr_reg(unit_t unit, atr_reg_t reg){
return _atr_regs[unit][reg];
}
-void usrp1_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint32_t value, boost::uint32_t mask){
- _set_gpio_ddr(unit, shadow_it(_gpio_ddr[unit], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)));
+void usrp1_dboard_iface::set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask){
+ _set_gpio_ddr(unit, shadow_it(_gpio_ddr[unit], static_cast<uint16_t>(value), static_cast<uint16_t>(mask)));
}
-boost::uint32_t usrp1_dboard_iface::get_gpio_ddr(unit_t unit){
+uint32_t usrp1_dboard_iface::get_gpio_ddr(unit_t unit){
return _gpio_ddr[unit];
}
-void usrp1_dboard_iface::set_gpio_out(unit_t unit, boost::uint32_t value, boost::uint32_t mask){
- _set_gpio_out(unit, shadow_it(_gpio_out[unit], static_cast<boost::uint16_t>(value), static_cast<boost::uint16_t>(mask)));
+void usrp1_dboard_iface::set_gpio_out(unit_t unit, uint32_t value, uint32_t mask){
+ _set_gpio_out(unit, shadow_it(_gpio_out[unit], static_cast<uint16_t>(value), static_cast<uint16_t>(mask)));
}
-boost::uint32_t usrp1_dboard_iface::get_gpio_out(unit_t unit){
+uint32_t usrp1_dboard_iface::get_gpio_out(unit_t unit){
return _gpio_out[unit];
}
-boost::uint32_t usrp1_dboard_iface::read_gpio(unit_t unit)
+uint32_t usrp1_dboard_iface::read_gpio(unit_t unit)
{
- boost::uint32_t out_value;
+ uint32_t out_value;
if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A)
out_value = _iface->peek32(1);
@@ -283,15 +283,15 @@ boost::uint32_t usrp1_dboard_iface::read_gpio(unit_t unit)
switch(unit) {
case UNIT_RX:
- return (boost::uint32_t)((out_value >> 16) & 0x0000ffff);
+ return (uint32_t)((out_value >> 16) & 0x0000ffff);
case UNIT_TX:
- return (boost::uint32_t)((out_value >> 0) & 0x0000ffff);
+ return (uint32_t)((out_value >> 0) & 0x0000ffff);
default: UHD_THROW_INVALID_CODE_PATH();
}
UHD_ASSERT_THROW(false);
}
-void usrp1_dboard_iface::_set_pin_ctrl(unit_t unit, boost::uint16_t value)
+void usrp1_dboard_iface::_set_pin_ctrl(unit_t unit, uint16_t value)
{
switch(unit) {
case UNIT_RX:
@@ -310,7 +310,7 @@ void usrp1_dboard_iface::_set_pin_ctrl(unit_t unit, boost::uint16_t value)
}
}
-void usrp1_dboard_iface::_set_gpio_ddr(unit_t unit, boost::uint16_t value)
+void usrp1_dboard_iface::_set_gpio_ddr(unit_t unit, uint16_t value)
{
switch(unit) {
case UNIT_RX:
@@ -329,7 +329,7 @@ void usrp1_dboard_iface::_set_gpio_ddr(unit_t unit, boost::uint16_t value)
}
}
-void usrp1_dboard_iface::_set_gpio_out(unit_t unit, boost::uint16_t value)
+void usrp1_dboard_iface::_set_gpio_out(unit_t unit, uint16_t value)
{
switch(unit) {
case UNIT_RX:
@@ -349,7 +349,7 @@ void usrp1_dboard_iface::_set_gpio_out(unit_t unit, boost::uint16_t value)
}
void usrp1_dboard_iface::_set_atr_reg(unit_t unit,
- atr_reg_t atr, boost::uint16_t value)
+ atr_reg_t atr, uint16_t value)
{
// Ignore unsupported states
if ((atr == ATR_REG_IDLE) || (atr == ATR_REG_TX_ONLY))
@@ -397,7 +397,7 @@ void usrp1_dboard_iface::_set_atr_reg(unit_t unit,
* \param slot the side (A or B) the dboard is attached
* \return the slave device number
*/
-static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit,
+static uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit,
usrp1_impl::dboard_slot_t slot)
{
switch(unit) {
@@ -423,16 +423,16 @@ static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit,
void usrp1_dboard_iface::write_spi(unit_t unit,
const spi_config_t &config,
- boost::uint32_t data,
+ uint32_t data,
size_t num_bits)
{
_iface->write_spi(unit_to_otw_spi_dev(unit, _dboard_slot),
config, data, num_bits);
}
-boost::uint32_t usrp1_dboard_iface::read_write_spi(unit_t unit,
+uint32_t usrp1_dboard_iface::read_write_spi(unit_t unit,
const spi_config_t &config,
- boost::uint32_t data,
+ uint32_t data,
size_t num_bits)
{
return _iface->read_spi(unit_to_otw_spi_dev(unit, _dboard_slot),
@@ -442,13 +442,13 @@ boost::uint32_t usrp1_dboard_iface::read_write_spi(unit_t unit,
/***********************************************************************
* I2C
**********************************************************************/
-void usrp1_dboard_iface::write_i2c(boost::uint16_t addr,
+void usrp1_dboard_iface::write_i2c(uint16_t addr,
const byte_vector_t &bytes)
{
return _iface->write_i2c(addr, bytes);
}
-byte_vector_t usrp1_dboard_iface::read_i2c(boost::uint16_t addr,
+byte_vector_t usrp1_dboard_iface::read_i2c(uint16_t addr,
size_t num_bytes)
{
return _iface->read_i2c(addr, num_bytes);
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index e1f17e5a6..920023dad 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -115,7 +115,7 @@ private:
* BS VRT packer/unpacker functions (since samples don't have headers)
**********************************************************************/
static void usrp1_bs_vrt_packer(
- boost::uint32_t *,
+ uint32_t *,
vrt::if_packet_info_t &if_packet_info
){
if_packet_info.num_header_words32 = 0;
@@ -123,12 +123,12 @@ static void usrp1_bs_vrt_packer(
}
static void usrp1_bs_vrt_unpacker(
- const boost::uint32_t *,
+ const uint32_t *,
vrt::if_packet_info_t &if_packet_info
){
if_packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_DATA;
if_packet_info.num_payload_words32 = if_packet_info.num_packet_words32;
- if_packet_info.num_payload_bytes = if_packet_info.num_packet_words32*sizeof(boost::uint32_t);
+ if_packet_info.num_payload_bytes = if_packet_info.num_packet_words32*sizeof(uint32_t);
if_packet_info.num_header_words32 = 0;
if_packet_info.packet_count = 0;
if_packet_info.sob = false;
@@ -286,7 +286,7 @@ void usrp1_impl::vandal_conquest_loop(void){
//start the polling loop...
try{ while (not boost::this_thread::interruption_requested()){
- boost::uint8_t underflow = 0, overflow = 0;
+ uint8_t underflow = 0, overflow = 0;
//shutoff transmit if it has been too long since send() was called
if (_tx_enabled and (boost::get_system_time() - _io_impl->last_send_time) > boost::posix_time::milliseconds(100)){
@@ -566,9 +566,9 @@ double usrp1_impl::update_rx_dsp_freq(const size_t dspno, const double freq_){
//calculate the freq register word (signed)
UHD_ASSERT_THROW(std::abs(freq) <= _master_clock_rate/2.0);
static const double scale_factor = std::pow(2.0, 32);
- const boost::int32_t freq_word = boost::int32_t(boost::math::round((freq / _master_clock_rate) * scale_factor));
+ const int32_t freq_word = int32_t(boost::math::round((freq / _master_clock_rate) * scale_factor));
- static const boost::uint32_t dsp_index_to_reg_val[4] = {
+ static const uint32_t dsp_index_to_reg_val[4] = {
FR_RX_FREQ_0, FR_RX_FREQ_1, FR_RX_FREQ_2, FR_RX_FREQ_3
};
_iface->poke32(dsp_index_to_reg_val[dspno], freq_word);
diff --git a/host/lib/usrp/usrp1/usrp1_calc_mux.hpp b/host/lib/usrp/usrp1/usrp1_calc_mux.hpp
index d86a7a809..3577a8042 100644
--- a/host/lib/usrp/usrp1/usrp1_calc_mux.hpp
+++ b/host/lib/usrp/usrp1/usrp1_calc_mux.hpp
@@ -47,7 +47,7 @@ static int calc_rx_mux_pair(int adc_for_i, int adc_for_q){
* | must be zero | Q3| I3| Q2| I2| Q1| I1| Q0| I0|Z| NCH |
* +-----------------------+-------+-------+-------+-------+-+-----+
*/
-static boost::uint32_t calc_rx_mux(const std::vector<mapping_pair_t> &mapping){
+static uint32_t calc_rx_mux(const std::vector<mapping_pair_t> &mapping){
//create look-up-table for mapping dboard name and connection type to ADC flags
static const int ADC0 = 0, ADC1 = 1, ADC2 = 2, ADC3 = 3;
static const uhd::dict<std::string, uhd::dict<std::string, int> > name_to_conn_to_flag = boost::assign::map_list_of
@@ -108,7 +108,7 @@ static int calc_tx_mux_pair(int chn_for_i, int chn_for_q){
* | | DAC1Q | DAC1I | DAC0Q | DAC0I |0| NCH |
* +-----------------------------------------------+-------+-+-----+
*/
-static boost::uint32_t calc_tx_mux(const std::vector<mapping_pair_t> &mapping){
+static uint32_t calc_tx_mux(const std::vector<mapping_pair_t> &mapping){
//create look-up-table for mapping channel number and connection type to flags
static const int ENB = 1 << 3, CHAN_I0 = 0, CHAN_Q0 = 1, CHAN_I1 = 2, CHAN_Q1 = 3;
static const uhd::dict<size_t, uhd::dict<std::string, int> > chan_to_conn_to_flag = boost::assign::map_list_of
diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp
index 48fdfcf12..b65f8fa2f 100644
--- a/host/lib/usrp/usrp1/usrp1_iface.cpp
+++ b/host/lib/usrp/usrp1/usrp1_iface.cpp
@@ -45,9 +45,9 @@ public:
/*******************************************************************
* Peek and Poke
******************************************************************/
- void poke32(const boost::uint32_t addr, const boost::uint32_t value)
+ void poke32(const uint32_t addr, const uint32_t value)
{
- boost::uint32_t swapped = uhd::htonx(value);
+ uint32_t swapped = uhd::htonx(value);
UHD_LOGV(always)
<< "poke32("
@@ -55,48 +55,48 @@ public:
<< std::hex << std::setw(8) << value << ")" << std::endl
;
- boost::uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff;
- boost::uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff;
+ uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff;
+ uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff;
int ret =_ctrl_transport->usrp_control_write(
VRQ_SPI_WRITE,
addr & 0x7f,
(w_index_h << 8) | (w_index_l << 0),
(unsigned char*) &swapped,
- sizeof(boost::uint32_t));
+ sizeof(uint32_t));
if (ret < 0) throw uhd::io_error("USRP1: failed control write");
}
- boost::uint32_t peek32(const boost::uint32_t addr)
+ uint32_t peek32(const uint32_t addr)
{
UHD_LOGV(always)
<< "peek32("
<< std::dec << std::setw(2) << addr << ")" << std::endl
;
- boost::uint32_t value_out;
+ uint32_t value_out;
- boost::uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff;
- boost::uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff;
+ uint8_t w_index_h = SPI_ENABLE_FPGA & 0xff;
+ uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_1) & 0xff;
int ret = _ctrl_transport->usrp_control_read(
VRQ_SPI_READ,
0x80 | (addr & 0x7f),
(w_index_h << 8) | (w_index_l << 0),
(unsigned char*) &value_out,
- sizeof(boost::uint32_t));
+ sizeof(uint32_t));
if (ret < 0) throw uhd::io_error("USRP1: failed control read");
return uhd::ntohx(value_out);
}
- void poke16(const boost::uint32_t, const boost::uint16_t) {
+ void poke16(const uint32_t, const uint16_t) {
throw uhd::not_implemented_error("Unhandled command poke16()");
}
- boost::uint16_t peek16(const boost::uint32_t) {
+ uint16_t peek16(const uint32_t) {
throw uhd::not_implemented_error("Unhandled command peek16()");
return 0;
}
@@ -104,11 +104,11 @@ public:
/*******************************************************************
* I2C
******************************************************************/
- void write_i2c(boost::uint16_t addr, const byte_vector_t &bytes){
+ void write_i2c(uint16_t addr, const byte_vector_t &bytes){
return _ctrl_transport->write_i2c(addr, bytes);
}
- byte_vector_t read_i2c(boost::uint16_t addr, size_t num_bytes){
+ byte_vector_t read_i2c(uint16_t addr, size_t num_bytes){
return _ctrl_transport->read_i2c(addr, num_bytes);
}
@@ -123,9 +123,9 @@ public:
* 4 bytes of OUT data in the device request fields and uses the
* control buffer for IN data.
******************************************************************/
- boost::uint32_t transact_spi(int which_slave,
+ uint32_t transact_spi(int which_slave,
const spi_config_t &,
- boost::uint32_t bits,
+ uint32_t bits,
size_t num_bits,
bool readback)
{
@@ -166,10 +166,10 @@ public:
else{
throw uhd::io_error("USRP1: invalid input data for SPI readback");
}
- boost::uint32_t val = (((boost::uint32_t)buff[0]) << 0) |
- (((boost::uint32_t)buff[1]) << 8) |
- (((boost::uint32_t)buff[2]) << 16) |
- (((boost::uint32_t)buff[3]) << 24);
+ uint32_t val = (((uint32_t)buff[0]) << 0) |
+ (((uint32_t)buff[1]) << 8) |
+ (((uint32_t)buff[2]) << 16) |
+ (((uint32_t)buff[3]) << 24);
return val;
}
else {
@@ -178,8 +178,8 @@ public:
for (size_t i = 1; i <= num_bytes; i++)
buff[num_bytes - i] = (bits >> ((i - 1) * 8)) & 0xff;
- boost::uint8_t w_index_h = which_slave & 0xff;
- boost::uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_0) & 0xff;
+ uint8_t w_index_h = which_slave & 0xff;
+ uint8_t w_index_l = (SPI_FMT_MSB | SPI_FMT_HDR_0) & 0xff;
int ret =_ctrl_transport->usrp_control_write(
VRQ_SPI_WRITE,
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 5e1a70a8f..baecc6081 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -36,10 +36,10 @@ using namespace uhd;
using namespace uhd::usrp;
using namespace uhd::transport;
-const boost::uint16_t USRP1_VENDOR_ID = 0xfffe;
-const boost::uint16_t USRP1_PRODUCT_ID = 0x0002;
-const boost::uint16_t FX2_VENDOR_ID = 0x04b4;
-const boost::uint16_t FX2_PRODUCT_ID = 0x8613;
+const uint16_t USRP1_VENDOR_ID = 0xfffe;
+const uint16_t USRP1_PRODUCT_ID = 0x0002;
+const uint16_t FX2_VENDOR_ID = 0x04b4;
+const uint16_t FX2_PRODUCT_ID = 0x8613;
static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000);
const std::vector<usrp1_impl::dboard_slot_t> usrp1_impl::_dboard_slots = boost::assign::list_of
@@ -60,11 +60,11 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
//since an address and resource is intended for a different, non-USB, device.
if (hint.has_key("addr") || hint.has_key("resource")) return usrp1_addrs;
- boost::uint16_t vid, pid;
+ uint16_t vid, pid;
if(hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type") && hint["type"] == "usrp1") {
- vid = uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("vid"));
- pid = uhd::cast::hexstr_cast<boost::uint16_t>(hint.get("pid"));
+ vid = uhd::cast::hexstr_cast<uint16_t>(hint.get("vid"));
+ pid = uhd::cast::hexstr_cast<uint16_t>(hint.get("pid"));
} else {
vid = USRP1_VENDOR_ID;
pid = USRP1_PRODUCT_ID;
@@ -214,7 +214,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
////////////////////////////////////////////////////////////////////
// create user-defined control objects
////////////////////////////////////////////////////////////////////
- _tree->create<std::pair<boost::uint8_t, boost::uint32_t> >(mb_path / "user" / "regs")
+ _tree->create<std::pair<uint8_t, uint32_t> >(mb_path / "user" / "regs")
.add_coerced_subscriber(boost::bind(&usrp1_impl::set_reg, this, _1));
////////////////////////////////////////////////////////////////////
@@ -432,22 +432,22 @@ usrp1_impl::~usrp1_impl(void){
* +-----------------------------------------------+-+-----+-+-----+
*/
size_t usrp1_impl::get_num_ddcs(void){
- boost::uint32_t regval = _iface->peek32(FR_RB_CAPS);
+ uint32_t regval = _iface->peek32(FR_RB_CAPS);
return (regval >> 0) & 0x0007;
}
size_t usrp1_impl::get_num_ducs(void){
- boost::uint32_t regval = _iface->peek32(FR_RB_CAPS);
+ uint32_t regval = _iface->peek32(FR_RB_CAPS);
return (regval >> 4) & 0x0007;
}
bool usrp1_impl::has_rx_halfband(void){
- boost::uint32_t regval = _iface->peek32(FR_RB_CAPS);
+ uint32_t regval = _iface->peek32(FR_RB_CAPS);
return (regval >> 3) & 0x0001;
}
bool usrp1_impl::has_tx_halfband(void){
- boost::uint32_t regval = _iface->peek32(FR_RB_CAPS);
+ uint32_t regval = _iface->peek32(FR_RB_CAPS);
return (regval >> 7) & 0x0001;
}
@@ -489,8 +489,8 @@ void usrp1_impl::set_enb_rx_dc_offset(const std::string &db, const bool enb){
}
std::complex<double> usrp1_impl::set_rx_dc_offset(const std::string &db, const std::complex<double> &offset){
- const boost::int32_t i_off = boost::math::iround(offset.real() * (1ul << 31));
- const boost::int32_t q_off = boost::math::iround(offset.imag() * (1ul << 31));
+ const int32_t i_off = boost::math::iround(offset.real() * (1ul << 31));
+ const int32_t q_off = boost::math::iround(offset.imag() * (1ul << 31));
if (db == "A"){
_iface->poke32(FR_ADC_OFFSET_0, i_off);
@@ -505,7 +505,7 @@ std::complex<double> usrp1_impl::set_rx_dc_offset(const std::string &db, const s
return std::complex<double>(double(i_off) * (1ul << 31), double(q_off) * (1ul << 31));
}
-void usrp1_impl::set_reg(const std::pair<boost::uint8_t, boost::uint32_t> &reg)
+void usrp1_impl::set_reg(const std::pair<uint8_t, uint32_t> &reg)
{
_iface->poke32(reg.first, reg.second);
}
diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp
index da901bd6c..18c5c8bd3 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.hpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.hpp
@@ -147,7 +147,7 @@ private:
void vandal_conquest_loop(void);
- void set_reg(const std::pair<boost::uint8_t, boost::uint32_t> &reg);
+ void set_reg(const std::pair<uint8_t, uint32_t> &reg);
//handle the enables
bool _rx_enabled, _tx_enabled;