Loading...
Searching...
No Matches
enums.hpp
Go to the documentation of this file.
/*
* Copyright (c) 2019 Analog Devices Inc.
*
* This file is part of libm2k
* (see http://www.github.com/analogdevicesinc/libm2k).
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ENUMS_HPP
#define ENUMS_HPP
#include <string>
#include <vector>
extern "C" {
struct iio_context;
struct iio_device;
struct iio_channel;
struct iio_buffer;
}
namespace libm2k {
enum CALIBRATION_MODE {
ADC_REF1,
ADC_REF2,
ADC_GND,
DAC,
NONE
};
struct CALIBRATION_PARAMETERS {
int adc_offset_ch_1;
int adc_offset_ch_2;
double adc_gain_ch_1;
double adc_gain_ch_2;
int dac_a_offset;
int dac_b_offset;
double dac_a_gain;
double dac_b_gain;
};
enum GAIN_MODE {
LOW_GAIN,
HIGH_GAIN
};
enum M2K_EXCEPTION_TYPE {
EXC_OUT_OF_RANGE = 0,
EXC_RUNTIME_ERROR = 1,
EXC_INVALID_PARAMETER = 2,
EXC_TIMEOUT = 3,
EXC_INVALID_FIRMWARE_VERSION = 4
};
enum M2K_TRIGGER_CONDITION_ANALOG {
RISING_EDGE_ANALOG = 0,
FALLING_EDGE_ANALOG = 1,
LOW_LEVEL_ANALOG = 2,
HIGH_LEVEL_ANALOG = 3
};
enum M2K_TRIGGER_CONDITION_DIGITAL {
RISING_EDGE_DIGITAL = 0,
FALLING_EDGE_DIGITAL = 1,
LOW_LEVEL_DIGITAL = 2,
HIGH_LEVEL_DIGITAL = 3,
ANY_EDGE_DIGITAL = 4,
NO_TRIGGER_DIGITAL = 5,
};
enum M2K_TRIGGER_MODE {
ALWAYS = 0,
ANALOG = 1,
EXTERNAL = 2,
DIGITAL_OR_ANALOG = 3,
DIGITAL_AND_ANALOG = 4,
DIGITAL_XOR_ANALOG = 5,
N_DIGITAL_OR_ANALOG = 6,
N_DIGITAL_AND_ANALOG = 7,
N_DIGITAL_XOR_ANALOG = 8,
};
enum M2K_TRIGGER_SOURCE_ANALOG {
CHANNEL_1 = 0,
CHANNEL_2 = 1,
CHANNEL_1_OR_CHANNEL_2 = 2,
CHANNEL_1_AND_CHANNEL_2 = 3,
CHANNEL_1_XOR_CHANNEL_2 = 4,
SRC_DIGITAL_IN = 5,
CHANNEL_1_OR_SRC_LOGIC_ANALYZER = 6,
CHANNEL_2_OR_SRC_LOGIC_ANALYZER = 7,
CHANNEL_1_OR_CHANNEL_2_OR_SRC_LOGIC_ANALYZER = 8,
NO_SOURCE = 9,
};
enum M2K_TRIGGER_SOURCE_OUT {
TRIGGER_NONE = 0,
TRIGGER_TI = 1,
TRIGGER_ADC = 2,
TRIGGER_LA = 3,
};
enum M2K_TRIGGER_CONDITION_OUT {
NONE_OUT = 0,
LOW_LEVEL_OUT = 1,
HIGH_LEVEL_OUT = 2,
ANY_EDGE_OUT = 3,
RISING_EDGE_OUT = 4,
FALLING_EDGE_OUT = 5,
};
enum M2K_TRIGGER_STATUS_ANALOG_OUT {
DISABLED = 0,
START = 1,
STOP = 2,
};
enum M2K_TRIGGER_SOURCE_DIGITAL {
SRC_TRIGGER_IN = 0,
SRC_ANALOG_IN = 1,
SRC_NONE = 2,
SRC_DISABLED = 3,
};
enum M2K_TRIGGER_OUT_SELECT {
SELECT_NONE = 0,
SELECT_TRIGGER_I_SAME_CHAN = 1,
SELECT_TRIGGER_IN = 2,
SELECT_ANALOG_IN = 3,
SELECT_DIGITAL_IN = 4
};
struct SETTINGS {
std::vector<M2K_TRIGGER_CONDITION_ANALOG> analog_condition;
std::vector<M2K_TRIGGER_CONDITION_DIGITAL> digital_condition;
std::vector<int> raw_level;
std::vector<double> level;
std::vector<double> hysteresis;
std::vector<M2K_TRIGGER_MODE> mode;
M2K_TRIGGER_SOURCE_ANALOG trigger_source;
int delay;
};
struct CONTEXT_INFO {
std::string id_vendor;
std::string id_product;
std::string manufacturer;
std::string product;
std::string serial;
std::string uri;
};
struct IIO_OBJECTS {
std::vector<iio_channel*> channels_in;
std::vector<iio_channel*> channels_out;
std::vector<iio_device*> devices;
std::vector<iio_buffer*> buffers_rx;
std::vector<iio_buffer*> buffers_tx;
iio_context* context;
};
struct IIO_CONTEXT_VERSION {
unsigned int major;
unsigned int minor;
char git_tag[8];
};
}
#endif
libm2k::M2K_TRIGGER_SOURCE_DIGITAL
M2K_TRIGGER_SOURCE_DIGITAL
Select the source for the digital trigger.
Definition enums.hpp:193
libm2k::SRC_NONE
@ SRC_NONE
SRC_NONE - trigger events on the DigitalIn are conditioned by the internal digital trigger structure.
Definition enums.hpp:196
libm2k::SRC_DISABLED
@ SRC_DISABLED
SRC_DISABLED - block the DigitalIn interface.
Definition enums.hpp:197
libm2k::SRC_TRIGGER_IN
@ SRC_TRIGGER_IN
SRC_TRIGGER_IN - trigger events on the TI(trigger in) pin trigger the DigitalIn interface.
Definition enums.hpp:194
libm2k::SRC_ANALOG_IN
@ SRC_ANALOG_IN
SRC_ANALOG_IN - trigger events on the AnalogIn interface trigger the DigitalIn interface.
Definition enums.hpp:195
libm2k::M2K_EXCEPTION_TYPE
M2K_EXCEPTION_TYPE
M2k exception types.
Definition enums.hpp:82
libm2k::M2K_TRIGGER_CONDITION_OUT
M2K_TRIGGER_CONDITION_OUT
Trigger condition when the source for M2K_TRIGGER_SOURCE_OUT is TRIGGER_TI.
Definition enums.hpp:169
libm2k::M2K_TRIGGER_OUT_SELECT
M2K_TRIGGER_OUT_SELECT
Select which trigger event will be forwarded on TO pin (trigger out)
Definition enums.hpp:205
libm2k::SELECT_NONE
@ SELECT_NONE
SELECT_NONE - no trigger event is forwarded.
Definition enums.hpp:206
libm2k::SELECT_DIGITAL_IN
@ SELECT_DIGITAL_IN
SELECT_DIGITAL_IN - forwards trigger events from DigitalIn interface.
Definition enums.hpp:210
libm2k::SELECT_ANALOG_IN
@ SELECT_ANALOG_IN
SELECT_ANALOG_IN - forwards trigger events from AnalogIn interface.
Definition enums.hpp:209
libm2k::SELECT_TRIGGER_IN
@ SELECT_TRIGGER_IN
SELECT_TRIGGER_IN - forwards trigger events from TI pin(trigger in)
Definition enums.hpp:208
libm2k::M2K_TRIGGER_CONDITION_ANALOG
M2K_TRIGGER_CONDITION_ANALOG
Condition of triggering.
Definition enums.hpp:96
libm2k::M2K_TRIGGER_STATUS_ANALOG_OUT
M2K_TRIGGER_STATUS_ANALOG_OUT
The status value determines the action that the output interface will take when the trigger condition...
Definition enums.hpp:182
libm2k::M2K_TRIGGER_CONDITION_DIGITAL
M2K_TRIGGER_CONDITION_DIGITAL
Condition of triggering.
Definition enums.hpp:109
libm2k::M2K_TRIGGER_SOURCE_OUT
M2K_TRIGGER_SOURCE_OUT
Selects the source trigger for the output interfaces.
Definition enums.hpp:158
libm2k::M2K_TRIGGER_MODE
M2K_TRIGGER_MODE
Select the mode for the analog trigger.
Definition enums.hpp:123
libm2k::EXTERNAL
@ EXTERNAL
EXTERNAL - Trigger condition specified only by external trigger (TI)
Definition enums.hpp:126
libm2k::ANALOG
@ ANALOG
ANALOG - Trigger condition specified only by analog trigger (CH1 and CH2)
Definition enums.hpp:125
libm2k::ALWAYS
@ ALWAYS
ALWAYS - Disable analog trigger;.
Definition enums.hpp:124
libm2k::M2K_TRIGGER_SOURCE_ANALOG
M2K_TRIGGER_SOURCE_ANALOG
Select the source for the analog trigger.
Definition enums.hpp:140
libm2k::SRC_DIGITAL_IN
@ SRC_DIGITAL_IN
SRC_DIGITAL_IN - trigger events on the DigitalIn interface trigger the AnalogIn interface.
Definition enums.hpp:146
libm2k::NO_SOURCE
@ NO_SOURCE
NO_SOURCE - block the AnalogIn interface.
Definition enums.hpp:150
libm2k::CHANNEL_2
@ CHANNEL_2
CHANNEL_2 - trigger events on analog CHANNEL_2 trigger the AnalogIn interface.
Definition enums.hpp:142
libm2k::CHANNEL_1
@ CHANNEL_1
CHANNEL_1 - trigger events on analog CHANNEL_1 trigger the AnalogIn interface.
Definition enums.hpp:141
libm2k::CALIBRATION_PARAMETERS
Calibration parameters of m2k.
Definition enums.hpp:57
libm2k::CALIBRATION_PARAMETERS::dac_b_gain
double dac_b_gain
DAC calibration gain - channel 2.
Definition enums.hpp:65
libm2k::CALIBRATION_PARAMETERS::adc_offset_ch_2
int adc_offset_ch_2
ADC calibration offset - channel 2.
Definition enums.hpp:59
libm2k::CALIBRATION_PARAMETERS::dac_a_offset
int dac_a_offset
DAC calibration offset - channel 1.
Definition enums.hpp:62
libm2k::CALIBRATION_PARAMETERS::dac_b_offset
int dac_b_offset
DAC calibration offset - channel 2.
Definition enums.hpp:63
libm2k::CALIBRATION_PARAMETERS::adc_gain_ch_2
double adc_gain_ch_2
ADC calibration gain - channel 2.
Definition enums.hpp:61
libm2k::CALIBRATION_PARAMETERS::adc_offset_ch_1
int adc_offset_ch_1
ADC calibration offset - channel 1.
Definition enums.hpp:58
libm2k::CALIBRATION_PARAMETERS::dac_a_gain
double dac_a_gain
DAC calibration gain - channel 1.
Definition enums.hpp:64
libm2k::CALIBRATION_PARAMETERS::adc_gain_ch_1
double adc_gain_ch_1
ADC calibration gain - channel 1.
Definition enums.hpp:60
libm2k::CONTEXT_INFO
Additional information about the context.
Definition enums.hpp:235
libm2k::CONTEXT_INFO::product
std::string product
Product name extracted from IIO context.
Definition enums.hpp:239
libm2k::CONTEXT_INFO::id_product
std::string id_product
Product ID extracted from IIO context.
Definition enums.hpp:237
libm2k::CONTEXT_INFO::id_vendor
std::string id_vendor
Vendor ID extracted from IIO context.
Definition enums.hpp:236
libm2k::CONTEXT_INFO::manufacturer
std::string manufacturer
Manufacturer extracted from IIO context.
Definition enums.hpp:238
libm2k::CONTEXT_INFO::uri
std::string uri
IIO context URI.
Definition enums.hpp:241
libm2k::CONTEXT_INFO::serial
std::string serial
Serial number.
Definition enums.hpp:240
libm2k::IIO_CONTEXT_VERSION
The version of the backend.
Definition enums.hpp:261
libm2k::IIO_CONTEXT_VERSION::minor
unsigned int minor
minor version
Definition enums.hpp:263
libm2k::IIO_CONTEXT_VERSION::git_tag
char git_tag[8]
git tag
Definition enums.hpp:264
libm2k::IIO_CONTEXT_VERSION::major
unsigned int major
major version
Definition enums.hpp:262
libm2k::SETTINGS
Triggering system.
Definition enums.hpp:219
libm2k::SETTINGS::analog_condition
std::vector< M2K_TRIGGER_CONDITION_ANALOG > analog_condition
Analogical trigger's condition.
Definition enums.hpp:220
libm2k::SETTINGS::mode
std::vector< M2K_TRIGGER_MODE > mode
Triggering mode.
Definition enums.hpp:225
libm2k::SETTINGS::trigger_source
M2K_TRIGGER_SOURCE_ANALOG trigger_source
Triggering source.
Definition enums.hpp:226
libm2k::SETTINGS::raw_level
std::vector< int > raw_level
Trigger's raw level.
Definition enums.hpp:222
libm2k::SETTINGS::level
std::vector< double > level
Trigger's level.
Definition enums.hpp:223
libm2k::SETTINGS::delay
int delay
Trigger's delay.
Definition enums.hpp:227
libm2k::SETTINGS::digital_condition
std::vector< M2K_TRIGGER_CONDITION_DIGITAL > digital_condition
Digital trigger's condition.
Definition enums.hpp:221
libm2k::SETTINGS::hysteresis
std::vector< double > hysteresis
Trigger's hysteresis.
Definition enums.hpp:224