-
Notifications
You must be signed in to change notification settings - Fork 2k
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
basilfx
wants to merge
6
commits into
RIOT-OS:master
Choose a base branch
from
basilfx:driver-gp8xxx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8643628
to
c59968c
Compare
c59968c
to
6fe9152
Compare
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.
6fe9152
to
5fac517
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This adds support for the Guestgood GP8xxx I2C voltage and current DACs. The following variations are supported.
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 usingUSEMODULE
. 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:
tests/drivers/gp8xxx
with only GP8403tests/drivers/gp8xxx
with both GP8302 + GP8403examples/saul
with both GP8302 + GP8403My test setup:
Issues/PRs references
None