2011-10-02 21:45:44 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
//-- deprecated interfaces below, to be removed when the API is changed
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
2011-10-03 18:35:16 +00:00
|
|
|
#include <uhd/types/io_type.hpp>
|
2020-03-03 20:52:17 +00:00
|
|
|
#include <uhd/types/otw_type.hpp>
|
2016-10-31 21:30:52 +00:00
|
|
|
#include <stdint.h>
|
2011-10-03 18:35:16 +00:00
|
|
|
#include <complex>
|
2020-03-03 20:52:17 +00:00
|
|
|
#include <stdexcept>
|
2011-10-03 18:35:16 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
using namespace uhd;
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
* otw type
|
|
|
|
|
**********************************************************************/
|
2020-03-03 20:52:17 +00:00
|
|
|
size_t otw_type_t::get_sample_size(void) const
|
|
|
|
|
{
|
2011-10-03 18:35:16 +00:00
|
|
|
return (this->width * 2) / 8;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 20:52:17 +00:00
|
|
|
otw_type_t::otw_type_t(void) : width(0), shift(0), byteorder(BO_NATIVE)
|
2011-10-03 18:35:16 +00:00
|
|
|
{
|
|
|
|
|
/* NOP */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
* io type
|
|
|
|
|
**********************************************************************/
|
2020-03-03 20:52:17 +00:00
|
|
|
static std::vector<size_t> get_tid_size_table(void)
|
|
|
|
|
{
|
2011-10-03 18:35:16 +00:00
|
|
|
std::vector<size_t> table(128, 0);
|
|
|
|
|
table[size_t(io_type_t::COMPLEX_FLOAT64)] = sizeof(std::complex<double>);
|
|
|
|
|
table[size_t(io_type_t::COMPLEX_FLOAT32)] = sizeof(std::complex<float>);
|
2016-10-31 21:30:52 +00:00
|
|
|
table[size_t(io_type_t::COMPLEX_INT16)] = sizeof(std::complex<int16_t>);
|
|
|
|
|
table[size_t(io_type_t::COMPLEX_INT8)] = sizeof(std::complex<int8_t>);
|
2011-10-03 18:35:16 +00:00
|
|
|
return table;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const std::vector<size_t> tid_size_table(get_tid_size_table());
|
|
|
|
|
|
2020-03-03 20:52:17 +00:00
|
|
|
io_type_t::io_type_t(tid_t tid) : size(tid_size_table[size_t(tid) & 0x7f]), tid(tid)
|
2011-10-03 18:35:16 +00:00
|
|
|
{
|
|
|
|
|
/* NOP */
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 20:52:17 +00:00
|
|
|
io_type_t::io_type_t(size_t size) : size(size), tid(CUSTOM_TYPE)
|
2011-10-03 18:35:16 +00:00
|
|
|
{
|
|
|
|
|
/* NOP */
|
|
|
|
|
}
|
2011-10-12 16:59:41 +00:00
|
|
|
|
|
|
|
|
#include <uhd/types/clock_config.hpp>
|
|
|
|
|
|
|
|
|
|
using namespace uhd;
|
|
|
|
|
|
2020-03-03 20:52:17 +00:00
|
|
|
clock_config_t clock_config_t::external(void)
|
|
|
|
|
{
|
2011-10-12 16:59:41 +00:00
|
|
|
clock_config_t clock_config;
|
2020-03-03 20:52:17 +00:00
|
|
|
clock_config.ref_source = clock_config_t::REF_SMA;
|
|
|
|
|
clock_config.pps_source = clock_config_t::PPS_SMA;
|
2011-10-12 16:59:41 +00:00
|
|
|
clock_config.pps_polarity = clock_config_t::PPS_POS;
|
|
|
|
|
return clock_config;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 20:52:17 +00:00
|
|
|
clock_config_t clock_config_t::internal(void)
|
|
|
|
|
{
|
2011-10-12 16:59:41 +00:00
|
|
|
clock_config_t clock_config;
|
2020-03-03 20:52:17 +00:00
|
|
|
clock_config.ref_source = clock_config_t::REF_INT;
|
|
|
|
|
clock_config.pps_source = clock_config_t::PPS_SMA;
|
2011-10-12 16:59:41 +00:00
|
|
|
clock_config.pps_polarity = clock_config_t::PPS_POS;
|
|
|
|
|
return clock_config;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 20:52:17 +00:00
|
|
|
clock_config_t::clock_config_t(void)
|
|
|
|
|
: ref_source(REF_INT), pps_source(PPS_SMA), pps_polarity(PPS_POS)
|
2011-10-12 16:59:41 +00:00
|
|
|
{
|
|
|
|
|
/* NOP */
|
|
|
|
|
}
|