GNU Radio Manual and C++ API Reference  3.10.5.1
The Free & Open Software Radio Ecosystem
iio_types.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2021 Josh Morman
4  *
5  * SPDX-License-Identifier: GPL-3.0-or-later
6  *
7  */
8 
9 #ifndef _INCLUDED_IIO_TYPES_H
10 #define _INCLUDED_IIO_TYPES_H
11 
12 #include <gnuradio/iio/api.h>
13 #include <charconv>
14 #include <string>
15 #include <variant>
16 #include <vector>
17 
18 namespace gr {
19 namespace iio {
20 
21 enum class data_type_t { DOUBLE = 0, FLOAT = 1, LONGLONG = 2, INT = 3, UINT8 = 4 };
22 
23 enum class attr_type_t {
24  CHANNEL = 0,
25  DEVICE = 1,
26  DEVICE_BUFFER = 2,
27  DEVICE_DEBUG = 3,
29 };
30 
31 typedef std::variant<long long unsigned int, long unsigned int, int, double, std::string>
33 
34 class IIO_API iio_param_t : public std::pair<std::string, std::string>
35 {
36 public:
37  iio_param_t(const std::string& key, iio_param_value_t value);
38  iio_param_t(const std::string& kvpair);
40 
41  static std::string to_string(iio_param_value_t value);
42 };
43 
44 typedef std::vector<iio_param_t> iio_param_vec_t;
45 
46 } // namespace iio
47 } // namespace gr
48 
49 #endif
gr::iio::iio_param_t::~iio_param_t
~iio_param_t()
Definition: iio_types.h:39
IIO_API
#define IIO_API
Definition: gr-iio/include/gnuradio/iio/api.h:18
gr::iio::data_type_t::DOUBLE
@ DOUBLE
gr::iio::data_type_t::UINT8
@ UINT8
gr::iio::attr_type_t::CHANNEL
@ CHANNEL
gr::iio::data_type_t::FLOAT
@ FLOAT
gr::iio::attr_type_t::DEVICE_BUFFER
@ DEVICE_BUFFER
gr::iio::data_type_t::INT
@ INT
gr::iio::attr_type_t::DIRECT_REGISTER_ACCESS
@ DIRECT_REGISTER_ACCESS
gr::iio::iio_param_vec_t
std::vector< iio_param_t > iio_param_vec_t
Definition: iio_types.h:44
gr::iio::attr_type_t::DEVICE_DEBUG
@ DEVICE_DEBUG
gr::iio::iio_param_t
Definition: iio_types.h:34
api.h
gr::iio::data_type_t::LONGLONG
@ LONGLONG
gr::iio::iio_param_value_t
std::variant< long long unsigned int, long unsigned int, int, double, std::string > iio_param_value_t
Definition: iio_types.h:32
gr
GNU Radio logging wrapper.
Definition: basic_block.h:29
gr::iio::data_type_t
data_type_t
Definition: iio_types.h:21
gr::iio::attr_type_t
attr_type_t
Definition: iio_types.h:23
gr::iio::attr_type_t::DEVICE
@ DEVICE