diff options
Diffstat (limited to 'host/lib/usrp/usrp1/codec_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/usrp1/codec_ctrl.cpp | 38 |
1 files changed, 19 insertions, 19 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; |