#[repr(transparent)]pub struct Cs(pub u32);
Expand description
ADC Control and Status
Tuple Fields§
§0: u32
Implementations§
source§impl Cs
impl Cs
sourcepub fn set_en(&mut self, val: bool)
pub fn set_en(&mut self, val: bool)
Power on ADC and enable its clock. 1 - enabled. 0 - disabled.
sourcepub const fn start_once(&self) -> bool
pub const fn start_once(&self) -> bool
Start a single conversion. Self-clearing. Ignored if start_many is asserted.
sourcepub fn set_start_once(&mut self, val: bool)
pub fn set_start_once(&mut self, val: bool)
Start a single conversion. Self-clearing. Ignored if start_many is asserted.
sourcepub const fn start_many(&self) -> bool
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.
sourcepub fn set_start_many(&mut self, val: bool)
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.
sourcepub const fn ready(&self) -> bool
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.
sourcepub fn set_ready(&mut self, val: bool)
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.
sourcepub const fn err(&self) -> bool
pub const fn err(&self) -> bool
The most recent ADC conversion encountered an error; result is undefined or noisy.
sourcepub fn set_err(&mut self, val: bool)
pub fn set_err(&mut self, val: bool)
The most recent ADC conversion encountered an error; result is undefined or noisy.
sourcepub const fn err_sticky(&self) -> bool
pub const fn err_sticky(&self) -> bool
Some past ADC conversion encountered an error. Write 1 to clear.
sourcepub fn set_err_sticky(&mut self, val: bool)
pub fn set_err_sticky(&mut self, val: bool)
Some past ADC conversion encountered an error. Write 1 to clear.
sourcepub const fn ainsel(&self) -> u8
pub const fn ainsel(&self) -> u8
Select analog mux input. Updated automatically in round-robin mode. This is corrected for the package option so only ADC channels which are bonded are available, and in the correct order
sourcepub fn set_ainsel(&mut self, val: u8)
pub fn set_ainsel(&mut self, val: u8)
Select analog mux input. Updated automatically in round-robin mode. This is corrected for the package option so only ADC channels which are bonded are available, and in the correct order
sourcepub const fn rrobin(&self) -> u16
pub const fn rrobin(&self) -> u16
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.
sourcepub fn set_rrobin(&mut self, val: u16)
pub fn set_rrobin(&mut self, val: u16)
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§
impl Copy for Cs
impl Eq for Cs
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)