-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
drivers: video: ov7670: introduce driver for ov7670 camera #72826
base: main
Are you sure you want to change the base?
drivers: video: ov7670: introduce driver for ov7670 camera #72826
Conversation
d5dada1
to
695c7ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat! For the record, could you add in the commit message the board/devkit with wich you tested this.
Sure- it was tested on the FRDM-MCXN947, but that support requires PR #72827, which is dependent on this driver. I can add something like the following to the commit message:
Would this work? |
Sure. |
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA resolution in YUV and RGB mode. Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: zephyrproject-rtos#72827 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add ov7670 camera driver to build test for video drivers Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
695c7ba
to
0f92f6f
Compare
@loicpoulain could you revisit this PR when you get a chance? I've updated the commit message as requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
@ngphibang or @josuah, FYI in case either of you would like to provide feedback. |
the binding is fairly trivial, reassigning to video area |
#endif | ||
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios) | ||
/* Reset camera module */ | ||
if (gpio_is_ready_dt(&config->reset)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the reset gpio is not ready, the sensor will not intialize, we shouldn't continue and should return -ENODEV
?
|
||
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(pwdn_gpios) | ||
/* Power up camera module */ | ||
if (gpio_is_ready_dt(&config->pwdn)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the pwdn gpio is not ready, the sensor will not intialize, we shouldn't continue and should return -ENODEV
?
fmt.pixelformat = VIDEO_PIX_FMT_YUYV; | ||
fmt.width = 640; | ||
fmt.height = 480; | ||
fmt.pitch = 640 * 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. fmt.pitch = fmt.width * 2;
is better ?
type: phandle-array | ||
description: | | ||
The RESETn pin is asserted to disable the sensor causing a hard | ||
reset. The sensor receives this as an active-low signal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. . The sensor receives this as an active-low signal.
one extra space here
uint8_t i = 0U; | ||
|
||
if (fmt->pixelformat != VIDEO_PIX_FMT_RGB565 && fmt->pixelformat != VIDEO_PIX_FMT_YUYV) { | ||
LOG_ERR("Only RGB565 and YUV supported!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. LOG_ERR("Only RGB565 and YUYV supported!");
is more precise as we have several "YUV" formats.
return -ENODEV; | ||
} | ||
|
||
/* Set default camera format (QVGA, YUV) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. /* Set default camera format (QVGA, YUYV) */
is more precise as we have several "YUV" formats.
Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA
resolution in YUV and RGB mode.