GNU Radio's HNCHIIO Package
thirtytwobit_source.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2014 Analog Devices Inc.
4 * Author: Paul Cercueil <paul.cercueil@analog.com>
5 *
6 * This is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3, or (at your option)
9 * any later version.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this software; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street,
19 * Boston, MA 02110-1301, USA.
20 */
21
22
23#ifndef INCLUDED_HNCHIIO_EIGHTBIT_SOURCE_H
24#define INCLUDED_HNCHIIO_EIGHTBIT_SOURCE_H
25
27#include <gnuradio/sync_block.h>
28
29#define DEFAULT_BUFFER_SIZE 0x8000
30
31extern "C" {
32 struct iio_context;
33};
34
35namespace gr {
36 namespace hnchiio {
37
38 /*!
39 * \brief <+description of block+>
40 * \ingroup hnchiio
41 *
42 */
43 class IIO_API thirtytwobit_source : virtual public gr::sync_block
44 {
45 public:
46 typedef std::shared_ptr<thirtytwobit_source> sptr;
47
48 /*!
49 * \brief Return a shared_ptr to a new instance of hnchiio::device.
50 *
51 * To avoid accidental use of raw pointers, hnchiio::device's
52 * constructor is in a private implementation
53 * class. hnchiio::device::make is the public interface for
54 * creating new instances.
55 */
56 static sptr make(const std::string &uri, const std::string &device,
57 const std::vector<std::string> &channels,
58 const std::string &device_phy,
59 const std::vector<std::string> &params,
60 unsigned int buffer_size = DEFAULT_BUFFER_SIZE,
61 unsigned int decimation = 0);
62
63 static sptr make_from(struct iio_context *ctx, const std::string &device,
64 const std::vector<std::string> &channels,
65 const std::string &device_phy,
66 const std::vector<std::string> &params,
67 unsigned int buffer_size = DEFAULT_BUFFER_SIZE,
68 unsigned int decimation = 0);
69
70 virtual void set_buffer_size(unsigned int buffer_size) = 0;
71 virtual void set_timeout_ms(unsigned long timeout) = 0;
72 };
73
74 } // namespace hnchiio
75} // namespace gr
76
77#endif /* INCLUDED_HNCHIIO_EIGHTBIT_SOURCE_H */
78
#define IIO_API
Definition api.h:19
<+description of block+>
Definition thirtytwobit_source.h:44
virtual void set_timeout_ms(unsigned long timeout)=0
std::shared_ptr< thirtytwobit_source > sptr
Definition thirtytwobit_source.h:46
virtual void set_buffer_size(unsigned int buffer_size)=0
static sptr make_from(struct iio_context *ctx, const std::string &device, const std::vector< std::string > &channels, const std::string &device_phy, const std::vector< std::string > &params, unsigned int buffer_size=DEFAULT_BUFFER_SIZE, unsigned int decimation=0)
static sptr make(const std::string &uri, const std::string &device, const std::vector< std::string > &channels, const std::string &device_phy, const std::vector< std::string > &params, unsigned int buffer_size=DEFAULT_BUFFER_SIZE, unsigned int decimation=0)
Return a shared_ptr to a new instance of hnchiio::device.
#define DEFAULT_BUFFER_SIZE
Definition device_sink.h:29
Definition device_sink.h:36
Definition device_sink.h:35