Struct stabilizer::hardware::adc::Adc0Input
source · pub struct Adc0Input { /* private fields */ }
Expand description
Represents data associated with ADC.
Implementations§
source§impl Adc0Input
impl Adc0Input
sourcepub fn new(
spi: Spi<SPI2, Enabled, u16>,
trigger_stream: Stream0<DMA1>,
data_stream: Stream1<DMA1>,
clear_stream: Stream2<DMA1>,
trigger_channel: Channel1,
clear_channel: Channel1,
batch_size: usize
) -> Self
pub fn new( spi: Spi<SPI2, Enabled, u16>, trigger_stream: Stream0<DMA1>, data_stream: Stream1<DMA1>, clear_stream: Stream2<DMA1>, trigger_channel: Channel1, clear_channel: Channel1, batch_size: usize ) -> Self
Construct the ADC input channel.
§Args
spi
- The SPI interface used to communicate with the ADC.trigger_stream
- The DMA stream used to trigger each ADC transfer by writing a word into the SPI TX FIFO.data_stream
- The DMA stream used to read samples received over SPI into a data buffer.clear_stream
- The DMA stream used to clear the EOT flag in the SPI peripheral.trigger_channel
- The ADC sampling timer output compare channel for read triggers.clear_channel
- The shadow sampling timer output compare channel used for clearing the SPI EOT flag.
sourcepub fn with_buffer<F, R>(&mut self, f: F) -> Result<R, DMAError>
pub fn with_buffer<F, R>(&mut self, f: F) -> Result<R, DMAError>
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§
Auto Trait Implementations§
impl Freeze for Adc0Input
impl RefUnwindSafe for Adc0Input
impl Send for Adc0Input
impl !Sync for Adc0Input
impl Unpin for Adc0Input
impl !UnwindSafe for Adc0Input
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