Difference between revisions of "Programmable signal generator"

From sigrok
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
It is common for different signal modes (sine, square, pulse, ...) have different limits.
It is common for different signal modes (sine, square, pulse, ...) have different limits.


Often amplitude, offset, and duty cycle depend on frequency (and each other), so adjusting one
may limit the range for other thus causing other settings to change.
Additionally frequency range typically depends on generator capabilities as well as the wave form
that is selected, thus driver typically need to dynamically report different ranges base on
currently active wave form.


== Config keys ==
== Config keys ==
Line 24: Line 30:
* set: Turn output on or off
* set: Turn output on or off
* list: NA
* list: NA
=== SR_CONF_PATTERN_MODE ===
* string, pattern generation mode ("Sine", "Square", "Triangle", "Ramp", "Pulse", "Noise", "Arb")
* get: The current output signal pattern (mode).
* set: Set the output signal pattern (mode).
* list: List of supported modes.


=== SR_CONF_OUTPUT_FREQUENCY ===
=== SR_CONF_OUTPUT_FREQUENCY ===
Line 51: Line 64:
* get: The current output signal phase.
* get: The current output signal phase.
* set: Set the output signal phase.
* set: Set the output signal phase.
* list: Supported phase range as (log, high, step).
* list: Supported phase range as (low, high, step).
 
=== SR_CONF_DUTY_CYCLE (NEW) ===
 
* double, representing output signal duty cycle (percent)
* get: The current output duty cycle.
* set: Set the output signal duty cycle.
* list: Supported duty cycle range as (low, high, step).





Latest revision as of 06:52, 6 September 2020

*** DRAFT ***

This page documents the config keys are various other info needed to write a libsigrok frontend for controlling programmable signal generators (or arbitrary waveform generators).

TODO

  • Some way to cleanly implement frequency counter device in same driver...


Notes

It is common for different signal modes (sine, square, pulse, ...) have different limits.

Often amplitude, offset, and duty cycle depend on frequency (and each other), so adjusting one may limit the range for other thus causing other settings to change.

Additionally frequency range typically depends on generator capabilities as well as the wave form that is selected, thus driver typically need to dynamically report different ranges base on currently active wave form.

Config keys

A libsigrok driver for a programmable signal generator implements all or some subset of the following config keys.

SR_CONF_SIGNAL_GENERATOR

Denotes a device that provides programmable signal output via one or more output channels, typically with frequency, amplitude, offset, and phase set via the sigrok driver.

SR_CONF_ENABLED

  • boolean
  • get: Actual state of output
  • set: Turn output on or off
  • list: NA

SR_CONF_PATTERN_MODE

  • string, pattern generation mode ("Sine", "Square", "Triangle", "Ramp", "Pulse", "Noise", "Arb")
  • get: The current output signal pattern (mode).
  • set: Set the output signal pattern (mode).
  • list: List of supported modes.

SR_CONF_OUTPUT_FREQUENCY

  • double, representing frequency of output signal
  • get: The current output frequency.
  • set: Set the target output frequency.
  • list: Supported frequency range as (low, high, step). NOTE! This can change if channel mode is changed.

SR_CONF_AMPLITUDE

  • double, representing output signal amplitude (Vpp)
  • get: The current output signal amplitude.
  • set: Set the output signal amplitude.
  • list: Supported amplitude range as (low, high, step).

SR_CONF_OFFSET

  • double, representing output signal DC offset (Vdc)
  • get: The current output signal offset.
  • set: Set the output signal offset.
  • list: Supported offset range as (low, high, step).

SR_CONF_PHASE (NEW)

  • double, representing output signal phase (degrees)
  • get: The current output signal phase.
  • set: Set the output signal phase.
  • list: Supported phase range as (low, high, step).

SR_CONF_DUTY_CYCLE (NEW)

  • double, representing output signal duty cycle (percent)
  • get: The current output duty cycle.
  • set: Set the output signal duty cycle.
  • list: Supported duty cycle range as (low, high, step).