pub struct Channel<'d> { /* private fields */ }Expand description
A connected sigma-delta channel.
Dropping a channel disconnects its output pin and releases the SDM clock guard.
Implementations§
Source§impl<'d> Channel<'d>
impl<'d> Channel<'d>
Sourcepub fn new(
channel: impl Instance + 'd,
pin: impl PeripheralOutput<'d>,
config: ChannelConfig,
) -> Self
pub fn new( channel: impl Instance + 'd, pin: impl PeripheralOutput<'d>, config: ChannelConfig, ) -> Self
Creates a new connected sigma-delta channel.
Sourcepub fn apply_config(&mut self, config: &ChannelConfig)
pub fn apply_config(&mut self, config: &ChannelConfig)
Applies a new channel configuration.
Sourcepub fn set_pulse_density(&mut self, density: i8)
pub fn set_pulse_density(&mut self, density: i8)
Sets raw pulse density.
The value ranges from -128 to 127.
Sourcepub fn set_duty(&mut self, duty: u8)
pub fn set_duty(&mut self, duty: u8)
Sets duty cycle. 0 maps to the minimum density and 255 maps to the
maximum density.
Sourcepub fn prescaler(&self) -> u16
pub fn prescaler(&self) -> u16
Reads the hardware prescaler.
The returned value is in the hardware divider range 1..=256.
Sourcepub fn pulse_density(&self) -> i8
pub fn pulse_density(&self) -> i8
Reads the raw pulse density.
The returned value is in the hardware range -128..=127.
Trait Implementations§
Auto Trait Implementations§
impl<'d> !UnwindSafe for Channel<'d>
impl<'d> Freeze for Channel<'d>
impl<'d> RefUnwindSafe for Channel<'d>
impl<'d> Send for Channel<'d>
impl<'d> Sync for Channel<'d>
impl<'d> Unpin for Channel<'d>
impl<'d> UnsafeUnpin for Channel<'d>
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
Mutably borrows from an owned value. Read more