nrf-rs / nrf51-hal

A Rust embedded-hal impl crate for the Nordic nrf51 series of microcontrollers
BSD Zero Clause License
19 stars 13 forks source link

Adds api implementation for the ADC #23

Closed stephanh closed 4 years ago

stephanh commented 5 years ago

Also provides the analog channel mapping for the pins on the nrf51822.

I tried to follow the same approach as taken here https://github.com/stm32-rs/stm32f1xx-hal/blob/master/src/adc.rs.

therealprof commented 5 years ago

Very nice!

I don't think we need the feature gate for the nrf51822, we really only implemented everything for that particular chip so far and as far as I can see ADC should even work for all chips in the nRF51 family.

stephanh commented 4 years ago

The feature gate is only for the pin to channel mapping (unless I made a mistake). That should be specific to that chip?

The ADC api is there for all nrf51 chips.

therealprof commented 4 years ago

I just checked all chips in the nRF51 family, they all have the same ADC pins.

stephanh commented 4 years ago

That's convenient :smile:. I have removed the feature gate.

stephanh commented 4 years ago

@therealprof would it be possible to get a release with this PR? 😄

therealprof commented 4 years ago

Sure, but I’m traveling at the moment. This will take a day or so...

therealprof commented 4 years ago

Done.