SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
oscilloscope.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 OSCILLOSCOPE_H
30 #define OSCILLOSCOPE_H
31 
32 #include <QString>
33 #include "types_power.hpp"
34 
42 class Oscilloscope {
43 
44 public:
45 
47  enum class Coupling {
48  AC,
49  DC
50  };
51 
53  enum class Impedance {
54  R50,
55  R1M
56  };
57 
59  enum class BandwidthLimiter {
60  FULL,
61  F20MHZ,
62  F25MHZ
63  };
64 
66  enum class TriggerSlope {
67  RISING,
68  FALLING,
69  EITHER
70  };
71 
72  virtual ~Oscilloscope() {}
73 
75  virtual QString getPluginName() = 0;
77  virtual QString getPluginInfo() = 0;
78 
80  virtual void init(const char * filename) = 0;
82  virtual void deInit() = 0;
83 
85  virtual QString queryDevices() = 0;
86 
88  virtual void setChannel(int & channel, bool & enabled, Coupling & coupling, Impedance & impedance, int & rangemV, int & offsetmV, BandwidthLimiter & bwLimit) = 0;
90  virtual void setTrigger(int & sourceChannel, float & level, TriggerSlope & slope) = 0;
92  virtual void unsetTrigger() = 0;
94  virtual void setTiming(float & preTriggerRange, float & postTriggerRange, size_t & samples, size_t & captures) = 0;
96  virtual void run() = 0;
98  virtual void stop() = 0;
99 
101  virtual size_t getCurrentSetup(size_t & samples, size_t & captures) = 0;
102 
104  virtual size_t getValues(int channel, PowerTraces<int16_t> & traces) = 0;
106  virtual size_t getValues(int channel, int16_t * buffer, size_t len, size_t & samples, size_t & captures) = 0;
107 
108 };
109 
110 #define Oscilloscope_iid "cz.cvut.fit.Sicak.OscilloscopeInterface/1.0"
111 
112 Q_DECLARE_INTERFACE(Oscilloscope, Oscilloscope_iid)
113 
114 #endif /* OSCILLOSCOPE_H */
virtual QString getPluginName()=0
Plugin name.
virtual QString queryDevices()=0
Query available devices.
BandwidthLimiter
Bandwidth limit of the oscilloscope channel.
Definition: oscilloscope.h:59
virtual void setChannel(int &channel, bool &enabled, Coupling &coupling, Impedance &impedance, int &rangemV, int &offsetmV, BandwidthLimiter &bwLimit)=0
Set the channel settings, real values may be returned by driver to the references.
virtual void setTiming(float &preTriggerRange, float &postTriggerRange, size_t &samples, size_t &captures)=0
Set the timing settings, real values may be returned by driver to the references: e....
virtual QString getPluginInfo()=0
Plugin info.
TriggerSlope
Edge slope of the oscilloscope trigger.
Definition: oscilloscope.h:66
virtual void deInit()=0
Deinitialize the plugin.
virtual void stop()=0
Stop the oscilloscope.
This header file contains class templates of power traces and power consumption containers.
Coupling
Coupling of the oscilloscope channel.
Definition: oscilloscope.h:47
virtual void setTrigger(int &sourceChannel, float &level, TriggerSlope &slope)=0
Set the trigger settings, real values may be returned by driver to the references.
Impedance
Impedance of the oscilloscope channel.
Definition: oscilloscope.h:53
Oscilloscope QT plugin interface.
Definition: oscilloscope.h:42
virtual size_t getCurrentSetup(size_t &samples, size_t &captures)=0
Returns current samples/captures settings.
virtual void run()=0
Run the oscilloscope: wait for trigger when triggered, otherwise capture immediately.
A class representing a Matrix with 'noOfTraces' power traces, with 'samplesPerTrace' samples per powe...
Definition: types_power.hpp:44
virtual void init(const char *filename)=0
Initialize the plugin.
virtual void unsetTrigger()=0
Unset the trigger.
virtual size_t getValues(int channel, PowerTraces< int16_t > &traces)=0
Downloads values from the oscilloscope, first waits for the aquisition to complete.