rktk/drivers/interface/magnetic.rs
1//! Magnetic switch driver interface.
2
3/// ADC driver interface for magnetic switches.
4pub trait Adc {
5 /// Error type for ADC operations.
6 type Error: core::fmt::Debug + rktk_log::MaybeFormat;
7
8 /// Reads the ADC value.
9 /// Returns a 16-bit value. If the ADC has lower resolution, it should be scaled to 16-bit.
10 async fn read(&mut self) -> Result<u16, Self::Error>;
11}
12
13/// Analog multiplexer driver interface.
14pub trait Multiplexer {
15 /// Error type for multiplexer operations.
16 type Error: core::fmt::Debug + rktk_log::MaybeFormat;
17
18 /// Selects the channel.
19 async fn select(&mut self, channel: u8) -> Result<(), Self::Error>;
20}
RKTK API Docs