pub struct Dac1Output { /* private fields */ }
Expand description

Represents data associated with DAC.

Implementations§

source§

impl Dac1Output

source

pub fn new( spi: Spi<SPI5, Enabled, u16>, stream: Stream7<DMA1>, trigger_channel: Channel4, batch_size: usize ) -> Self

Construct the DAC output channel.

§Args
  • spi - The SPI interface used to communicate with the ADC.
  • stream - The DMA stream used to write DAC codes over SPI.
  • trigger_channel - The sampling timer output compare channel for update triggers.
source

pub fn start(&mut self)

source

pub fn with_buffer<F, R>(&mut self, f: F) -> Result<R, DMAError>
where F: FnOnce(&mut &'static mut [u16]) -> R,

Wait for the transfer of the currently active buffer to complete, then call a function on the now inactive buffer and acknowledge the transfer complete flag.

NOTE(unsafe): Memory safety and access ordering is not guaranteed (see the HAL DMA docs).

Trait Implementations§

source§

impl Mutex for Dac1Output

§

type Data = &'static mut [u16]

Data protected by the mutex.
source§

fn lock<R>(&mut self, f: impl FnOnce(&mut Self::Data) -> R) -> R

Creates a critical section and grants temporary access to the protected data.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.