ngscopeclient 0.1-dev+51fbda87c
PicoVNA.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
37#ifndef PicoVNA_h
38#define PicoVNA_h
39
40class EdgeTrigger;
41
46class PicoVNA : public virtual SCPIVNA
47{
48public:
49 PicoVNA(SCPITransport* transport);
50 virtual ~PicoVNA();
51
52 //not copyable or assignable
53 PicoVNA(const PicoVNA& rhs) =delete;
54 PicoVNA& operator=(const PicoVNA& rhs) =delete;
55
56public:
57
58 //Channel configuration
59
60 virtual void FlushConfigCache() override;
61
62 //Triggering
63 virtual OscilloscopeChannel* GetExternalTrigger() override;
64 virtual Oscilloscope::TriggerMode PollTrigger() override;
65 virtual bool AcquireData() override;
66 virtual void Start() override;
67 virtual void StartSingleTrigger() override;
68 virtual void Stop() override;
69 virtual void ForceTrigger() override;
70 virtual bool IsTriggerArmed() override;
71 virtual void PushTrigger() override;
72 virtual void PullTrigger() override;
73
74 //Timebase
75 virtual std::vector<uint64_t> GetSampleDepthsNonInterleaved() override;
76 virtual uint64_t GetSampleDepth() override;
77 virtual void SetSampleDepth(uint64_t depth) override;
78 virtual void SetSpan(int64_t span) override;
79 virtual int64_t GetSpan() override;
80 virtual void SetCenterFrequency(size_t channel, int64_t freq) override;
81 virtual int64_t GetCenterFrequency(size_t channel) override;
82
83 //TODO: Sweep configuration
84 virtual int64_t GetResolutionBandwidth() override;
85
86protected:
87 std::string GetChannelColor(size_t i);
88
89 bool m_triggerArmed;
90 bool m_triggerOneShot;
91
92 int64_t m_rbw;
93 int64_t m_sampleDepth;
94
95 bool m_sampleDepthValid;
96
97public:
98 static std::string GetDriverNameInternal();
99 VNA_INITPROC(PicoVNA)
100};
101
102#endif
Simple edge trigger.
Definition: EdgeTrigger.h:44
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:411
PicoVNA - driver for talking to a PicoVNA using the PicoVNA 5 software.
Definition: PicoVNA.h:47
virtual int64_t GetResolutionBandwidth() override
Gets the resolution bandwidth for frequency-domain channels.
Definition: PicoVNA.cpp:484
virtual int64_t GetCenterFrequency(size_t channel) override
Gets the center frequency for a frequency-domain channel.
Definition: PicoVNA.cpp:502
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: PicoVNA.cpp:446
virtual void PullTrigger() override
Updates m_trigger with any changes made from the instrument side.
Definition: PicoVNA.cpp:474
std::string GetChannelColor(size_t i)
Color the channels based on Pico's standard color sequence (blue-red-green-yellow-purple-gray-cyan-ma...
Definition: PicoVNA.cpp:101
virtual void Start() override
Starts the instrument in continuous trigger mode.
Definition: PicoVNA.cpp:405
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: PicoVNA.cpp:150
virtual void FlushConfigCache() override
Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
Definition: PicoVNA.cpp:157
virtual void Stop() override
Stops triggering.
Definition: PicoVNA.cpp:423
virtual void StartSingleTrigger() override
Arms the trigger for a single acquistion.
Definition: PicoVNA.cpp:414
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: PicoVNA.cpp:469
virtual void ForceTrigger() override
Forces a single acquisition as soon as possible.
Definition: PicoVNA.cpp:432
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition: PicoVNA.cpp:441
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition: PicoVNA.cpp:458
virtual bool AcquireData() override
Pull data from the instrument.
Definition: PicoVNA.cpp:163
virtual int64_t GetSpan() override
Gets the span for frequency-domain channels.
Definition: PicoVNA.cpp:493
virtual void SetCenterFrequency(size_t channel, int64_t freq) override
Sets the center frequency for frequency-domain channels.
Definition: PicoVNA.cpp:498
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: PicoVNA.cpp:144
virtual void SetSpan(int64_t span) override
Sets the span for frequency-domain channels.
Definition: PicoVNA.cpp:489
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition: PicoVNA.cpp:479
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Generic representation of a vector network analyzer.
Definition: SCPIVNA.h:43