libm2k
enums.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Analog Devices Inc.
3  *
4  * This file is part of libm2k
5  * (see http://www.github.com/analogdevicesinc/libm2k).
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation, either version 2.1 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ENUMS_DIGITAL_HPP
23 #define ENUMS_DIGITAL_HPP
24 
25 #include <iio.h>
26 
32 namespace libm2k {
33 namespace digital {
34 
35 
44  DIO_INPUT = 0,
45  DIO_OUTPUT = 1,
46  };
47 
48 
56  enum DIO_LEVEL {
57  LOW = 0,
58  HIGH = 1,
59  };
60 
61 
69  enum DIO_CHANNEL {
70  DIO_CHANNEL_0 = 0,
71  DIO_CHANNEL_1 = 1,
72  DIO_CHANNEL_2 = 2,
73  DIO_CHANNEL_3 = 3,
74  DIO_CHANNEL_4 = 4,
75  DIO_CHANNEL_5 = 5,
76  DIO_CHANNEL_6 = 6,
77  DIO_CHANNEL_7 = 7,
78  DIO_CHANNEL_8 = 8,
79  DIO_CHANNEL_9 = 9,
80  DIO_CHANNEL_10 = 10,
81  DIO_CHANNEL_11 = 11,
82  DIO_CHANNEL_12 = 12,
83  DIO_CHANNEL_13 = 13,
84  DIO_CHANNEL_14 = 14,
85  DIO_CHANNEL_15 = 15,
86  };
87 
88 
94  enum DIO_MODE {
95  DIO_OPENDRAIN = 0,
96  DIO_PUSHPULL = 1,
97  };
98 
99 
106  DIO_OR = 0,
107  DIO_AND = 1,
108  };
109 
110 
114  struct channel {
115  struct iio_channel* m_channel;
116  DIO_DIRECTION m_direction;
117  };
118 }
119 }
120 
121 
122 #endif
DIO_LEVEL
Logic voltage levels.
Definition: enums.hpp:56
DIO_CHANNEL
Indexes of the channels.
Definition: enums.hpp:69
DIO_TRIGGER_MODE
Triggering mode for digital channels.
Definition: enums.hpp:105
DIO_MODE
Output mode for a digital channel.
Definition: enums.hpp:94
DIO_DIRECTION
Direction of a digital channel.
Definition: enums.hpp:43