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: adc: Add support for TI ADS1112 ADCs #56826
drivers: adc: Add support for TI ADS1112 ADCs #56826
Conversation
8929f9f
to
fd99dfb
Compare
@anangl please take a look @jmontgomery-cruise please address the failed scancode check |
41208d8
to
e58f901
Compare
e58f901
to
21443f0
Compare
@anangl Is there any chance this can be reviewed? |
This PR adds a custom driver for the ADS1112 ADCs. Unlike ADS1113/4/5 family served by the ADS1x1x driver, the ADS1112 does not use an address pointer to address config registers. Instead, there is only one writable register and all i2c writes will set it. The registers resemble the ADS1119 device, but config bitmap is different, include a distinct data rate table, gain table, and input multiplexing table. There is also not a status register to be monitored with the ADS1112, as it uses config bit 7 for the same purpose instead of a separate register. The driver was tested on hardware using the ADC shell interface. Manual probing validated the voltages for the MUX_SINGLE configs at datarate 15 in CM_SINGLE. Higher gains were not tested and CM_CONTINUOUS is not supported in this initial implementation. The new driver has also been added to the existing ADC test using adc_emul for completeness. Origin: original License: Apache 2.0 Purpose: Adding support for ADS1112 ADCs Signed-off-by: Jordan Montgomery <jordan.montgomery@getcruise.com>
The adc-shell uses a hardcoded list of defines to check whether it should throw a compile-time error. The ADS1119 and ADS1112 driver both support the APIs needed by the shell, so this commit enables support for them in the hardcoded support list. Signed-off-by: Jordan Montgomery <jordan.montgomery@getcruise.com>
21443f0
to
14fe005
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.
Hi @jmontgomery-cruise!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!
To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.
Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁
This PR adds a custom driver for the ADS1112 ADCs. Unlike the ADS1113/4/5 family served by the ADS1x1x driver, the ADS1112 does not use an address pointer to access config registers. Instead, there is only one writable register and all i2c writes will set it. The register "map" resembles the ADS1119 device, but still has significant differences.
Notably, the config bitmap is different and includes a distinct data rate table, gain table, and input multiplexing table. Unlike the ADS1119, there isn't a status register, as config bit 7 serves the same purpose on the ADS1112.
The new driver has also been added to the existing ADC test using adc_emul for completeness. A second commit on top adds both this new driver and the existing ADS1119 driver to the adc-shell.c whitelist.
The new driver was tested on real hardware using the adc shell and correct voltages were observed in the configs used. Continuous sampling mode is not supported by this initial implementation.