ngscopeclient 0.1-dev+51fbda87c
RigolFunctionGenerator.h
1/***********************************************************************************************************************
2* *
3* libscopehal v0.1 *
4* *
5* Copyright (c) 2012-2023 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
30#ifndef RigolFunctionGenerator_h
31#define RigolFunctionGenerator_h
32
34{
35public:
38
39 //Device information
40 virtual unsigned int GetInstrumentTypes() const override;
41 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
42
43 virtual bool AcquireData() override;
44
45 virtual std::vector<WaveShape> GetAvailableWaveformShapes(int chan) override;
46
47 virtual bool GetFunctionChannelActive(int chan) override;
48 virtual void SetFunctionChannelActive(int chan, bool on) override;
49
50 virtual float GetFunctionChannelDutyCycle(int chan) override;
51 virtual void SetFunctionChannelDutyCycle(int chan, float duty) override;
52
53 virtual float GetFunctionChannelAmplitude(int chan) override;
54 virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override;
55
56 virtual float GetFunctionChannelOffset(int chan) override;
57 virtual void SetFunctionChannelOffset(int chan, float offset) override;
58
59 virtual float GetFunctionChannelFrequency(int chan) override;
60 virtual void SetFunctionChannelFrequency(int chan, float hz) override;
61
62 virtual WaveShape GetFunctionChannelShape(int chan) override;
63 virtual void SetFunctionChannelShape(int chan, WaveShape shape) override;
64
65 virtual bool HasFunctionRiseFallTimeControls(int chan) override;
66
67 virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override;
68 virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override;
69
70public:
71 static std::string GetDriverNameInternal();
72 GENERATOR_INITPROC(RigolFunctionGenerator)
73
74protected:
75 bool m_cachedFrequencyValid[2];
76 int64_t m_cachedFrequency[2];
77};
78
79#endif
WaveShape
Predefined waveform shapes.
Definition: FunctionGenerator.h:55
OutputImpedance
Nominal output impedance for a function generator channel.
Definition: FunctionGenerator.h:259
Definition: RigolFunctionGenerator.h:34
virtual float GetFunctionChannelOffset(int chan) override
Gets the DC offset for a function generator output.
Definition: RigolFunctionGenerator.cpp:150
virtual void SetFunctionChannelActive(int chan, bool on) override
Turns a function generator channel on or off.
Definition: RigolFunctionGenerator.cpp:131
virtual bool GetFunctionChannelActive(int chan) override
Returns true if the function generator channel's output is enabled.
Definition: RigolFunctionGenerator.cpp:123
virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override
Sets the currently selected output impedance for a function generator output (if supported)
Definition: RigolFunctionGenerator.cpp:480
virtual bool HasFunctionRiseFallTimeControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition: RigolFunctionGenerator.cpp:467
virtual WaveShape GetFunctionChannelShape(int chan) override
Gets the waveform shape for a function generator output.
Definition: RigolFunctionGenerator.cpp:180
virtual float GetFunctionChannelFrequency(int chan) override
Gets the frequency for a function generator output.
Definition: RigolFunctionGenerator.cpp:161
virtual void SetFunctionChannelOffset(int chan, float offset) override
Sets the DC offset for a function generator output.
Definition: RigolFunctionGenerator.cpp:156
virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override
Sets the amplitude for a function generator output.
Definition: RigolFunctionGenerator.cpp:145
virtual void SetFunctionChannelDutyCycle(int chan, float duty) override
Sets the duty cycle for a function generator output.
Definition: RigolFunctionGenerator.cpp:457
virtual float GetFunctionChannelDutyCycle(int chan) override
Gets the duty cycle for a function generator output.
Definition: RigolFunctionGenerator.cpp:451
virtual float GetFunctionChannelAmplitude(int chan) override
Gets the amplitude for a function generator output.
Definition: RigolFunctionGenerator.cpp:139
virtual void SetFunctionChannelShape(int chan, WaveShape shape) override
Sets the waveform shape for a function generator output.
Definition: RigolFunctionGenerator.cpp:317
virtual std::vector< WaveShape > GetAvailableWaveformShapes(int chan) override
Query the set of available pre-defined waveforms for this generator.
Definition: RigolFunctionGenerator.cpp:86
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: RigolFunctionGenerator.cpp:60
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: RigolFunctionGenerator.cpp:65
virtual void SetFunctionChannelFrequency(int chan, float hz) override
Sets the frequency for a function generator output.
Definition: RigolFunctionGenerator.cpp:172
virtual bool AcquireData() override
Pull data from the instrument.
Definition: RigolFunctionGenerator.cpp:73
virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override
Gets the currently selected output impedance for a function generator output (if supported)
Definition: RigolFunctionGenerator.cpp:472
An SCPI-based function generator.
Definition: SCPIFunctionGenerator.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47