aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/e100/codec_ctrl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-11-08 08:41:46 -0800
committerMartin Braun <martin.braun@ettus.com>2016-11-08 08:41:46 -0800
commit9b852f5f243e5cf68662b7152b5fa331a83e55fb (patch)
tree159ffe0761f78dd87e2ecc97abea14494abab4ff /host/lib/usrp/e100/codec_ctrl.cpp
parentc66cb1bad0d881394f3519bd94f4693cceab4c64 (diff)
parent99c2730bc9db270560671f2d7d173768465ed51f (diff)
downloaduhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.tar.gz
uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.tar.bz2
uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/e100/codec_ctrl.cpp')
-rw-r--r--host/lib/usrp/e100/codec_ctrl.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/host/lib/usrp/e100/codec_ctrl.cpp b/host/lib/usrp/e100/codec_ctrl.cpp
index 2c13176a3..7dce01e46 100644
--- a/host/lib/usrp/e100/codec_ctrl.cpp
+++ b/host/lib/usrp/e100/codec_ctrl.cpp
@@ -21,7 +21,7 @@
#include <uhd/types/dict.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/algorithm.hpp>
-#include <boost/cstdint.hpp>
+#include <stdint.h>
#include <boost/tuple/tuple.hpp>
#include <boost/math/special_functions/round.hpp>
#include "e100_regs.hpp" //spi slave constants
@@ -54,8 +54,8 @@ public:
private:
spi_iface::sptr _iface;
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);
};
/***********************************************************************
@@ -110,7 +110,7 @@ e100_codec_ctrl_impl::e100_codec_ctrl_impl(spi_iface::sptr iface){
//_ad9862_regs.dis2 = ad9862_regs_t::DIS2_DIS; needed for transmit
//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);
}
@@ -185,8 +185,8 @@ double e100_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){
- return double((boost::uint16_t(high) << 2) | low)*3.3/0x3ff;
+static double aux_adc_to_volts(uint8_t high, uint8_t low){
+ return double((uint16_t(high) << 2) | low)*3.3/0x3ff;
}
double e100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){
@@ -228,19 +228,19 @@ double e100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){
void e100_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))
@@ -249,7 +249,7 @@ void e100_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);
@@ -258,8 +258,8 @@ void e100_codec_ctrl_impl::write_aux_dac(aux_dac_t which, double volts){
/***********************************************************************
* Codec Control SPI Methods
**********************************************************************/
-void e100_codec_ctrl_impl::send_reg(boost::uint8_t addr){
- boost::uint32_t reg = _ad9862_regs.get_write_reg(addr);
+void e100_codec_ctrl_impl::send_reg(uint8_t addr){
+ uint32_t reg = _ad9862_regs.get_write_reg(addr);
UHD_LOGV(often) << "codec control write reg: " << std::hex << reg << std::endl;
_iface->write_spi(
UE_SPI_SS_AD9862,
@@ -268,16 +268,16 @@ void e100_codec_ctrl_impl::send_reg(boost::uint8_t addr){
);
}
-void e100_codec_ctrl_impl::recv_reg(boost::uint8_t addr){
- boost::uint32_t reg = _ad9862_regs.get_read_reg(addr);
+void e100_codec_ctrl_impl::recv_reg(uint8_t addr){
+ uint32_t reg = _ad9862_regs.get_read_reg(addr);
UHD_LOGV(often) << "codec control read reg: " << std::hex << reg << std::endl;
- boost::uint32_t ret = _iface->read_spi(
+ uint32_t ret = _iface->read_spi(
UE_SPI_SS_AD9862,
spi_config_t::EDGE_RISE,
reg, 16
);
UHD_LOGV(often) << "codec control read ret: " << std::hex << ret << std::endl;
- _ad9862_regs.set_reg(addr, boost::uint16_t(ret));
+ _ad9862_regs.set_reg(addr, uint16_t(ret));
}
/***********************************************************************