-
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/ads101x: Changes for Common ADC API #10619
base: master
Are you sure you want to change the base?
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Requires some work to make compatible with PR #13247. |
31bb4fb
to
aa522a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments inline.
I wonder if we couldn't get the test be driver independet. E.g. every non-peripheral driver could contain a check like this:
#if (ADC_NG_NUMOF == 1) && defined(MODULE_ADS101X)
const adc_ng_backend_t adc_ng_backends[ADC_NG_NUMOF] = {
{
.driver = &ads101x_adc_ng_driver,
.handle = &ads101x_devs[0]
}
};
#endif
Combined with auto-init this should just work without any support of either board or application, as long as exactly one ADC-NG driver (with only one entry in params) is used. I bet that this is also the common case. And only applications/boards actually having multiple ADCs would have go through the pain of providing the backends themselves.
Once the cross file arrays land in RIOT, this would also work without board/application support for any number of drivers :-)
👍 Seems to be a good idea. I suppose you would place that code fragment in the drivers code. |
To place this in drivers code requires to make |
@maribu It works indeed without any board definition if module The question is how we can test each ADC driver that supports |
I'm working on a PR to split auto-initialization of the drivers and SAUL, so that sensors/actuators can also be auto-initialized in case SAUL is not used.
Some tests can be controlled using environment parameters. E.g. we could introduce a variable like BACKEND ?= periph_adc_ng and if someone would run with |
👍
Hm, that still can't be automated. What I meant is to have a script that automatically compiles and tests variants of the same test application, for example for different |
Changes for compatibility with the Common ADC API. With these changes ADS101x/ADS111x devices can be used as ADC extensions.
Application to test ADS101x/ADS111x devices with the Common ADC API as ADC extension.
aa522a6
to
ff6027f
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Not stale, I'll resume work on the ADC-NG API hopefully soon. Then this can get in as well :-) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This PR provides
as ADC extension
This PR serves as a proof-of-concept for the Common ADC API in PR #13247 using an example of an existing ADC driver.
Testing procedure
The test application can be used with up to two ADS101x/ADS111x devices. It is recommended to use two ADS1115 device where the the second ADS1115 is used as ADS1013 to see the differences between the two ADC extension devices. Compile the test application for any board that supports I2C.
Issues/PRs references
Depends on PR #13247