pub struct Csi<'d, T: Instance> { /* private fields */ }Expand description
CSI-2 Host driver.
Implementations§
Source§impl<'d, T: Instance> Csi<'d, T>
impl<'d, T: Instance> Csi<'d, T>
Sourcepub fn new(
peri: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
config: Config,
) -> Self
pub fn new( peri: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, config: Config, ) -> Self
Create a new CSI-2 Host driver.
Enables the peripheral clock, performs a reset, programs the D-PHY
(config-clock range, HS frequency band, test-interface off, lane
mapping), and arms each enabled virtual channel. Leaves the receiver
itself disabled. Call start after the sensor has started
streaming.
Sourcepub fn start(&mut self)
pub fn start(&mut self)
Enable the CSI-2 receiver. After this call incoming packets are
dispatched to DCMIPP and per-virtual-channel outputs latch data.
Starts every virtual channel in Config::virtual_channels.
Sourcepub fn stop(&mut self)
pub fn stop(&mut self)
Disable the CSI-2 receiver. Stops every virtual channel in
Config::virtual_channels.
Sourcepub async fn wait_error(&mut self) -> Error
pub async fn wait_error(&mut self) -> Error
Wait for an error interrupt. Re-arms the same error interrupts before returning so the next error surfaces on the following call.
Returns the highest-priority error flag currently set in SR0/SR1. If
several flags are set at the same time, the returned Error variant is
chosen in an implementation-defined order; call again to drain the rest.