Skip to main content
RKTK API Docs RKTK Home Repo

Adc

Trait Adc 

Source
pub trait Adc {
    type Error: Debug + MaybeFormat;

    // Required method
    async fn read(&mut self) -> Result<u16, Self::Error>;
}
Expand description

ADC driver interface for magnetic switches.

Required Associated Types§

Source

type Error: Debug + MaybeFormat

Error type for ADC operations.

Required Methods§

Source

async fn read(&mut self) -> Result<u16, Self::Error>

Reads the ADC value. Returns a 16-bit value. If the ADC has lower resolution, it should be scaled to 16-bit.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§