esp_hal::lcd_cam

Module cam

Source
Available on crate feature unstable only.
Expand description

§Camera - Master or Slave Mode

§Overview

The camera module is designed to receive parallel video data signals, and its bus supports DVP 8-/16-bit modes in master or slave mode.

§Configuration

In master mode, the peripheral provides the master clock to drive the camera, in slave mode it does not. This is configured with the with_master_clock method on the camera driver. The driver (due to the peripheral) mandates DMA (Direct Memory Access) for efficient data transfer.

§Examples

§Master Mode

Following code shows how to receive some bytes from an 8 bit DVP stream in master mode.



let mclk_pin = peripherals.GPIO15;
let vsync_pin = peripherals.GPIO6;
let href_pin = peripherals.GPIO7;
let pclk_pin = peripherals.GPIO13;
let data_pins = RxEightBits::new(
    peripherals.GPIO11,
    peripherals.GPIO9,
    peripherals.GPIO8,
    peripherals.GPIO10,
    peripherals.GPIO12,
    peripherals.GPIO18,
    peripherals.GPIO17,
    peripherals.GPIO16,
);

let config = Config::default().with_frequency(Rate::from_mhz(20));

let lcd_cam = LcdCam::new(peripherals.LCD_CAM);
let mut camera = Camera::new(
    lcd_cam.cam,
    peripherals.DMA_CH0,
    data_pins,
    config,
)?
.with_master_clock(mclk_pin) // Remove this for slave mode
.with_pixel_clock(pclk_pin)
.with_ctrl_pins(vsync_pin, href_pin);

let transfer = camera.receive(dma_buf).map_err(|e| e.0)?;

Structs§

  • Represents the camera interface.
  • Represents the camera interface with DMA support.
  • Represents an ongoing (or potentially stopped) transfer from the Camera to a DMA buffer.
  • Configuration settings for the Camera interface.
  • Represents an 8-bit wide camera data bus. Is used to configure the camera interface to receive 8-bit data.
  • Represents a 16-bit wide camera data bus. Is used to configure the camera interface to receive 16-bit data.

Enums§