pub struct Adc<'d, ADC, Dm: DriverMode> { /* private fields */ }
Available on crate feature
unstable
only.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 read_oneshot<PIN>(
&mut self,
_pin: &mut AdcPin<PIN, ADCI>,
) -> Result<u16, ()>where
PIN: AdcChannel,
pub fn read_oneshot<PIN>(
&mut self,
_pin: &mut AdcPin<PIN, ADCI>,
) -> Result<u16, ()>where
PIN: AdcChannel,
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<ADC1> Adc<'_, ADC1, Blocking>
impl<ADC1> Adc<'_, ADC1, Blocking>
Sourcepub fn enable_hall_sensor()
pub fn enable_hall_sensor()
Enable the Hall sensor
Sourcepub fn disable_hall_sensor()
pub fn disable_hall_sensor()
Disable the Hall sensor