2#include <ne10/NE10_types.h>
9#define TRIGGER_LOG_COUNT 16
37 Scope(
unsigned int numChannels,
float sampleRate);
51 void setup(
unsigned int numChannels,
float sampleRate);
61 void log(
double chn1, ...);
71 void log(
const float* values);
94 void triggerTimeDomain();
102 void scope_control_connected();
103 void scope_control_data(
const char* data);
104 void parse_settings(JSONValue* value);
106 bool volatile isUsingOutBuffer;
107 bool volatile isUsingBuffer;
108 bool volatile isResizing;
115 PlotMode plotMode = TIME_DOMAIN;
117 unsigned int triggerChannel;
133 std::vector<float> buffer;
134 std::vector<float> outBuffer;
140 int customTriggerPointer;
144 bool triggerCollecting;
147 int autoTriggerCount;
149 bool customTriggered;
162 ne10_fft_cpx_float32_t* inFFT;
163 ne10_fft_cpx_float32_t* outFFT;
164 ne10_fft_cfg_float32_t cfg;
166 std::unique_ptr<AuxTaskRT> scopeTriggerTask;
169 void setSetting(std::wstring setting,
float value);
171 std::unique_ptr<WSServer> ws_server;
173 std::map<std::wstring, float> settings;
Definition AuxTaskRT.h:24
Definition JSONValue.h:38
An oscilloscope which allows data to be visualised in a browser in real time.
Definition Scope.h:23
TriggerSlope
Definition Scope.h:30
@ POSITIVE
Trigger when crossing the threshold and the signal is increasing.
Definition Scope.h:31
@ BOTH
Trigger on any crossing of the threshold.
Definition Scope.h:33
@ NEGATIVE
Trigger when crossing the threshold and the signal is decreasing.
Definition Scope.h:32
void log(double chn1,...)
Logs a frame of data to the scope.
Definition Scope.cpp:159
void setup(unsigned int numChannels, float sampleRate)
Initialise the scope, setting the number of channels and the sample rate.
Definition Scope.cpp:48
bool trigger()
Cause the scope to trigger when set to custom trigger mode.
Definition Scope.cpp:206
TriggerMode
Definition Scope.h:25
@ NORMAL
Normal triggering.
Definition Scope.h:27
@ CUSTOM
Triggering when calling trigger().
Definition Scope.h:28
@ AUTO
Auto triggering.
Definition Scope.h:26
void setTrigger(TriggerMode mode, unsigned int channel=0, TriggerSlope dir=BOTH, float level=0)
Definition Scope.cpp:473
void cleanup(BelaContext *context, void *userData)
User-defined cleanup function which runs when the program finishes.
Definition render.cpp:96