#[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.