#[non_exhaustive]pub struct ChannelConfig { /* private fields */ }Expand description
Sigma-delta channel configuration.
The hardware stores the prescaler and pulse density in the same register, so applying a complete channel configuration can update both fields with a single register write.
Implementations§
Source§impl ChannelConfig
impl ChannelConfig
Sourcepub fn with_pulse_density(self, pulse_density: i8) -> Self
pub fn with_pulse_density(self, pulse_density: i8) -> Self
Assign the given value to the pulse_density field.
Sourcepub fn pulse_density(&self) -> i8
pub fn pulse_density(&self) -> i8
Pulse density in the hardware range -128..=127.
Source§impl ChannelConfig
impl ChannelConfig
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new channel configuration with the default prescaler and pulse density.
Sourcepub fn with_frequency(self, frequency: Rate) -> Result<Self, Error>
pub fn with_frequency(self, frequency: Rate) -> Result<Self, Error>
Sets the requested output frequency.
Selects the prescaler that produces the closest output frequency using the currently configured SDM clock source.
§Errors
Returns Error::UnreachableTargetFrequency when no hardware
prescaler can represent the requested frequency.
Sourcepub fn with_prescaler(self, prescaler: u16) -> Result<Self, Error>
pub fn with_prescaler(self, prescaler: u16) -> Result<Self, Error>
Sets the hardware prescaler.
The hardware divider range is 1..=256.
§Errors
Returns Error::PrescalerOutOfRange when prescaler is not in
1..=256.
Trait Implementations§
Source§impl Clone for ChannelConfig
Available on crate feature unstable only.
impl Clone for ChannelConfig
unstable only.Source§fn clone(&self) -> ChannelConfig
fn clone(&self) -> ChannelConfig
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ChannelConfig
unstable only.Source§impl Debug for ChannelConfig
Available on crate feature unstable only.
impl Debug for ChannelConfig
unstable only.Source§impl Default for ChannelConfig
Available on crate feature unstable only.
impl Default for ChannelConfig
unstable only.Source§fn default() -> ChannelConfig
fn default() -> ChannelConfig
impl Eq for ChannelConfig
unstable only.Source§impl PartialEq for ChannelConfig
Available on crate feature unstable only.
impl PartialEq for ChannelConfig
unstable only.impl StructuralPartialEq for ChannelConfig
unstable only.Auto Trait Implementations§
impl Freeze for ChannelConfig
impl RefUnwindSafe for ChannelConfig
impl Send for ChannelConfig
impl Sync for ChannelConfig
impl Unpin for ChannelConfig
impl UnsafeUnpin for ChannelConfig
impl UnwindSafe for ChannelConfig
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)