Crate signal_gen_cjds66_lib[][src]

Expand description

An unofficial support library which can fully remote control the inexpensive "Koolertron DDS Signal Generator" known as "GH-CJDS66" (Full name: "Koolertron Upgraded 60MHz DDS Signal Generator Counter, High Precision Dual-channel Arbitrary Waveform Function Generator Frequency Meter 200MSa/s (60MHz) Model: GH-CJDS66-FU" ). Perhaps it also works with other similar DDS Signal Generators, although that hasn’t been tested.

This has been written following the official manufacturer’s USB-serial communication protocol specification. The library implements support for every working manufacturer-documented feature from the spec, and only a few extra convenience features mentioned at the end of the spec have been left out, because they didn’t seem to work as advertised.

The few extra missing features probably aren’t really needed, but will happily be added anyway if someone would like to figure out how/if they work, and explain them to the author. You can read about what’s still missing in the commit message of this git commit, and file an issue or open a merge request about it on GitLab if you figure something out or you’d like to discuss it further.

Project link:

Manufacturer’s webpage for the device:


Functions which communicate with the device over its USB-serial interface, and expose nearly all of its remotely-accessible features. This contains the support code and logic for almost everything the device can do.

Handle errors in a common way for everything in this crate. This is mostly just wrapping the clap crate’s Error type, and adding numeric exit codes to each of their types of errors which are suitable for returning to the parent shell or execution environment, to support properly checking various error conditions for advanced scripting purposes (bash scripts, Windows batch files, or Powershell scripts, for example).

The device’s USB-serial communication protocol, exposed as a bunch of constants for use with other parts of the library.

Some code which initiates the correct type of serial connection to properly communicate with the device.

Miscellaneous utility functions used by the library, which make some common tasks more convenient to perform.