Skip to content

Conversation

@csarip
Copy link
Contributor

@csarip csarip commented Oct 22, 2025

Pull Request Description

This PR adds initial driver support for the LTC2378-20 20-bit SAR ADC with project examples.

Driver Features Implemented:

  • SPI Communication: 20-bit data acquisition with CNV/BUSY handshake protocol
  • Input Modes: Unipolar (0 to VREF) and bipolar (±VREF) configuration support
  • Data Conversion: Raw ADC reading and raw-to-microvolts conversion functions
  • Power Management: Manual power-down control via CNV signal

Project Examples Added:

  • Platform: Maxim MAX32666FTHR evaluation board with DC2135A board
  • Test: Validates SPI communication, ADC conversion, unipolar/bipolar modes, and voltage scaling
  • Hardware Validation: Tested on actual MAX32666FTHR hardware with DC2135A board

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have complied with the Submission Checklist
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

@csarip csarip force-pushed the dev/ltc2378-20 branch 3 times, most recently from 8e480e9 to e1c00ca Compare October 22, 2025 07:43
@csarip
Copy link
Contributor Author

csarip commented Oct 23, 2025

It appears to have the same failed checks as PR #2783. Unless all checks are required to pass, this PR is ready for review.

@jemfgeronimo jemfgeronimo self-requested a review October 24, 2025 07:33
Copy link
Contributor

@amiclaus amiclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall, but the documentation issues ar valid. check for the warnings in the log file, those are treated as errors too.

Copy link
Contributor

@jemfgeronimo jemfgeronimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes. The main change is to use the new example infrastructure.
Reference commits: 39e2d46, 81c90dc, 913998c
Reference PRs: #2795, #2421

@csarip csarip marked this pull request as draft October 28, 2025 06:02
@csarip
Copy link
Contributor Author

csarip commented Oct 28, 2025

v2:

  • Fixed declarations and brackets
  • Changed to new example infrastructure

@jemfgeronimo jemfgeronimo self-requested a review October 28, 2025 09:08
Copy link
Contributor

@jemfgeronimo jemfgeronimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes to fix the LinuxBuilds documentation errors.

@csarip csarip marked this pull request as ready for review October 29, 2025 02:24
@csarip
Copy link
Contributor Author

csarip commented Oct 29, 2025

v3:

  • Added fixes to docs
  • Fixed commit messages

@jemfgeronimo jemfgeronimo mentioned this pull request Oct 29, 2025
11 tasks
Copy link
Contributor

@jemfgeronimo jemfgeronimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes.

@csarip csarip marked this pull request as draft October 30, 2025 01:53
Add initial header and source files for LTC2378 driver.

Signed-off-by: Cherrence Sarip <[email protected]>
Add initial header and source file for LTC2378 IIO driver.

Signed-off-by: Cherrence Sarip <[email protected]>
Add README.rst documentation file for LTC2378 alongside other
documentation related files.

Signed-off-by: Cherrence Sarip <[email protected]>
Add initial project files for both basic and IIO examples for LTC2378.

Signed-off-by: Cherrence Sarip <[email protected]>
Add README.rst documentation file for project alongside other
documentation related files.

Signed-off-by: Cherrence Sarip <[email protected]>
@csarip
Copy link
Contributor Author

csarip commented Oct 30, 2025

v4:

  • Fixed IIO error handling by replacing sentinel values with proper error codes
  • Removed magic numbers by adding descriptive macros
  • Used no-OS utility functions for sign extension

@csarip csarip marked this pull request as ready for review October 30, 2025 03:01
Copy link
Contributor

@jemfgeronimo jemfgeronimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor change. Otherwise, LGTM.

Comment on lines +173 to +174
* ``scale`` - The scale factor to convert raw values to millivolts
* ``processed`` - The processed voltage value in millivolts (raw * scale)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You used microvolts in your driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants