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

Add initial header and source files for LTC2378 driver.

Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com>
Add initial header and source file for LTC2378 IIO driver.

Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com>
Add README.rst documentation file for LTC2378 alongside other
documentation related files.

Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com>
Add initial project files for both basic and IIO examples for LTC2378.

Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com>
Add README.rst documentation file for project alongside other
documentation related files.

Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com>
@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.

no_os_udelay(1);
}

uint8_t buf[3] = {0};
Copy link
Contributor

Choose a reason for hiding this comment

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

declarations at start of the function.


case LTC2378_IIO_SCALE:
vals[0] = ltc2378->vref_uv;
if (ltc2378->input_mode == LTC2378_UNIPOLAR) {
Copy link
Contributor

Choose a reason for hiding this comment

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

no brackets if only one expression guarded.

return iio_format_value(buf, len, IIO_VAL_INT, 1, vals);
}

int32_t voltage_uv;
Copy link
Contributor

Choose a reason for hiding this comment

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

variable declaration at start of function.

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.

2 participants