rp-pac

Crates

git

Versions

rp2040

Flavors

Struct rp_pac::adc::regs::Cs

source ·
#[repr(transparent)]
pub struct Cs(pub u32);
Expand description

ADC Control and Status

Tuple Fields§

§0: u32

Implementations§

source§

impl Cs

source

pub const fn en(&self) -> bool

Power on ADC and enable its clock. 1 - enabled. 0 - disabled.

source

pub fn set_en(&mut self, val: bool)

Power on ADC and enable its clock. 1 - enabled. 0 - disabled.

source

pub const fn ts_en(&self) -> bool

Power on temperature sensor. 1 - enabled. 0 - disabled.

source

pub fn set_ts_en(&mut self, val: bool)

Power on temperature sensor. 1 - enabled. 0 - disabled.

source

pub const fn start_once(&self) -> bool

Start a single conversion. Self-clearing. Ignored if start_many is asserted.

source

pub fn set_start_once(&mut self, val: bool)

Start a single conversion. Self-clearing. Ignored if start_many is asserted.

source

pub const fn start_many(&self) -> bool

Continuously perform conversions whilst this bit is 1. A new conversion will start immediately after the previous finishes.

source

pub fn set_start_many(&mut self, val: bool)

Continuously perform conversions whilst this bit is 1. A new conversion will start immediately after the previous finishes.

source

pub const fn ready(&self) -> bool

1 if the ADC is ready to start a new conversion. Implies any previous conversion has completed. 0 whilst conversion in progress.

source

pub fn set_ready(&mut self, val: bool)

1 if the ADC is ready to start a new conversion. Implies any previous conversion has completed. 0 whilst conversion in progress.

source

pub const fn err(&self) -> bool

The most recent ADC conversion encountered an error; result is undefined or noisy.

source

pub fn set_err(&mut self, val: bool)

The most recent ADC conversion encountered an error; result is undefined or noisy.

source

pub const fn err_sticky(&self) -> bool

Some past ADC conversion encountered an error. Write 1 to clear.

source

pub fn set_err_sticky(&mut self, val: bool)

Some past ADC conversion encountered an error. Write 1 to clear.

source

pub const fn ainsel(&self) -> u8

Select analog mux input. Updated automatically in round-robin mode.

source

pub fn set_ainsel(&mut self, val: u8)

Select analog mux input. Updated automatically in round-robin mode.

source

pub const fn rrobin(&self) -> u8

Round-robin sampling. 1 bit per channel. Set all bits to 0 to disable. Otherwise, the ADC will cycle through each enabled channel in a round-robin fashion. The first channel to be sampled will be the one currently indicated by AINSEL. AINSEL will be updated after each conversion with the newly-selected channel.

source

pub fn set_rrobin(&mut self, val: u8)

Round-robin sampling. 1 bit per channel. Set all bits to 0 to disable. Otherwise, the ADC will cycle through each enabled channel in a round-robin fashion. The first channel to be sampled will be the one currently indicated by AINSEL. AINSEL will be updated after each conversion with the newly-selected channel.

Trait Implementations§

source§

impl Clone for Cs

source§

fn clone(&self) -> Cs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Cs

source§

fn default() -> Cs

Returns the “default value” for a type. Read more
source§

impl PartialEq for Cs

source§

fn eq(&self, other: &Cs) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Cs

source§

impl Eq for Cs

source§

impl StructuralPartialEq for Cs

Auto Trait Implementations§

§

impl Freeze for Cs

§

impl RefUnwindSafe for Cs

§

impl Send for Cs

§

impl Sync for Cs

§

impl Unpin for Cs

§

impl UnwindSafe for Cs

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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>,

source§

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>,

source§

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.