Skip to content

drivers: video: ov2640: add sensor driver for ov2640 #36423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 17, 2021

Conversation

robertszczepanski
Copy link
Contributor

This adds driver for Omnivision OV2640 image sensor.

The driver provides support for:

  • Camera initialization.
  • 10 camera controls - there is support for old control macros like horizontal and vertical flip, exposure and gain control. There are also new control macros that support brightness, saturation, white balance, contrast, colorbar and quality settings.
  • Camera hardware reset.
  • 2 output formats - RGB565 and JPEG.
  • 10 resolutions in both supported formats (160x120, 176x144, 240x160, 320x240, 352x288, 640x480, 800x600, 1024x768, 1280x1024, 1600x1200).

There is also new node in litex_vexriscv devicetree that represents OV2640 camera.
It has been tested on Arty A7-35T with LiteX SoC. OV2640 camera XCLK set to 24MHz.

@loicpoulain
Copy link
Collaborator

This adds driver for Omnivision OV2640 image sensor.

The driver provides support for:

* Camera initialization.

* 10 camera controls - there is support for old control macros like horizontal and vertical flip, exposure and gain control. There are also new control macros that support brightness, saturation, white balance, contrast, colorbar and quality settings.

* Camera hardware reset.

* 2 output formats - RGB565 and JPEG.

There is also new node in litex_vexriscv devicetree that represents OV2640 camera.
It has been tested on Arty A7-35T with LiteX SoC. OV2640 camera XCLK set to 24MHz.

Do you plan to submit a subsequent patch for the image processing/acquisition side of this microcontroller?

@robertszczepanski robertszczepanski force-pushed the ov2640-driver branch 2 times, most recently from 8a92398 to 8a88864 Compare June 21, 2021 11:54
@robertszczepanski
Copy link
Contributor Author

Right now we don't have any subsequent patches for the image processing planned for litex_vexriscv.

@loicpoulain
Copy link
Collaborator

Right now we don't have any subsequent patches for the image processing planned for litex_vexriscv.

ok, understood, but how did you test that? have you only tested the control path (i2c) or are you using some downstream driver for data catpure?

@robertszczepanski
Copy link
Contributor Author

robertszczepanski commented Jun 21, 2021

I developed an app that integrates this driver with FastVDMA, Zephyr net driver and shell subsystem. This allows me to write captured image to memory and then transfer it to my PC via Ethernet. After that I am able to convert an image to png (using ffmpeg) and display it on screen.
Shell subsystem with additional commands works great here for camera testing. I am able to get multiple captures (one at the time) with different camera settings without resetting device.

@loicpoulain
Copy link
Collaborator

@ro

I developed an app that integrates this driver with FastVDMA, Zephyr net driver and shell subsystem. This allows me to write captured image to memory and then transfer it to my PC via Ethernet. After that I am able to convert an image to png (using ffmpeg) and display it on screen.
Shell subsystem with additional commands works great here for camera testing. I am able to get multiple captures (one at the time) with different camera settings without resetting device.

Ok, thanks for the clarification.

@loicpoulain
Copy link
Collaborator

LGTM from a video framework perspective.

@carlescufi
Copy link
Member

@robertszczepanski please rebase to the latest main branch

Add JPEG pixel format needed for cameras with JPEG
compression capability.

Signed-off-by: Robert Szczepanski <rszczepanski@antmicro.com>
Add more camera control IDs for cameras with more capabilities.

Signed-off-by: Robert Szczepanski <rszczepanski@antmicro.com>
This adds the driver for Omnivision OV2640 image sensor.

The driver provides support for 10 different resolutions in range from
160x120 to 1600x1200 in both JPEG and RGB565 pixel formats. There are
also mutliple configuration options, e.g. hflip, vflip, saturation and
brightness control.

Signed-off-by: Robert Szczepanski <rszczepanski@antmicro.com>
@robertszczepanski
Copy link
Contributor Author

@carlescufi done :)

@cfriedt cfriedt merged commit 55e3c73 into zephyrproject-rtos:main Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Boards area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants