[][src]Struct stm32l0xx_hal::adc::Adc

pub struct Adc<State> { /* fields omitted */ }

Analog to Digital converter interface

Methods

impl Adc<Ready>[src]

pub fn new(adc: ADC, rcc: &mut Rcc) -> Self[src]

pub fn set_sample_time(&mut self, t_samp: SampleTime)[src]

Set the Adc sampling time

pub fn set_align(&mut self, align: Align)[src]

Set the Adc result alignment

pub fn set_precision(&mut self, precision: Precision)[src]

Set the Adc precision

pub fn start<DmaChan, Buf>(
    self,
    channels: impl Into<Channels>,
    trigger: Option<Trigger>,
    dma: &mut Handle,
    dma_chan: DmaChan,
    buffer: Pin<Buf>
) -> Adc<Active<DmaChan, Buf>> where
    DmaToken: Target<DmaChan>,
    Buf: DerefMut + 'static,
    Buf::Target: AsMutSlice<Element = u16>,
    DmaChan: Channel
[src]

Starts a continuous conversion process

The channel argument specifies which channel should be converted.

The trigger argument specifies the trigger that will start each conversion sequence. This only configures the ADC peripheral to accept this trigger. The trigger itself must also be configured using its own peripheral API.

In addition to the preceeding arguments that configure the ADC, additional arguments are required to configure the DMA transfer that is used to read the results from the ADC:

  • dma is a handle to the DMA peripheral.
  • dma_chan is the DMA channel used for the transfer. It needs to be one of the channels that supports the ADC peripheral.
  • buffer is the buffer used to buffer the conversion results.

Panics

Panics, if buffer is larger than 65535.

impl<DmaChan, Buffer> Adc<Active<DmaChan, Buffer>> where
    DmaChan: Channel
[src]

pub fn read_available(
    &mut self
) -> Result<impl Iterator<Item = Result<u16, Error>> + '_, Error>
[src]

Returns an iterator over all currently available values

The iterator iterates over all buffered values. It returns None, once the end of the buffer has been reached.

impl<State> Adc<State>[src]

pub fn release(self) -> ADC[src]

Trait Implementations

impl Channel<Adc<Ready>> for VTemp[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for VRef[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PB0<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PB1<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA0<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA1<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA2<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA3<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA4<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA5<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA6<Analog>[src]

type ID = u8

Channel ID type Read more

impl Channel<Adc<Ready>> for PA7<Analog>[src]

type ID = u8

Channel ID type Read more

impl<WORD, PIN> OneShot<Adc<Ready>, WORD, PIN> for Adc<Ready> where
    WORD: From<u16>,
    PIN: Channel<Adc<Ready>, ID = u8>, 
[src]

type Error = ()

Error type returned by ADC methods

Auto Trait Implementations

impl<State> Send for Adc<State> where
    State: Send

impl<State> !Sync for Adc<State>

impl<State> Unpin for Adc<State> where
    State: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.