ngscopeclient 0.1-dev+51fbda87c
OwonXDGFunctionGenerator.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef OwonXDGFunctionGenerator_h
36#define OwonXDGFunctionGenerator_h
37
42{
43public:
46
47 //Device information
48 virtual unsigned int GetInstrumentTypes() const override;
49 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
50
51 virtual bool AcquireData() override;
52
53 virtual std::vector<WaveShape> GetAvailableWaveformShapes(int chan) override;
54
55 virtual bool GetFunctionChannelActive(int chan) override;
56 virtual void SetFunctionChannelActive(int chan, bool on) override;
57
58 virtual float GetFunctionChannelDutyCycle(int chan) override;
59 virtual void SetFunctionChannelDutyCycle(int chan, float duty) override;
60
61 virtual float GetFunctionChannelAmplitude(int chan) override;
62 virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override;
63
64 virtual float GetFunctionChannelOffset(int chan) override;
65 virtual void SetFunctionChannelOffset(int chan, float offset) override;
66
67 virtual float GetFunctionChannelFrequency(int chan) override;
68 virtual void SetFunctionChannelFrequency(int chan, float hz) override;
69
70 virtual WaveShape GetFunctionChannelShape(int chan) override;
71 virtual void SetFunctionChannelShape(int chan, WaveShape shape) override;
72
73 virtual bool HasFunctionRiseFallTimeControls(int chan) override;
74 virtual float GetFunctionChannelRiseTime(int chan) override;
75 virtual void SetFunctionChannelRiseTime(int chan, float fs) override;
76 virtual float GetFunctionChannelFallTime(int chan) override;
77 virtual void SetFunctionChannelFallTime(int chan, float fs) override;
78
79 virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override;
80 virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override;
81
82public:
83 static std::string GetDriverNameInternal();
84 GENERATOR_INITPROC(OwonXDGFunctionGenerator)
85
86protected:
87 bool m_cachedFrequencyValid[2];
88 int64_t m_cachedFrequency[2];
89};
90
91#endif
WaveShape
Predefined waveform shapes.
Definition: FunctionGenerator.h:55
OutputImpedance
Nominal output impedance for a function generator channel.
Definition: FunctionGenerator.h:259
Owon XDG Function Generator series driver class.
Definition: OwonXDGFunctionGenerator.h:42
virtual void SetFunctionChannelRiseTime(int chan, float fs) override
Sets the rise time for a function generator output (if supported)
Definition: OwonXDGFunctionGenerator.cpp:463
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: OwonXDGFunctionGenerator.cpp:65
virtual bool AcquireData() override
Pull data from the instrument.
Definition: OwonXDGFunctionGenerator.cpp:78
virtual float GetFunctionChannelOffset(int chan) override
Gets the DC offset for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:171
virtual float GetFunctionChannelDutyCycle(int chan) override
Gets the duty cycle for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:440
virtual void SetFunctionChannelFallTime(int chan, float fs) override
Sets the fall time for a function generator output (if supported)
Definition: OwonXDGFunctionGenerator.cpp:476
virtual void SetFunctionChannelOffset(int chan, float offset) override
Sets the DC offset for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:177
virtual bool GetFunctionChannelActive(int chan) override
Returns true if the function generator channel's output is enabled.
Definition: OwonXDGFunctionGenerator.cpp:144
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: OwonXDGFunctionGenerator.cpp:70
virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override
Sets the currently selected output impedance for a function generator output (if supported)
Definition: OwonXDGFunctionGenerator.cpp:491
virtual std::vector< WaveShape > GetAvailableWaveformShapes(int chan) override
Query the set of available pre-defined waveforms for this generator.
Definition: OwonXDGFunctionGenerator.cpp:91
virtual void SetFunctionChannelActive(int chan, bool on) override
Turns a function generator channel on or off.
Definition: OwonXDGFunctionGenerator.cpp:152
virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override
Sets the amplitude for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:166
virtual float GetFunctionChannelFallTime(int chan) override
Gets the fall time for a function generator output (if supported)
Definition: OwonXDGFunctionGenerator.cpp:470
virtual float GetFunctionChannelFrequency(int chan) override
Gets the frequency for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:182
virtual bool HasFunctionRiseFallTimeControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition: OwonXDGFunctionGenerator.cpp:452
virtual void SetFunctionChannelShape(int chan, WaveShape shape) override
Sets the waveform shape for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:282
virtual float GetFunctionChannelRiseTime(int chan) override
Gets the rise time for a function generator output (if supported)
Definition: OwonXDGFunctionGenerator.cpp:457
virtual WaveShape GetFunctionChannelShape(int chan) override
Gets the waveform shape for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:201
virtual float GetFunctionChannelAmplitude(int chan) override
Gets the amplitude for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:160
virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override
Gets the currently selected output impedance for a function generator output (if supported)
Definition: OwonXDGFunctionGenerator.cpp:483
virtual void SetFunctionChannelDutyCycle(int chan, float duty) override
Sets the duty cycle for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:446
virtual void SetFunctionChannelFrequency(int chan, float hz) override
Sets the frequency for a function generator output.
Definition: OwonXDGFunctionGenerator.cpp:193
An SCPI-based function generator.
Definition: SCPIFunctionGenerator.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47