Loading...
Searching...
No Matches
m2khardwaretrigger.hpp
/*
* 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 M2KHARDWARETRIGGER_HPP
#define M2KHARDWARETRIGGER_HPP
#include <libm2k/enums.hpp>
#include <libm2k/digital/enums.hpp>
#include <libm2k/m2kglobal.hpp>
#include <libm2k/m2k.hpp>
#include <vector>
#include <memory>
namespace libm2k {
class LIBM2K_API M2kHardwareTrigger
{
public:
virtual ~M2kHardwareTrigger() {}
virtual void reset() = 0;
virtual int getAnalogLevelRaw(unsigned int chnIdx) = 0;
virtual void setAnalogLevelRaw(unsigned int chnIdx, int level) = 0;
virtual void setAnalogLevel(unsigned int chnIdx, double v_level) = 0;
virtual double getAnalogLevel(unsigned int chnIdx) = 0;
virtual double getAnalogHysteresis(unsigned int chnIdx) = 0;
virtual void setAnalogHysteresis(unsigned int chnIdx, double hysteresis) = 0;
virtual M2K_TRIGGER_CONDITION_ANALOG getAnalogCondition(unsigned int chnIdx) = 0;
virtual void setAnalogCondition(unsigned int chnIdx, M2K_TRIGGER_CONDITION_ANALOG cond) = 0;
virtual M2K_TRIGGER_CONDITION_DIGITAL getDigitalCondition(unsigned int chnIdx) = 0;
virtual M2K_TRIGGER_CONDITION_DIGITAL getDigitalCondition(libm2k::digital::DIO_CHANNEL chnIdx) = 0;
virtual void setDigitalCondition(unsigned int chnIdx, M2K_TRIGGER_CONDITION_DIGITAL cond) = 0;
virtual void setDigitalCondition(libm2k::digital::DIO_CHANNEL chnIdx, M2K_TRIGGER_CONDITION_DIGITAL cond) = 0;
virtual M2K_TRIGGER_MODE getAnalogMode(unsigned int chnIdx) = 0;
virtual void setAnalogMode(unsigned int chnIdx, M2K_TRIGGER_MODE mode) = 0;
virtual libm2k::digital::DIO_TRIGGER_MODE getDigitalMode() = 0;
virtual void setDigitalMode(libm2k::digital::DIO_TRIGGER_MODE mode) = 0;
virtual M2K_TRIGGER_SOURCE_ANALOG getAnalogSource() = 0;
virtual void setAnalogSource(M2K_TRIGGER_SOURCE_ANALOG src) = 0;
virtual int getAnalogSourceChannel() = 0;
virtual void setAnalogSourceChannel(unsigned int chnIdx) = 0;
virtual int getAnalogDelay() const = 0;
virtual void setAnalogDelay(int delay) = 0;
virtual int getDigitalDelay() const = 0;
virtual void setDigitalDelay(int delay) = 0;
virtual struct SETTINGS *getCurrentHwSettings() = 0;
virtual void setHwTriggerSettings(struct SETTINGS *settings) = 0;
virtual void setAnalogStreamingFlag(bool enable) = 0;
virtual bool getAnalogStreamingFlag() = 0;
virtual void setDigitalStreamingFlag(bool enable) = 0;
virtual bool getDigitalStreamingFlag() = 0;
virtual void setCalibParameters(unsigned int chnIdx, double scaling, double vert_offset) = 0;
virtual M2K_TRIGGER_CONDITION_DIGITAL getAnalogExternalCondition(unsigned int chnIdx) = 0;
virtual void setAnalogExternalCondition(unsigned int chnIdx, M2K_TRIGGER_CONDITION_DIGITAL cond) = 0;
virtual M2K_TRIGGER_CONDITION_DIGITAL getDigitalExternalCondition() const = 0;
virtual void setDigitalExternalCondition(M2K_TRIGGER_CONDITION_DIGITAL cond) = 0;
virtual void setAnalogExternalOutSelect(M2K_TRIGGER_OUT_SELECT output_select);
virtual M2K_TRIGGER_OUT_SELECT getAnalogExternalOutSelect();
virtual bool hasExternalTriggerIn() const = 0;
virtual bool hasExternalTriggerOut() const = 0;
virtual bool hasCrossInstrumentTrigger() const = 0;
virtual void setDigitalSource(M2K_TRIGGER_SOURCE_DIGITAL external_src);
virtual M2K_TRIGGER_SOURCE_DIGITAL getDigitalSource() const;
virtual void setAnalogOutTriggerSource(M2K_TRIGGER_SOURCE_OUT src) = 0;
virtual M2K_TRIGGER_SOURCE_OUT getAnalogOutTriggerSource() const = 0;
virtual void setAnalogOutTriggerCondition(M2K_TRIGGER_CONDITION_OUT condition) = 0;
virtual M2K_TRIGGER_CONDITION_OUT getAnalogOutTriggerCondition() const = 0;
virtual void setAnalogOutTriggerStatus(M2K_TRIGGER_STATUS_ANALOG_OUT status) = 0;
virtual M2K_TRIGGER_STATUS_ANALOG_OUT getAnalogOutTriggerStatus() const = 0;
};
}
#endif //M2KHARDWARETRIGGER_HPP
libm2k::M2kHardwareTrigger
Controls the hardware trigger for ADALM2000.
Definition m2khardwaretrigger.hpp:42
enums.hpp
Digital enumerations.
libm2k::digital::DIO_CHANNEL
DIO_CHANNEL
Indexes of the channels.
Definition digital/enums.hpp:69
libm2k::digital::DIO_TRIGGER_MODE
DIO_TRIGGER_MODE
Triggering mode for digital channels.
Definition digital/enums.hpp:105
enums.hpp
Generic M2K enumerations.
libm2k::M2K_TRIGGER_SOURCE_DIGITAL
M2K_TRIGGER_SOURCE_DIGITAL
Select the source for the digital trigger.
Definition enums.hpp:193
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::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::M2K_TRIGGER_SOURCE_ANALOG
M2K_TRIGGER_SOURCE_ANALOG
Select the source for the analog trigger.
Definition enums.hpp:140
libm2k::M2kHardwareTrigger::getAnalogDelay
virtual int getAnalogDelay() const =0
Get the analog trigger delay.
libm2k::M2kHardwareTrigger::getAnalogExternalCondition
virtual M2K_TRIGGER_CONDITION_DIGITAL getAnalogExternalCondition(unsigned int chnIdx)=0
getAnalogExternalCondition
libm2k::M2kHardwareTrigger::getAnalogSourceChannel
virtual int getAnalogSourceChannel()=0
Get the channel source of the analog trigger.
libm2k::M2kHardwareTrigger::getDigitalSource
virtual M2K_TRIGGER_SOURCE_DIGITAL getDigitalSource() const
Check which is the source of the DigitalIn interface trigger event.
libm2k::M2kHardwareTrigger::getAnalogOutTriggerCondition
virtual M2K_TRIGGER_CONDITION_OUT getAnalogOutTriggerCondition() const =0
Returns the condition of the AnalogOut trigger event when the source is TI.
libm2k::M2kHardwareTrigger::setAnalogDelay
virtual void setAnalogDelay(int delay)=0
Set the analog trigger delay.
libm2k::M2kHardwareTrigger::getAnalogHysteresis
virtual double getAnalogHysteresis(unsigned int chnIdx)=0
Get the analog hysteresis value for one channel.
libm2k::M2kHardwareTrigger::getAnalogCondition
virtual M2K_TRIGGER_CONDITION_ANALOG getAnalogCondition(unsigned int chnIdx)=0
Get the trigger condition for the analog trigger on a specific channel.
libm2k::M2kHardwareTrigger::setAnalogHysteresis
virtual void setAnalogHysteresis(unsigned int chnIdx, double hysteresis)=0
Set the analog hysteresis value for one channel.
libm2k::M2kHardwareTrigger::setAnalogCondition
virtual void setAnalogCondition(unsigned int chnIdx, M2K_TRIGGER_CONDITION_ANALOG cond)=0
Set the trigger condition for the analog trigger on a specific channel.
libm2k::M2kHardwareTrigger::setAnalogLevelRaw
virtual void setAnalogLevelRaw(unsigned int chnIdx, int level)=0
Set the raw analog trigger level for one channel.
libm2k::M2kHardwareTrigger::setAnalogOutTriggerSource
virtual void setAnalogOutTriggerSource(M2K_TRIGGER_SOURCE_OUT src)=0
Select which interface triggers the AnalogOut.
libm2k::M2kHardwareTrigger::setAnalogSource
virtual void setAnalogSource(M2K_TRIGGER_SOURCE_ANALOG src)=0
Set the source of the analog trigger.
libm2k::M2kHardwareTrigger::getAnalogLevel
virtual double getAnalogLevel(unsigned int chnIdx)=0
Get the analog trigger level for one channel.
libm2k::M2kHardwareTrigger::setAnalogLevel
virtual void setAnalogLevel(unsigned int chnIdx, double v_level)=0
Set the analog trigger level for one channel.
libm2k::M2kHardwareTrigger::setAnalogExternalCondition
virtual void setAnalogExternalCondition(unsigned int chnIdx, M2K_TRIGGER_CONDITION_DIGITAL cond)=0
setAnalogExternalCondition
libm2k::M2kHardwareTrigger::getAnalogOutTriggerSource
virtual M2K_TRIGGER_SOURCE_OUT getAnalogOutTriggerSource() const =0
Returns the source of the AnalogOut trigger event.
libm2k::M2kHardwareTrigger::setAnalogExternalOutSelect
virtual void setAnalogExternalOutSelect(M2K_TRIGGER_OUT_SELECT output_select)
Select what should be redirected on the TO (trigger out) pin. The options are (none,...
libm2k::M2kHardwareTrigger::getDigitalCondition
virtual M2K_TRIGGER_CONDITION_DIGITAL getDigitalCondition(libm2k::digital::DIO_CHANNEL chnIdx)=0
Get the trigger condition for the digital trigger on a specific channel.
libm2k::M2kHardwareTrigger::setDigitalMode
virtual void setDigitalMode(libm2k::digital::DIO_TRIGGER_MODE mode)=0
Set the mode for the digital trigger.
libm2k::M2kHardwareTrigger::setDigitalSource
virtual void setDigitalSource(M2K_TRIGGER_SOURCE_DIGITAL external_src)
Select which interface triggers the DigitalIn.
libm2k::M2kHardwareTrigger::getAnalogMode
virtual M2K_TRIGGER_MODE getAnalogMode(unsigned int chnIdx)=0
Get the mode for the analog trigger on a specific channel.
libm2k::M2kHardwareTrigger::getAnalogSource
virtual M2K_TRIGGER_SOURCE_ANALOG getAnalogSource()=0
Get the source of the analog trigger.
libm2k::M2kHardwareTrigger::setDigitalExternalCondition
virtual void setDigitalExternalCondition(M2K_TRIGGER_CONDITION_DIGITAL cond)=0
setDigitalExternalCondition
libm2k::M2kHardwareTrigger::setAnalogMode
virtual void setAnalogMode(unsigned int chnIdx, M2K_TRIGGER_MODE mode)=0
Set the mode for the analog trigger on a specific channel.
libm2k::M2kHardwareTrigger::setAnalogSourceChannel
virtual void setAnalogSourceChannel(unsigned int chnIdx)=0
Set the channel source of the analog trigger.
libm2k::M2kHardwareTrigger::setDigitalStreamingFlag
virtual void setDigitalStreamingFlag(bool enable)=0
Set the streaming flag for the digital part.
libm2k::M2kHardwareTrigger::getDigitalCondition
virtual M2K_TRIGGER_CONDITION_DIGITAL getDigitalCondition(unsigned int chnIdx)=0
Get the trigger condition for the digital trigger on a specific channel.
libm2k::M2kHardwareTrigger::setAnalogStreamingFlag
virtual void setAnalogStreamingFlag(bool enable)=0
Set the streaming flag for the analog part.
libm2k::M2kHardwareTrigger::getDigitalMode
virtual libm2k::digital::DIO_TRIGGER_MODE getDigitalMode()=0
Get the mode for the digital trigger.
libm2k::M2kHardwareTrigger::getAnalogExternalOutSelect
virtual M2K_TRIGGER_OUT_SELECT getAnalogExternalOutSelect()
Check which trigger events are forwarded on the TO (trigger out) pin.
libm2k::M2kHardwareTrigger::getDigitalDelay
virtual int getDigitalDelay() const =0
Get the digital trigger delay.
libm2k::M2kHardwareTrigger::getAnalogStreamingFlag
virtual bool getAnalogStreamingFlag()=0
Get the streaming flag for the analog part.
libm2k::M2kHardwareTrigger::getDigitalExternalCondition
virtual M2K_TRIGGER_CONDITION_DIGITAL getDigitalExternalCondition() const =0
getDigitalExternalCondition
libm2k::M2kHardwareTrigger::setAnalogOutTriggerStatus
virtual void setAnalogOutTriggerStatus(M2K_TRIGGER_STATUS_ANALOG_OUT status)=0
Defines the action to be performed when a trigger event occurs.
libm2k::M2kHardwareTrigger::setDigitalDelay
virtual void setDigitalDelay(int delay)=0
Set the digital trigger delay.
libm2k::M2kHardwareTrigger::getAnalogLevelRaw
virtual int getAnalogLevelRaw(unsigned int chnIdx)=0
Get the raw analog trigger level for one channel.
libm2k::M2kHardwareTrigger::setDigitalCondition
virtual void setDigitalCondition(unsigned int chnIdx, M2K_TRIGGER_CONDITION_DIGITAL cond)=0
Set the trigger condition for the digital trigger on a specific channel.
libm2k::M2kHardwareTrigger::setDigitalCondition
virtual void setDigitalCondition(libm2k::digital::DIO_CHANNEL chnIdx, M2K_TRIGGER_CONDITION_DIGITAL cond)=0
Set the trigger condition for the digital trigger on a specific channel.
libm2k::M2kHardwareTrigger::getAnalogOutTriggerStatus
virtual M2K_TRIGGER_STATUS_ANALOG_OUT getAnalogOutTriggerStatus() const =0
Returns the action that is performed when a trigger event occurs.
libm2k::M2kHardwareTrigger::getDigitalStreamingFlag
virtual bool getDigitalStreamingFlag()=0
Get the streaming flag for the digital part.
libm2k::M2kHardwareTrigger::setAnalogOutTriggerCondition
virtual void setAnalogOutTriggerCondition(M2K_TRIGGER_CONDITION_OUT condition)=0
Configures the triggering condition when the source of the AnalogOut trigger event is set to TRIGGER_...
libm2k::SETTINGS
Triggering system.
Definition enums.hpp:219