30#ifndef PicoOscilloscope_h
31#define PicoOscilloscope_h
35#include "RemoteBridgeOscilloscope.h"
81 virtual std::set<InterleaveConflict> GetInterleaveConflicts()
override;
97 virtual std::vector<std::string>
GetADCModeNames(
size_t channel)
override;
98 virtual size_t GetADCMode(
size_t channel)
override;
99 virtual void SetADCMode(
size_t channel,
size_t mode)
override;
163 size_t GetDigitalPodIndex(
size_t i)
164 {
return (i - m_digitalChannelBase) / 8; }
165 size_t GetDigitalLaneIndex(
size_t i)
166 {
return (i - m_digitalChannelBase) % 8; }
169 void IdentifyHardware();
172 bool Is10BitModeAvailable();
173 bool Is12BitModeAvailable();
179 size_t GetEnabledAnalogChannelCountAToD()
181 size_t GetEnabledAnalogChannelCountEToH()
183 size_t GetEnabledAnalogChannelCountAToB()
185 size_t GetEnabledAnalogChannelCountCToD()
187 size_t GetEnabledAnalogChannelCountEToF()
189 size_t GetEnabledAnalogChannelCountGToH()
199 size_t m_analogChannelCount;
200 size_t m_digitalChannelBase;
201 size_t m_digitalChannelCount;
208 std::map<size_t, double> m_channelAttenuations;
210 std::map<int, bool> m_digitalBankPresent;
211 std::map<int, float> m_digitalThresholds;
212 std::map<int, float> m_digitalHysteresis;
216 float m_awgDutyCycle;
219 float m_awgFrequency;
229 std::shared_ptr<QueueHandle> m_queue;
230 std::unique_ptr<vk::raii::CommandPool> m_pool;
231 std::unique_ptr<vk::raii::CommandBuffer> m_cmdBuf;
232 std::unique_ptr<ComputePipeline> m_conversionPipeline;
236 static std::string GetDriverNameInternal();
Simple edge trigger.
Definition: EdgeTrigger.h:44
A single channel of a function generator.
Definition: FunctionGeneratorChannel.h:45
WaveShape
Predefined waveform shapes.
Definition: FunctionGenerator.h:55
OutputImpedance
Nominal output impedance for a function generator channel.
Definition: FunctionGenerator.h:259
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
TriggerMode
Definition: Oscilloscope.h:411
PicoOscilloscope - driver for talking to the scopehal-pico-bridge daemons.
Definition: PicoOscilloscope.h:42
virtual void DisableChannel(size_t i) override
Turn a channel off, given the index.
Definition: PicoOscilloscope.cpp:407
bool IsChannelIndexDigital(size_t i)
Checks if a channel index refers to a MSO channel.
Definition: PicoOscilloscope.cpp:1122
virtual std::vector< uint64_t > GetSampleRatesNonInterleaved() override
Get the legal sampling rates (in Hz) for this scope in all-channels mode.
Definition: PicoOscilloscope.cpp:739
virtual uint64_t GetSampleRate() override
Gets the current sampling rate (in Hz) of this scope.
Definition: PicoOscilloscope.cpp:820
virtual void FlushConfigCache() override
Instruments are allowed to cache configuration settings to reduce round trip queries to the device.
Definition: PicoOscilloscope.cpp:371
virtual void SetFunctionChannelDutyCycle(int chan, float duty) override
Sets the duty cycle for a function generator output.
Definition: PicoOscilloscope.cpp:1485
virtual std::vector< AnalogBank > GetAnalogBanks() override
Gets the analog banks for this instrument.
Definition: PicoOscilloscope.cpp:885
virtual float GetDigitalHysteresis(size_t channel) override
Gets the hysteresis for a digital input.
Definition: PicoOscilloscope.cpp:996
virtual bool AcquireData() override
Pull data from the instrument.
Definition: PicoOscilloscope.cpp:495
virtual void SetFunctionChannelFrequency(int chan, float hz) override
Sets the frequency for a function generator output.
Definition: PicoOscilloscope.cpp:1532
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: PicoOscilloscope.cpp:240
virtual Oscilloscope::TriggerMode PollTrigger() override
Checks the curent trigger status.
Definition: PicoOscilloscope.cpp:488
virtual OscilloscopeChannel * GetExternalTrigger() override
Returns the external trigger input channel, if we have one.
Definition: PicoOscilloscope.cpp:482
virtual bool CanEnableChannel(size_t i) override
Determines if a channel can be enabled.
Definition: PicoOscilloscope.cpp:1127
virtual bool IsADCModeConfigurable() override
Returns true if the ADC is configurable, false if it can only run in one mode.
Definition: PicoOscilloscope.cpp:898
virtual size_t GetADCMode(size_t channel) override
Gets the ADC mode for a channel.
Definition: PicoOscilloscope.cpp:933
virtual void SetTriggerOffset(int64_t offset) override
Sets the trigger offset.
Definition: PicoOscilloscope.cpp:845
virtual bool CanInterleave() override
Returns true if we have no interleave conflicts, false if we have conflicts.
Definition: PicoOscilloscope.cpp:734
virtual std::vector< uint64_t > GetSampleRatesInterleaved() override
Get the legal sampling rates (in Hz) for this scope in combined-channels mode.
Definition: PicoOscilloscope.cpp:770
bool CanEnableChannel6000Series10Bit(size_t i)
Checks if we can enable a channel on a 6000 series scope configured for 10-bit ADC resolution.
Definition: PicoOscilloscope.cpp:1283
virtual std::vector< DigitalBank > GetDigitalBanks() override
Gets the digital channel banks for this instrument.
Definition: PicoOscilloscope.cpp:967
bool CanEnableChannel6000Series12Bit(size_t i)
Checks if we can enable a channel on a 6000 series scope configured for 12-bit ADC resolution.
Definition: PicoOscilloscope.cpp:1336
bool CanEnableChannel6000Series8Bit(size_t i)
Checks if we can enable a channel on a 6000 series scope configured for 8-bit ADC resolution.
Definition: PicoOscilloscope.cpp:1185
virtual void SetFunctionChannelAmplitude(int chan, float amplitude) override
Sets the amplitude for a function generator output.
Definition: PicoOscilloscope.cpp:1498
virtual void SetSampleRate(uint64_t rate) override
Sets the sample rate of the scope, in Hz.
Definition: PicoOscilloscope.cpp:837
virtual bool IsChannelEnabled(size_t i) override
Checks if a channel is enabled in hardware.
Definition: PicoOscilloscope.cpp:379
virtual bool HasFunctionRiseFallTimeControls(int chan) override
Determines if the function generator allows control over rise/fall times.
Definition: PicoOscilloscope.cpp:1604
virtual std::vector< std::string > GetADCModeNames(size_t channel) override
Gets the names of the ADC modes for the bank a given channel is located in.
Definition: PicoOscilloscope.cpp:919
virtual void SetChannelAttenuation(size_t i, double atten) override
Sets the probe attenuation used for an input channel.
Definition: PicoOscilloscope.cpp:461
virtual std::vector< WaveShape > GetAvailableWaveformShapes(int chan) override
Query the set of available pre-defined waveforms for this generator.
Definition: PicoOscilloscope.cpp:1447
virtual float GetFunctionChannelOffset(int chan) override
Gets the DC offset for a function generator output.
Definition: PicoOscilloscope.cpp:1510
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition: PicoOscilloscope.cpp:339
virtual void SetDigitalHysteresis(size_t channel, float level) override
Sets the hysteresis for a digital input.
Definition: PicoOscilloscope.cpp:1008
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz) override
Sets the bandwidth limit for an input channel.
Definition: PicoOscilloscope.cpp:478
virtual float GetFunctionChannelFrequency(int chan) override
Gets the frequency for a function generator output.
Definition: PicoOscilloscope.cpp:1527
virtual float GetFunctionChannelDutyCycle(int chan) override
Gets the duty cycle for a function generator output.
Definition: PicoOscilloscope.cpp:1480
virtual double GetChannelAttenuation(size_t i) override
Gets the probe attenuation for an input channel.
Definition: PicoOscilloscope.cpp:452
virtual bool SetInterleaving(bool combine) override
Configures the scope to combine channels.
Definition: PicoOscilloscope.cpp:867
virtual uint64_t GetSampleDepth() override
Gets the current sample depth of this scope.
Definition: PicoOscilloscope.cpp:825
size_t GetEnabledDigitalPodCount()
Returns the total number of 8-bit MSO pods which are currently enabled.
Definition: PicoOscilloscope.cpp:1050
size_t GetEnabledAnalogChannelCountRange(size_t start, size_t end)
Returns the total number of analog channels in the requested range which are currently enabled.
Definition: PicoOscilloscope.cpp:1063
virtual void SetSampleDepth(uint64_t depth) override
Sets the sample depth of the scope.
Definition: PicoOscilloscope.cpp:830
virtual OutputImpedance GetFunctionChannelOutputImpedance(int chan) override
Gets the currently selected output impedance for a function generator output (if supported)
Definition: PicoOscilloscope.cpp:1609
std::vector< std::unique_ptr< AcceleratorBuffer< int16_t > > > m_analogRawWaveformBuffers
Buffers for storing raw ADC samples before converting to fp32.
Definition: PicoOscilloscope.h:226
virtual int64_t GetTriggerOffset() override
Gets the trigger offset.
Definition: PicoOscilloscope.cpp:856
virtual WaveShape GetFunctionChannelShape(int chan) override
Gets the waveform shape for a function generator output.
Definition: PicoOscilloscope.cpp:1540
virtual std::vector< OscilloscopeChannel::CouplingType > GetAvailableCouplings(size_t i) override
Gets the set of legal coupling values for an input channel.
Definition: PicoOscilloscope.cpp:426
virtual void SetFunctionChannelOutputImpedance(int chan, OutputImpedance z) override
Sets the currently selected output impedance for a function generator output (if supported)
Definition: PicoOscilloscope.cpp:1614
virtual AnalogBank GetAnalogBank(size_t channel) override
Gets the bank containing a given channel.
Definition: PicoOscilloscope.cpp:892
size_t GetEnabledAnalogChannelCount()
Returns the total number of analog channels which are currently enabled.
Definition: PicoOscilloscope.cpp:1036
virtual void SetFunctionChannelShape(int chan, WaveShape shape) override
Sets the waveform shape for a function generator output.
Definition: PicoOscilloscope.cpp:1545
virtual bool IsInterleaving() override
Checks if the scope is currently combining channels.
Definition: PicoOscilloscope.cpp:861
virtual void SetFunctionChannelActive(int chan, bool on) override
Turns a function generator channel on or off.
Definition: PicoOscilloscope.cpp:1469
virtual float GetFunctionChannelAmplitude(int chan) override
Gets the amplitude for a function generator output.
Definition: PicoOscilloscope.cpp:1493
virtual unsigned int GetChannelBandwidthLimit(size_t i) override
Gets the bandwidth limit for an input channel.
Definition: PicoOscilloscope.cpp:473
virtual bool IsTriggerArmed() override
Checks if the trigger is currently armed.
Definition: PicoOscilloscope.cpp:729
virtual void SetDigitalThreshold(size_t channel, float level) override
Gets the threshold for a digital input.
Definition: PicoOscilloscope.cpp:1019
virtual float GetDigitalThreshold(size_t channel) override
Gets the threshold for a digital input.
Definition: PicoOscilloscope.cpp:1002
virtual bool IsDigitalHysteresisConfigurable() override
Checks if digital input hysteresis is configurable or fixed.
Definition: PicoOscilloscope.cpp:986
bool IsDigitalPodActive(size_t npod)
Check if any channels in an MSO pod are enabled.
Definition: PicoOscilloscope.cpp:1108
bool IsDigitalPodPresent(size_t npod)
Check if a MSO pod is present.
Definition: PicoOscilloscope.cpp:1080
virtual std::vector< uint64_t > GetSampleDepthsNonInterleaved() override
Get the legal memory depths for this scope in all-channels mode.
Definition: PicoOscilloscope.cpp:784
virtual bool IsDigitalThresholdConfigurable() override
Checks if digital input threshold is configurable or fixed.
Definition: PicoOscilloscope.cpp:991
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: PicoOscilloscope.cpp:356
virtual DigitalBank GetDigitalBank(size_t channel) override
Gets the bank containing a given channel.
Definition: PicoOscilloscope.cpp:979
virtual void SetADCMode(size_t channel, size_t mode) override
Sets the ADC mode for a channel.
Definition: PicoOscilloscope.cpp:938
virtual void PushTrigger() override
Pushes changes made to m_trigger to the instrument.
Definition: PicoOscilloscope.cpp:873
virtual void SetFunctionChannelOffset(int chan, float offset) override
Sets the DC offset for a function generator output.
Definition: PicoOscilloscope.cpp:1515
virtual std::vector< uint64_t > GetSampleDepthsInterleaved() override
Get the legal memory depths for this scope in combined-channels mode.
Definition: PicoOscilloscope.cpp:813
virtual void EnableChannel(size_t i) override
Turn a channel on, given the index.
Definition: PicoOscilloscope.cpp:389
virtual bool GetFunctionChannelActive(int chan) override
Returns true if the function generator channel's output is enabled.
Definition: PicoOscilloscope.cpp:1464
An oscilloscope connected over a SDK-to-SCPI bridge that follows our pattern (i.e....
Definition: RemoteBridgeOscilloscope.h:40
An SCPI-based function generator.
Definition: SCPIFunctionGenerator.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47