Struct stm32l0xx_hal::adc::Adc [−][src]
Analog to Digital converter interface
Implementations
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]
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,
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]
DmaChan: Channel,
pub fn read_available(
&mut self
) -> Result<impl Iterator<Item = Result<u16, Error>> + '_, Error>
[src]
&mut self
) -> Result<impl Iterator<Item = Result<u16, Error>> + '_, Error>
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]
Trait Implementations
impl Channel<Adc<Ready>> for VTemp
[src]
impl Channel<Adc<Ready>> for VRef
[src]
impl Channel<Adc<Ready>> for PB0<Analog>
[src]
impl Channel<Adc<Ready>> for PB1<Analog>
[src]
impl Channel<Adc<Ready>> for PA0<Analog>
[src]
impl Channel<Adc<Ready>> for PA1<Analog>
[src]
impl Channel<Adc<Ready>> for PA2<Analog>
[src]
impl Channel<Adc<Ready>> for PA3<Analog>
[src]
impl Channel<Adc<Ready>> for PA4<Analog>
[src]
impl Channel<Adc<Ready>> for PA5<Analog>
[src]
impl Channel<Adc<Ready>> for PA6<Analog>
[src]
impl Channel<Adc<Ready>> for PA7<Analog>
[src]
impl<WORD, PIN> OneShot<Adc<Ready>, WORD, PIN> for Adc<Ready> where
WORD: From<u16>,
PIN: Channel<Adc<Ready>, ID = u8>,
[src]
WORD: From<u16>,
PIN: Channel<Adc<Ready>, ID = u8>,
Auto Trait Implementations
impl<State> Send for Adc<State> where
State: Send,
State: Send,
impl<State> !Sync for Adc<State>
impl<State> Unpin for Adc<State> where
State: Unpin,
State: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,