Difference between revisions of "Programmable signal generator"

From sigrok
Jump to navigation Jump to search
Line 59: Line 59:
* set: Set the output signal phase.
* set: Set the output signal phase.
* list: Supported phase range as (low, 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).





Revision as of 06:49, 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.


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).