Struct nrf9160_hal::Saadc

source ·
pub struct Saadc(/* private fields */);
Expand description

Interface for the SAADC peripheral.

External analog channels supported by the SAADC implement the Channel trait. Currently, use of only one channel is allowed.

Implementations§

source§

impl Saadc

source

pub fn new(saadc: SAADC_NS, config: SaadcConfig) -> Saadc

source

pub fn free(self) -> SAADC_NS

Disable SAADC and return the low-level peripheral handle

source

pub fn read_channel<PIN>(&mut self, _pin: &mut PIN) -> Result<i16, ()>
where PIN: Channel,

Sample channel PIN for the configured ADC acquisition time in differential input mode. Note that this is a blocking operation.

Trait Implementations§

source§

impl<STATE> Channel<Saadc> for P0_13<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_14<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_15<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_16<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_17<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_18<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_19<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<STATE> Channel<Saadc> for P0_20<STATE>

§

type ID = u8

Channel ID type Read more
source§

fn channel() -> u8

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

impl<PIN> OneShot<Saadc, i16, PIN> for Saadc
where PIN: Channel,

source§

fn read( &mut self, pin: &mut PIN ) -> Result<i16, Error<<Saadc as OneShot<Saadc, i16, PIN>>::Error>>

Sample channel PIN for the configured ADC acquisition time in differential input mode. Note that this is a blocking operation.

§

type Error = ()

Error type returned by ADC methods

Auto Trait Implementations§

§

impl Freeze for Saadc

§

impl RefUnwindSafe for Saadc

§

impl Send for Saadc

§

impl !Sync for Saadc

§

impl Unpin for Saadc

§

impl UnwindSafe for Saadc

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.