rp/adc: rewrite the module

- don't require an irq binding for blocking-only adc
- abstract adc pins into an AnyPin like interface, erasing the actual
  peripheral type at runtime.
- add pull-up/pull-down functions for adc pins
- add a test (mostly a copy of the example, to be honest)
- configure adc pads according to datasheet
- report conversion errors (although they seem exceedingly rare?)
- drop embedded-hal interfaces. embedded-hal channels can do neither
  AnyPin nor pullup/pulldown without encoding both into the type
This commit is contained in:
pennae
2023-07-05 20:05:34 +02:00
parent 46a4600952
commit 972cdd4265
4 changed files with 238 additions and 94 deletions

View File

@ -41,7 +41,7 @@ impl From<Level> for bool {
}
/// Represents a pull setting for an input.
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum Pull {
None,
Up,