Skip to content
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

[driver] ADC ADS816x #796

Merged
merged 2 commits into from
Dec 31, 2021
Merged

Conversation

rleh
Copy link
Member

@rleh rleh commented Dec 21, 2021

  • Driver
  • Example
  • Test on real hardware

Copy link
Member

@chris-durand chris-durand left a comment

Choose a reason for hiding this comment

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

Nice!

src/modm/driver/adc/ads816x_impl.hpp Show resolved Hide resolved
src/modm/driver/adc/ads816x_impl.hpp Outdated Show resolved Hide resolved
src/modm/driver/adc/ads816x_impl.hpp Outdated Show resolved Hide resolved
@rleh rleh force-pushed the feature/driver_ads816x branch 2 times, most recently from 2dd9f18 to b38a815 Compare December 31, 2021 15:32
@rleh
Copy link
Member Author

rleh commented Dec 31, 2021

I commented out the code for the auto sequence mode for now, because it does not seem to switch channels correctly.
Manual mode works on real hardware!
image

Ready to merge from my side.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

Good, just some details to polish…

src/modm/driver/adc/ads816x.hpp Outdated Show resolved Hide resolved
src/modm/driver/adc/ads816x_impl.hpp Outdated Show resolved Hide resolved
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

Awesome!

src/modm/driver/adc/ads816x_impl.hpp Outdated Show resolved Hide resolved
using namespace std::chrono_literals;
RF_BEGIN();

if (std::popcount(channelsBitmask) > N) {
Copy link
Member

Choose a reason for hiding this comment

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

Just a side-note, if you are ever implementing the auto conversion mode: The most sensible way to use span here would be a std::span<uint16_t> with a dynamic size and then have result.size() here instead of N. That way it would be a normal runtime parameter for the size. The check is at runtime anyway.

Copy link
Member

@chris-durand chris-durand left a comment

Choose a reason for hiding this comment

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

Thanks, I'd be fine with merging it as is.

@rleh
Copy link
Member Author

rleh commented Dec 31, 2021

Removed the unnecessary using namespace std::chrono_literals; statements.

@salkinium salkinium merged commit 3ba71c9 into modm-io:develop Dec 31, 2021
@rleh rleh deleted the feature/driver_ads816x branch December 31, 2021 18:34
@salkinium salkinium added this to the 2021q4 milestone Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants