10#ifndef INCLUDED_IIO_DEVICE_SOURCE_IMPL_H
11#define INCLUDED_IIO_DEVICE_SOURCE_IMPL_H
16#include <condition_variable>
34typedef std::vector<ctxInfo>::iterator
ctx_it;
39 void channel_read(
const iio_channel* chn,
void* dst,
size_t len);
45 unsigned long items_in_buffer;
47 volatile bool please_refill_buffer;
50 unsigned long timeout;
71 const std::string& device,
72 const std::vector<std::string>& channels,
73 const std::string& device_phy,
89 int work(
int noutput_items,
101 const char* channel_name,
102 const char* attr_name,
Definition: device_source_impl.h:37
void set_timeout_ms(unsigned long timeout)
bool start()
Called to enable drivers, etc for i/o devices.
iio_device * dev
Definition: device_source_impl.h:58
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
just like gr::block::general_work, only this arranges to call consume_each for you
static int handle_decimation_interpolation(unsigned long samplerate, const char *channel_name, const char *attr_name, iio_device *dev, bool disable_dec, bool output_chan)
volatile bool thread_stopped
Definition: device_source_impl.h:64
void set_params(const iio_param_vec_t ¶ms)
void set_buffer_size(unsigned int buffer_size)
Number of samples to be put into each IIO buffered passed to hardware.
iio_device * phy
Definition: device_source_impl.h:58
uint16_t override_tagged_output_channels
Definition: device_source_impl.h:65
void set_len_tag_key(const std::string &len_tag_key) override
Key of the packet length tag. If empty no tag will be emitted.
static bool load_fir_filter(std::string &filter, iio_device *phy)
unsigned int decimation
Definition: device_source_impl.h:62
bool destroy_ctx
Definition: device_source_impl.h:63
device_source_impl(iio_context *ctx, bool destroy_ctx, const std::string &device, const std::vector< std::string > &channels, const std::string &device_phy, const iio_param_vec_t ¶ms, unsigned int buffer_size=DEFAULT_BUFFER_SIZE, unsigned int decimation=0)
bool stop()
Called to disable drivers, etc for i/o devices.
iio_context * ctx
Definition: device_source_impl.h:57
static void remove_ctx_history(iio_context *ctx, bool destroy_ctx)
static void set_params(iio_device *phy, const iio_param_vec_t ¶ms)
unsigned int buffer_size
Definition: device_source_impl.h:61
iio_buffer * buf
Definition: device_source_impl.h:59
static iio_context * get_context(const std::string &uri)
std::vector< iio_channel * > channel_list
Definition: device_source_impl.h:60
Generic source for IIO drivers with buffered output channels.
Definition: device_source.h:37
#define DEFAULT_BUFFER_SIZE
Definition: device_sink.h:20
std::vector< iio_param_t > iio_param_vec_t
Definition: iio_types.h:48
static std::vector< ctxInfo > contexts
Definition: device_source_impl.h:32
std::vector< ctxInfo >::iterator ctx_it
Definition: device_source_impl.h:34
static std::mutex ctx_mutex
Definition: device_source_impl.h:31
boost::mutex mutex
Definition: thread.h:37
boost::thread thread
Definition: thread.h:36
GNU Radio logging wrapper.
Definition: basic_block.h:29
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:84
Definition: device_source_impl.h:25
int count
Definition: device_source_impl.h:28
std::string uri
Definition: device_source_impl.h:26
iio_context * ctx
Definition: device_source_impl.h:27
std::vector< const void * > gr_vector_const_void_star
Definition: types.h:28
std::vector< void * > gr_vector_void_star
Definition: types.h:27