Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/gp8xxx: add initial support #21182

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

basilfx
Copy link
Member

@basilfx basilfx commented Feb 2, 2025

Contribution description

This adds support for the Guestgood GP8xxx I2C voltage and current DACs. The following variations are supported.

  • GP8503: 2-channel 12-bit VDAC with 0-2.5/VCC V output range
  • GP8512: 1-channel 15-bit VDAC with 0-2.5/VCC V output range
  • GP8211S: 1-channel 15-bit VDAC with 0-5/10 V output range
  • GP8403: 2-channel 12-bit VDAC with 0-5/10 V output range
  • GP8413: 2-channel 15-bit VDAC with 0-5/10 V output range
  • GP8302: 1-channel 12-bit IDAC with 0-25 mA output range

Although Guestgood is Chinese and doesn't offer English datasheets, small and well-documented development boards are produced by DFRobot, which are distributed by several known distributors such as Mouser and Digikey.

The 0-10V VDACs had my particular interest, because several home automation appliances can be controlled using 0-10V signals. These single-chip solutions are very ideal for this purpose.

SAUL was extended to support voltage and current actuators.

Testing procedure

A test application is provided in tests/drivers/gp8xxx. By default, it will select the GP8403, but additional actuators can be specified using USEMODULE. I tested the GP8403 and GP8302 only, but the others will probably work out of the box (my driver is largely based on DFRobot's Arduino version).

SAUL integration can be tested with examples/saul. Note that when using this application, the arguments are parsed as Volts or Amperes. Unfortunately, the SAUL shell does not support fractional numbers, so testing the full range is not really possible for the 0-25 mA IDAC.

I have created three videos to show the driver in action:

My test setup:

Issues/PRs references

None

@github-actions github-actions bot added Area: doc Area: Documentation Area: tests Area: tests and testing framework Area: drivers Area: Device drivers Area: SAUL Area: Sensor/Actuator Uber Layer labels Feb 2, 2025
@basilfx basilfx force-pushed the driver-gp8xxx branch 3 times, most recently from 8643628 to c59968c Compare February 2, 2025 21:18
@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Feb 2, 2025
@basilfx basilfx marked this pull request as ready for review February 2, 2025 21:37
@basilfx basilfx added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Feb 4, 2025
@riot-ci
Copy link

riot-ci commented Feb 4, 2025

Murdock results

✔️ PASSED

5fac517 fixup! tests/drivers/gp8xxx: add test application

Success Failures Total Runtime
10284 0 10284 10m:15s

Artifacts

To add support for voltage and current DACs, add additional SAUL
actuators.
The Guestgood GP8xxx I2C DACs are easy-to-use voltage and current
DACs with standardized output ranges. All supported variants have
very similar I2C protocol.

This commit adds support for a generic driver (gp8xxx) and uses a
information structure to record capabilities. Multiple driver
instances can work simultaneously on the same I2C bus.

SAUL support is also added.
These two drivers ensure that a VDAC and IDAC capabilities are included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation Area: drivers Area: Device drivers Area: SAUL Area: Sensor/Actuator Uber Layer Area: tests Area: tests and testing framework Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants