pub struct Dac<'d, T: Instance, DMACh1 = NoDma, DMACh2 = NoDma> { /* private fields */ }
Expand description
Implementations§
source§impl<'d, T: Instance, DMACh1, DMACh2> Dac<'d, T, DMACh1, DMACh2>
impl<'d, T: Instance, DMACh1, DMACh2> Dac<'d, T, DMACh1, DMACh2>
sourcepub fn new(
_peri: impl Peripheral<P = T> + 'd,
dma_ch1: impl Peripheral<P = DMACh1> + 'd,
dma_ch2: impl Peripheral<P = DMACh2> + 'd,
pin_ch1: impl Peripheral<P = impl DacPin<T, 1> + Pin> + 'd,
pin_ch2: impl Peripheral<P = impl DacPin<T, 2> + Pin> + 'd,
) -> Self
pub fn new( _peri: impl Peripheral<P = T> + 'd, dma_ch1: impl Peripheral<P = DMACh1> + 'd, dma_ch2: impl Peripheral<P = DMACh2> + 'd, pin_ch1: impl Peripheral<P = impl DacPin<T, 1> + Pin> + 'd, pin_ch2: impl Peripheral<P = impl DacPin<T, 2> + Pin> + 'd, ) -> Self
Create a new Dac
instance, consuming the underlying DAC peripheral.
This struct allows you to access both channels of the DAC, where available. You can either
call split()
to obtain separate DacChannel
s, or use methods on Dac
to use
the two channels together.
The channels are enabled on creation and begin to drive their output pins.
Note that some methods, such as set_trigger()
and set_mode()
, will
disable the channel; you must re-enable them with enable()
.
By default, triggering is disabled, but it can be enabled using the set_trigger()
method on the underlying channels.
Auto Trait Implementations§
impl<'d, T, DMACh1, DMACh2> Freeze for Dac<'d, T, DMACh1, DMACh2>
impl<'d, T, DMACh1, DMACh2> RefUnwindSafe for Dac<'d, T, DMACh1, DMACh2>
impl<'d, T, DMACh1, DMACh2> Send for Dac<'d, T, DMACh1, DMACh2>
impl<'d, T, DMACh1, DMACh2> Sync for Dac<'d, T, DMACh1, DMACh2>
impl<'d, T, DMACh1, DMACh2> Unpin for Dac<'d, T, DMACh1, DMACh2>
impl<'d, T, DMACh1 = NoDma, DMACh2 = NoDma> !UnwindSafe for Dac<'d, T, DMACh1, DMACh2>
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