Trait attiny_hal::adc::AdcOps
source · pub trait AdcOps<H> {
type Channel: PartialEq + Copy;
type Settings: PartialEq + Copy;
// Required methods
fn raw_init(&mut self, settings: Self::Settings);
fn raw_read_adc(&self) -> u16;
fn raw_is_converting(&self) -> bool;
fn raw_start_conversion(&mut self);
fn raw_set_channel(&mut self, channel: Self::Channel);
fn raw_enable_channel(&mut self, channel: Self::Channel);
fn raw_disable_channel(&mut self, channel: Self::Channel);
}
Expand description
Internal trait for the low-level ADC peripheral.
Prefer using the Adc
API instead of this trait.
Required Associated Types§
Required Methods§
sourcefn raw_init(&mut self, settings: Self::Settings)
fn raw_init(&mut self, settings: Self::Settings)
Initialize the ADC peripheral with the specified settings.
Warning: This is a low-level method and should not be called directly from user code.
sourcefn raw_read_adc(&self) -> u16
fn raw_read_adc(&self) -> u16
Read out the ADC data register.
This method must only be called after a conversion completed.
Warning: This is a low-level method and should not be called directly from user code.
sourcefn raw_is_converting(&self) -> bool
fn raw_is_converting(&self) -> bool
Check whether the ADC is currently converting a signal.
Warning: This is a low-level method and should not be called directly from user code.
sourcefn raw_start_conversion(&mut self)
fn raw_start_conversion(&mut self)
Start a conversion on the currently selected channel.
Warning: This is a low-level method and should not be called directly from user code.
sourcefn raw_set_channel(&mut self, channel: Self::Channel)
fn raw_set_channel(&mut self, channel: Self::Channel)
Set the multiplexer to a certain channel.
Warning: This is a low-level method and should not be called directly from user code.
sourcefn raw_enable_channel(&mut self, channel: Self::Channel)
fn raw_enable_channel(&mut self, channel: Self::Channel)
Set the DIDR (Digital Input Disable) for a certain channel.
This disabled digital logic on the corresponding pin and allows measuring analog signals.
Warning: This is a low-level method and should not be called directly from user code.
sourcefn raw_disable_channel(&mut self, channel: Self::Channel)
fn raw_disable_channel(&mut self, channel: Self::Channel)
Clear the DIDR (Digital Input Disable) for a certain channel.
Enables digital logic on the corresponding pin after it has been used as an ADC channel.
Warning: This is a low-level method and should not be called directly from user code.