From 675350a1d69bafaf76e3723707b23ec1d2830e53 Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Tue, 12 Aug 2014 18:28:36 -0700 Subject: b200, ad9361: Cleanup up AD9361 driver - Removed transaction interface - Made the driver a C++ class --- host/lib/usrp/common/ad9361_platform_uhd.cpp | 86 ---------------------------- 1 file changed, 86 deletions(-) delete mode 100644 host/lib/usrp/common/ad9361_platform_uhd.cpp (limited to 'host/lib/usrp/common/ad9361_platform_uhd.cpp') diff --git a/host/lib/usrp/common/ad9361_platform_uhd.cpp b/host/lib/usrp/common/ad9361_platform_uhd.cpp deleted file mode 100644 index 10ea67345..000000000 --- a/host/lib/usrp/common/ad9361_platform_uhd.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// -// Copyright 2014 Ettus Research LLC -// - -#include -#include -#include -#include -#include -#include -#include "ad9361_ctrl.hpp" -#include -#include -#include - -//If the platform for the AD9361 driver is UHD (host) then the handle is simply -//a pointer to a device class instance -ad9361_device_t* get_ad9361_device(uint64_t handle) -{ - return reinterpret_cast(reinterpret_cast(handle)); -} - -uint8_t read_ad9361_reg(ad9361_device_t* device, uint32_t reg) -{ - if (device && device->io_iface) { - //If the platform for the AD9361 driver is UHD (host) then the io_iface is - //a pointer to a ad9361_io implementation - ad9361_io* io_iface = reinterpret_cast(device->io_iface); - return io_iface->peek8(reg); - } else { - return 0; - } -} - -void write_ad9361_reg(ad9361_device_t* device, uint32_t reg, uint8_t val) -{ - if (device && device->io_iface) { - //If the platform for the AD9361 driver is UHD (host) then the io_iface is - //a pointer to a ad9361_io implementation - ad9361_io* io_iface = reinterpret_cast(device->io_iface); - io_iface->poke8(reg, val); - } -} - -typedef union -{ - double d; - uint32_t x[2]; -} ad9361_double_union_t; - -void ad9361_double_pack(const double input, uint32_t output[2]) -{ - ad9361_double_union_t p = {}; - p.d = input; - output[0] = p.x[0]; - output[1] = p.x[1]; -} - -double ad9361_double_unpack(const uint32_t input[2]) -{ - ad9361_double_union_t p = {}; - p.x[0] = input[0]; - p.x[1] = input[1]; - return p.d; -} - -double ad9361_sqrt(double val) -{ - return std::sqrt(val); -} - -void ad9361_msleep(const uint32_t millis) -{ - boost::this_thread::sleep(boost::posix_time::milliseconds(millis)); -} - -int ad9361_floor_to_int(double val) -{ - return static_cast(std::floor(val)); -} - -int ad9361_ceil_to_int(double val) -{ - return static_cast(std::ceil(val)); -} - -- cgit v1.2.3