SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
ps6000.h
Go to the documentation of this file.
1 /*
2 * SICAK - SIde-Channel Analysis toolKit
3 * Copyright (C) 2018 Petr Socha, FIT, CTU in Prague
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18 
29 #ifndef PS6000_H
30 #define PS6000_H
31 
32 #include <QObject>
33 #include <QtPlugin>
34 #include <cmath>
35 #include <ps6000Api.h>
36 #include "oscilloscope.h"
37 #include "exceptions.hpp"
38 
46 class Ps6000 : public QObject, Oscilloscope {
47 
48  Q_OBJECT
49  Q_PLUGIN_METADATA(IID "cz.cvut.fit.Sicak.OscilloscopeInterface/1.0" FILE "ps6000.json")
50  Q_INTERFACES(Oscilloscope)
51 
52 public:
53 
54  Ps6000();
55  virtual ~Ps6000() override;
56 
57  virtual QString getPluginName() override;
58  virtual QString getPluginInfo() override;
59 
60  virtual void init(const char * filename) override;
61  virtual void deInit() override;
62 
63  virtual QString queryDevices() override;
64 
65  virtual void setChannel(int & channel, bool & enabled, Coupling & coupling, Impedance & impedance, int & rangemV, int & offsetmV, BandwidthLimiter & bwLimit) override;
66  virtual void setTrigger(int & sourceChannel, float & level, TriggerSlope & slope) override;
67  virtual void unsetTrigger() override;
69  virtual void setTiming(float & preTriggerRange, float & postTriggerRange, size_t & samples, size_t & captures) override;
70  virtual void run() override;
71  virtual void stop() override;
72 
73  virtual size_t getCurrentSetup(size_t & samples, size_t & captures) override;
74  virtual size_t getValues(int channel, PowerTraces<int16_t> & traces) override;
75  virtual size_t getValues(int channel, int16_t * buffer, size_t len, size_t & samples, size_t & captures) override;
76 
77 protected:
78  int16_t m_handle;
79  uint32_t m_preTriggerSamples;
80  uint32_t m_postTriggerSamples;
81  uint32_t m_timebase;
82  uint32_t m_captures;
83  bool m_opened;
84 
85 };
86 
87 #endif /* PS6000_H */
virtual void unsetTrigger() override
Unset the trigger.
Definition: ps6000.cpp:179
virtual void init(const char *filename) override
Initialize the plugin.
Definition: ps6000.cpp:53
BandwidthLimiter
Bandwidth limit of the oscilloscope channel.
Definition: oscilloscope.h:59
virtual QString getPluginName() override
Plugin name.
Definition: ps6000.cpp:45
This header file contains exceptions.
virtual void setTiming(float &preTriggerRange, float &postTriggerRange, size_t &samples, size_t &captures) override
Set the timing settings, real values may be returned by driver to the references.
Definition: ps6000.cpp:197
virtual size_t getCurrentSetup(size_t &samples, size_t &captures) override
Returns current samples/captures settings.
Definition: ps6000.cpp:293
TriggerSlope
Edge slope of the oscilloscope trigger.
Definition: oscilloscope.h:66
Oscilloscope plugin for PicoScope 6000, using official driver for communication.
Definition: ps6000.h:46
Oscilloscope plugin interface for use e.g. in meas.
virtual void deInit() override
Deinitialize the plugin.
Definition: ps6000.cpp:63
virtual void setChannel(int &channel, bool &enabled, Coupling &coupling, Impedance &impedance, int &rangemV, int &offsetmV, BandwidthLimiter &bwLimit) override
Set the channel settings, real values may be returned by driver to the references.
Definition: ps6000.cpp:81
Coupling
Coupling of the oscilloscope channel.
Definition: oscilloscope.h:47
Impedance
Impedance of the oscilloscope channel.
Definition: oscilloscope.h:53
virtual void setTrigger(int &sourceChannel, float &level, TriggerSlope &slope) override
Set the trigger settings, real values may be returned by driver to the references.
Definition: ps6000.cpp:152
Oscilloscope QT plugin interface.
Definition: oscilloscope.h:42
virtual size_t getValues(int channel, PowerTraces< int16_t > &traces) override
Downloads values from the oscilloscope, first waits for the aquisition to complete.
Definition: ps6000.cpp:363
virtual void stop() override
Stop the oscilloscope.
Definition: ps6000.cpp:284
A class representing a Matrix with 'noOfTraces' power traces, with 'samplesPerTrace' samples per powe...
Definition: types_power.hpp:44
virtual QString getPluginInfo() override
Plugin info.
Definition: ps6000.cpp:49
virtual QString queryDevices() override
Query available devices.
Definition: ps6000.cpp:75
virtual void run() override
Run the oscilloscope: wait for trigger when triggered, otherwise capture immediately.
Definition: ps6000.cpp:273