pub struct Adc<'d, ADCI, Dm: DriverMode> { /* private fields */ }Expand description
Analog-to-Digital Converter peripheral driver.
Implementations§
Source§impl<'d, ADCI> Adc<'d, ADCI, Blocking>where
    ADCI: RegisterAccess + 'd,
 
impl<'d, ADCI> Adc<'d, ADCI, Blocking>where
    ADCI: RegisterAccess + 'd,
Sourcepub fn new(adc_instance: ADCI, config: AdcConfig<ADCI>) -> Self
 
pub fn new(adc_instance: ADCI, config: AdcConfig<ADCI>) -> Self
Configure a given ADC instance using the provided configuration, and initialize the ADC for use
Sourcepub fn into_async(self) -> Adc<'d, ADCI, Async>
 
pub fn into_async(self) -> Adc<'d, ADCI, Async>
Reconfigures the ADC driver to operate in asynchronous mode.
Sourcepub fn read_oneshot<PIN, CS>(
    &mut self,
    pin: &mut AdcPin<PIN, ADCI, CS>,
) -> Result<u16, ()>where
    PIN: AdcChannel,
    CS: AdcCalScheme<ADCI>,
 
pub fn read_oneshot<PIN, CS>(
    &mut self,
    pin: &mut AdcPin<PIN, ADCI, CS>,
) -> Result<u16, ()>where
    PIN: AdcChannel,
    CS: AdcCalScheme<ADCI>,
Request that the ADC begin a conversion on the specified pin
This method takes an AdcPin reference, as it is expected that the ADC will be able to sample whatever channel underlies the pin.
Source§impl<'d, ADCI> Adc<'d, ADCI, Async>where
    ADCI: RegisterAccess + 'd,
 
impl<'d, ADCI> Adc<'d, ADCI, Async>where
    ADCI: RegisterAccess + 'd,
Sourcepub fn into_blocking(self) -> Adc<'d, ADCI, Blocking>
 
pub fn into_blocking(self) -> Adc<'d, ADCI, Blocking>
Create a new instance in crate::Blocking mode.
Sourcepub async fn read_oneshot<PIN, CS>(
    &mut self,
    pin: &mut AdcPin<PIN, ADCI, CS>,
) -> u16
 
pub async fn read_oneshot<PIN, CS>( &mut self, pin: &mut AdcPin<PIN, ADCI, CS>, ) -> u16
Request that the ADC begin a conversion on the specified pin
This method takes an AdcPin reference, as it is expected that the ADC will be able to sample whatever channel underlies the pin.
Trait Implementations§
Source§impl<ADCI> InterruptConfigurable for Adc<'_, ADCI, Blocking>
Available on crate feature unstable only. 
impl<ADCI> InterruptConfigurable for Adc<'_, ADCI, Blocking>
Available on crate feature 
unstable only.Source§fn set_interrupt_handler(&mut self, handler: InterruptHandler)
 
fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Registers an interrupt handler for the peripheral. Read more