pub struct Adc<State> { /* private fields */ }
Expand description

Analog to Digital converter interface

Implementations

Set the Adc sampling time

Set the Adc result alignment

Set the Adc precision

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.

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.

Trait Implementations

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Channel ID type Read more

Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more

Error type returned by ADC methods

Request that the ADC begin a conversion on the specified pin Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.