Struct stm32f3xx_hal::adc::config::Config
source · #[non_exhaustive]pub struct Config {
pub resolution: Resolution,
pub data_alignment: DataAlignment,
pub overrun: OverrunMode,
pub external_trigger: Option<ExternalTrigger>,
pub conversion: ConversionMode,
pub dma: DmaMode,
}
Expand description
Configuration for the ADC.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.resolution: Resolution
The bit-width resolution of the peripheral.
data_alignment: DataAlignment
The data alignment in the data register.
overrun: OverrunMode
The mode, how to handle overrun scenarios of the data register.
external_trigger: Option<ExternalTrigger>
The external trigger, which can start a conversion automatically.
conversion: ConversionMode
The conversion mode, which will determined how a confersion sequence is progressed.
dma: DmaMode
Disables or enables the DMA for the peripheral, and configured how the DMA is reading from the ADC data register.
Implementations§
source§impl Config
impl Config
sourcepub fn resolution(self, resolution: Resolution) -> Self
pub fn resolution(self, resolution: Resolution) -> Self
Change the resolution
sourcepub fn align(self, align: DataAlignment) -> Self
pub fn align(self, align: DataAlignment) -> Self
Set the align mode
sourcepub fn overrun_mode(self, mode: OverrunMode) -> Self
pub fn overrun_mode(self, mode: OverrunMode) -> Self
Set the overrun mode
sourcepub fn conversion_mode(self, mode: ConversionMode) -> Self
pub fn conversion_mode(self, mode: ConversionMode) -> Self
Set the conversion mode
sourcepub fn external_trigger(self, trigger: Option<ExternalTrigger>) -> Self
pub fn external_trigger(self, trigger: Option<ExternalTrigger>) -> Self
Enable external trigger and the trigger source
Trait Implementations§
source§impl PartialEq for Config
impl PartialEq for Config
impl Copy for Config
impl Eq for Config
impl StructuralEq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more