@@ -216,8 +216,7 @@ impl From<PicoInfo> for i16 {
216
216
}
217
217
218
218
#[ derive( Debug , Clone , Copy , FromPrimitive , ToPrimitive ) ]
219
- pub enum PicoWaveType
220
- {
219
+ pub enum PicoWaveType {
221
220
Sine = 0 ,
222
221
Square = 1 ,
223
222
Triangle = 2 ,
@@ -229,15 +228,26 @@ pub enum PicoWaveType
229
228
DCVoltage = 8 ,
230
229
}
231
230
231
+ impl Default for PicoWaveType {
232
+ fn default ( ) -> Self {
233
+ PicoWaveType :: Sine
234
+ }
235
+ }
236
+
232
237
#[ derive( Debug , Clone , Copy , FromPrimitive , ToPrimitive ) ]
233
- pub enum PicoSweepType
234
- {
238
+ pub enum PicoSweepType {
235
239
Up = 0 ,
236
240
Down = 1 ,
237
241
UpDown = 2 ,
238
242
DownUp = 3 ,
239
243
}
240
244
245
+ impl Default for PicoSweepType {
246
+ fn default ( ) -> Self {
247
+ PicoSweepType :: Up
248
+ }
249
+ }
250
+
241
251
// Rust addition: encode the potential values of sweeps and shots, to avoid invalid states
242
252
// like >0 & >0
243
253
#[ derive( Debug , Clone ) ]
@@ -249,6 +259,11 @@ pub enum SweepShotCount {
249
259
ContinuousShots ,
250
260
}
251
261
262
+ impl Default for SweepShotCount {
263
+ fn default ( ) -> Self {
264
+ SweepShotCount :: None
265
+ }
266
+ }
252
267
253
268
// TODO: this value is copied from sys/src/ps2000a - should we import it here?
254
269
// should there be a crate for identical symbols?
@@ -273,10 +288,8 @@ impl SweepShotCount {
273
288
}
274
289
}
275
290
276
-
277
291
#[ derive( Debug , Clone , Copy , FromPrimitive , ToPrimitive ) ]
278
- pub enum PicoExtraOperations
279
- {
292
+ pub enum PicoExtraOperations {
280
293
/// <summary>
281
294
/// Normal signal generator operation specified by wavetype.
282
295
/// </summary>
@@ -292,12 +305,17 @@ pub enum PicoExtraOperations
292
305
PRBS = 2 , // Pseudo-Random Bit Stream
293
306
}
294
307
308
+ impl Default for PicoExtraOperations {
309
+ fn default ( ) -> Self {
310
+ PicoExtraOperations :: Off
311
+ }
312
+ }
313
+
295
314
/// <summary>
296
315
/// AWG index modes
297
316
/// </summary>
298
317
#[ derive( Debug , Clone , Copy , FromPrimitive , ToPrimitive ) ]
299
- pub enum PicoIndexMode
300
- {
318
+ pub enum PicoIndexMode {
301
319
/// <summary>
302
320
/// The generator outputs the raw contents of the buffer repeatedly .
303
321
/// </summary>
@@ -317,8 +335,7 @@ pub enum PicoIndexMode
317
335
/// The type of trigger that will be applied to the signal generator
318
336
/// </summary>
319
337
#[ derive( Debug , Clone , Copy , FromPrimitive , ToPrimitive ) ]
320
- pub enum PicoSigGenTrigType
321
- {
338
+ pub enum PicoSigGenTrigType {
322
339
/// <summary>
323
340
/// Trigger on rising edge
324
341
/// </summary>
@@ -337,12 +354,17 @@ pub enum PicoSigGenTrigType
337
354
GateLow = 3 ,
338
355
}
339
356
357
+ impl Default for PicoSigGenTrigType {
358
+ fn default ( ) -> Self {
359
+ PicoSigGenTrigType :: Rising
360
+ }
361
+ }
362
+
340
363
/// <summary>
341
364
/// The source that will trigger the signal generator
342
365
/// </summary>
343
366
#[ derive( Debug , Clone , Copy , FromPrimitive , ToPrimitive , PartialEq ) ]
344
- pub enum PicoSigGenTrigSource
345
- {
367
+ pub enum PicoSigGenTrigSource {
346
368
/// <summary>
347
369
/// Run without waiting for trigger
348
370
/// </summary>
@@ -364,3 +386,9 @@ pub enum PicoSigGenTrigSource
364
386
/// </summary>
365
387
SoftTrig = 4 ,
366
388
}
389
+
390
+ impl Default for PicoSigGenTrigSource {
391
+ fn default ( ) -> Self {
392
+ PicoSigGenTrigSource :: None
393
+ }
394
+ }
0 commit comments