pub struct Camera<'d> { /* private fields */ }
Available on crate feature
unstable
only.Expand description
Represents the camera interface with DMA support.
Implementations§
Source§impl<'d> Camera<'d>
impl<'d> Camera<'d>
Sourcepub fn new<P, CH>(
cam: Cam<'d>,
channel: impl Peripheral<P = CH> + 'd,
_pins: P,
config: Config,
) -> Result<Self, ConfigError>where
CH: RxChannelFor<LCD_CAM>,
P: RxPins,
pub fn new<P, CH>(
cam: Cam<'d>,
channel: impl Peripheral<P = CH> + 'd,
_pins: P,
config: Config,
) -> Result<Self, ConfigError>where
CH: RxChannelFor<LCD_CAM>,
P: RxPins,
Creates a new Camera
instance with DMA support.
Sourcepub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
Applies the configuration to the camera interface.
§Errors
ConfigError::Clock
will be returned if the frequency passed in
Config
is too low.
Source§impl<'d> Camera<'d>
impl<'d> Camera<'d>
Sourcepub fn with_master_clock<MCLK: PeripheralOutput>(
self,
mclk: impl Peripheral<P = MCLK> + 'd,
) -> Self
pub fn with_master_clock<MCLK: PeripheralOutput>( self, mclk: impl Peripheral<P = MCLK> + 'd, ) -> Self
Configures the master clock (MCLK) pin for the camera interface.
Sourcepub fn with_pixel_clock<PCLK: PeripheralInput>(
self,
pclk: impl Peripheral<P = PCLK> + 'd,
) -> Self
pub fn with_pixel_clock<PCLK: PeripheralInput>( self, pclk: impl Peripheral<P = PCLK> + 'd, ) -> Self
Configures the pixel clock (PCLK) pin for the camera interface.
Sourcepub fn with_ctrl_pins<VSYNC: PeripheralInput, HENABLE: PeripheralInput>(
self,
vsync: impl Peripheral<P = VSYNC> + 'd,
h_enable: impl Peripheral<P = HENABLE> + 'd,
) -> Self
pub fn with_ctrl_pins<VSYNC: PeripheralInput, HENABLE: PeripheralInput>( self, vsync: impl Peripheral<P = VSYNC> + 'd, h_enable: impl Peripheral<P = HENABLE> + 'd, ) -> Self
Configures the control pins for the camera interface (VSYNC and HENABLE).
Sourcepub fn with_ctrl_pins_and_de<VSYNC: PeripheralInput, HSYNC: PeripheralInput, HENABLE: PeripheralInput>(
self,
vsync: impl Peripheral<P = VSYNC> + 'd,
hsync: impl Peripheral<P = HSYNC> + 'd,
h_enable: impl Peripheral<P = HENABLE> + 'd,
) -> Self
pub fn with_ctrl_pins_and_de<VSYNC: PeripheralInput, HSYNC: PeripheralInput, HENABLE: PeripheralInput>( self, vsync: impl Peripheral<P = VSYNC> + 'd, hsync: impl Peripheral<P = HSYNC> + 'd, h_enable: impl Peripheral<P = HENABLE> + 'd, ) -> Self
Configures the control pins for the camera interface (VSYNC, HSYNC, and HENABLE) with DE (data enable).
Sourcepub fn receive<BUF: DmaRxBuffer>(
self,
buf: BUF,
) -> Result<CameraTransfer<'d, BUF>, (DmaError, Self, BUF)>
pub fn receive<BUF: DmaRxBuffer>( self, buf: BUF, ) -> Result<CameraTransfer<'d, BUF>, (DmaError, Self, BUF)>
Starts a DMA transfer to receive data from the camera peripheral.