22#ifndef M2KANALOGIN_HPP
23#define M2KANALOGIN_HPP
25#include <libm2k/m2kglobal.hpp>
27#include <libm2k/m2khardwaretrigger.hpp>
57 virtual void reset() = 0;
82 virtual std::vector<std::vector<double>>
getSamples(
unsigned int nb_samples) = 0;
95 virtual std::vector<std::vector<double>>
getSamplesRaw(
unsigned int nb_samples) = 0;
474 virtual struct IIO_OBJECTS getIioObjects() = 0;
488 virtual void getSamples(std::vector<std::vector<double>> &data,
unsigned int nb_samples) = 0;
M2K_RANGE
Range of the signal's amplitude.
Definition analog/enums.hpp:70
ANALOG_IN_CHANNEL
Indexes of the channels.
Definition analog/enums.hpp:59
Controls the hardware trigger for ADALM2000.
Definition m2khardwaretrigger.hpp:42
Controls the analogical input compound.
Definition m2kanalogin.hpp:47
virtual double getScalingFactor(libm2k::analog::ANALOG_IN_CHANNEL ch)=0
Retrieve the scaling factor.
virtual std::pair< double, double > getRangeLimits(libm2k::analog::M2K_RANGE range)=0
Retrieve the bounds for the given range.
virtual double setSampleRate(double samplerate)=0
Set the global sample rate.
virtual double getFilterCompensation(double samplerate)=0
Retrieve the filter compensation for the given sample rate.
virtual std::string getChannelName(unsigned int channel)=0
Get the channel name for each ADC channel.
virtual int setOversamplingRatio(unsigned int chn_idx, int oversampling)=0
Set the oversampling ratio for the given channel.
virtual const double * getSamplesInterleaved_matlab(unsigned int nb_samples)=0
Retrieve a specific number of samples from both channels.
virtual const short * getSamplesRawInterleaved(unsigned int nb_samples_per_channel)=0
Retrieve a specific number of raw samples from each channel.
virtual libm2k::analog::M2K_RANGE getRange(libm2k::analog::ANALOG_IN_CHANNEL channel)=0
Retrieve the range for the given channel.
virtual double convertRawToVolts(unsigned int channel, short raw)=0
Convert the raw value of a sample into volts.
virtual void setKernelBuffersCount(unsigned int count)=0
Set the kernel buffers to a specific value.
virtual std::vector< short > getVoltageRaw()=0
Retrieve the average raw value for each channel.
virtual short getVoltageRaw(libm2k::analog::ANALOG_IN_CHANNEL ch)=0
Retrieve the average raw value of the given channel.
virtual short getVoltageRaw(unsigned int ch)=0
Retrieve the average raw value of the given channel.
virtual void stopAcquisition()=0
Destroy the buffer and stop the acquisition.
virtual int getOversamplingRatio()=0
Retrieve the global oversampling ratio.
virtual double getVoltage(unsigned int ch)=0
Retrieve the average voltage of the given channel.
virtual bool isChannelEnabled(unsigned int chnIdx)=0
Retrieve the state of the given channel.
virtual const short * getSamplesRawInterleaved_matlab(unsigned int nb_samples)=0
Retrieve a specific number of raw samples from both channels.
virtual double getSampleRate()=0
Retrieve the global sample rate.
virtual const double * getVoltageP()=0
Retrieve the average voltage for both channels.
virtual void enableChannel(unsigned int chnIdx, bool enable)=0
Enable or disable the given channel.
virtual void setVerticalOffset(ANALOG_IN_CHANNEL channel, double vertOffset)=0
Set the vertical offset, in Volts, of a specific channel.
virtual void getSamples(std::vector< std::vector< double > > &data, unsigned int nb_samples)=0
Retrieve a specific number of samples from each channel.
virtual std::vector< std::vector< double > > getSamples(unsigned int nb_samples)=0
Retrieve a specific number of samples from each channel.
virtual std::vector< std::pair< std::string, std::pair< double, double > > > getAvailableRanges()=0
Retrieve all ranges that are available.
virtual const short * getVoltageRawP()=0
Retrieve the average raw value for both channels.
virtual void startAcquisition(unsigned int nb_samples)=0
Create the buffer for both channels and start the acquisition.
virtual void cancelAcquisition()=0
Cancel all buffer operations.
virtual double getValueForRange(M2K_RANGE range)=0
Retrieve the numeric value corresponding to the given range.
virtual std::vector< double > getAvailableSampleRates()=0
getAvailableSampleRates
virtual void setRange(ANALOG_IN_CHANNEL channel, double min, double max)=0
Set the range for the given channel.
virtual double getVoltage(libm2k::analog::ANALOG_IN_CHANNEL ch)=0
Retrieve the average voltage of the given channel.
virtual libm2k::M2kHardwareTrigger * getTrigger()=0
Get the hardware trigger handler.
virtual std::string getName()=0
Retrieve the name of the device.
virtual short convertVoltsToRaw(unsigned int channel, double voltage)=0
Convert the voltage value of a sample into raw.
virtual int getOversamplingRatio(unsigned int chn_idx)=0
Retrieve the oversampling ratio for the given channel.
virtual unsigned int getKernelBuffersCount() const =0
Get the number of kernel buffers.
virtual double getMaximumSamplerate()=0
Get the maximum samplerate for the ADC.
virtual const double * getSamplesInterleaved(unsigned int nb_samples_per_channel)=0
Retrieve a specific number of samples from each channel.
virtual double getVerticalOffset(ANALOG_IN_CHANNEL channel)=0
getVerticalOffset
virtual std::vector< std::vector< double > > getSamplesRaw(unsigned int nb_samples)=0
Retrieve a specific number of raw samples from each channel.
virtual std::vector< double > getVoltage()=0
Retrieve the average voltage for each channel.
virtual void setRange(ANALOG_IN_CHANNEL channel, M2K_RANGE range)=0
Set the range for the given channel.
virtual unsigned int getNbChannels()=0
Retrieve the number of analogical channels.
virtual int setOversamplingRatio(int oversampling)=0
Set the global oversampling ratio.
virtual std::pair< double, double > getHysteresisRange(ANALOG_IN_CHANNEL chn)=0
Retrieve the bounds of the analogical trigger's hysteresis for the given channel.