For all STM32 drivers and SoC, replace the WRITE_REG macro and the
LL_xxx_WriteReg functions (defined in the STM32 HAL) by
stm32_reg_write defined in Zephyr.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
For all STM32 drivers, replace the CLEAR_BIT macro (defined in
the STM32 HAL) by stm32_reg_clear_bits defined in Zephyr.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
For all STM32 drivers, replace the SET_BIT macro (defined in
the STM32 HAL) by stm32_reg_set_bits defined in Zephyr.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add an always-on CID for enabling the test pattern, which makes
it possible to use it in tests enabling the test first enabling
the pattern.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Some devices allow for downscale / upscale via the set_selection
compose API. When using it, it is necessary to perform a
set_selection of the compose target prior to setting the format.
In order to allow non-compose aware application to benefit from
it, introduce a helper which take care of setting the compose
prior to setting the format.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Currently the DCMIPP driver rely on a Kconfig in order to
select the right sensor resolution / format to pick.
This also makes the exposure of caps easier since it can
be exposed as:
DUMP pipe: same caps as mentioned in Kconfig
MAIN pipe: any format supported on this pipe and resolution
starting at sensor selected resolution down to
64 times smaller (which is the maximum of the
downscale)
AUX pipe: same as MAIN except without the semi-planar and
planar formats
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Add Himax HM01B0 camera sensor driver.
It depends on I2C and it is required to configure the camera.
Signed-off-by: Antonino Scarpaci <antonino.scarpaci@gmail.com>
Avoid mixing encoder library return code and driver return value to
fix wrong value returned by enqueue() in nominal case.
Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
Clarify HAL return value is of type HAL_StatusTypeDef and not an
int in STM32 DCMI and DCMIPP drivers. For consistency, rename
the variable holding HAL return value from ret to hal_ret.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
On several boards, such as the Arduino Giga and
Portenta H7, they are often times setup with their
camera buffers and potentially video buffers in
SDRam. This can lead to a significant number of
DMA errors, which currently stops the camera from
returning any additional frames.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Forward the get_selection and set_selection APIs
to the camera objects, to allow some of the
selections to be supported at the camera level.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Implements the set_selection and get_selection APIs,
if forwarded to it by a camera controller.
It uses the new messages
to allow you to set a crop window on top of the
current format window. It also then allows you
to move this crop window around in the frame
window.
With this driver I also updated it to allow any resolution
from the displays min to max limits.
static const struct video_format_cap fmts[] = {
GC2145_VIDEO_FORMAT_CAP_HL(128, 1600, 128, 1200,
VIDEO_PIX_FMT_RGB565),
GC2145_VIDEO_FORMAT_CAP_HL(128, 1600, 128, 1200,
VIDEO_PIX_FMT_YUYV),
When the resolution is set, it computes the scale factor.
Using the set_selection(VIDEO_SEL_TGT_CROP) allows you
define a crop window within the format window.
It clamps the ratio to a max of 3 as some other
drivers limit it saying it helps with frame rates.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Initial version of the support for the STM32 JPEG HW codec,
currently supporting only NV12 to JPEG without DMA support
and using SW based conversion from NV12 to MCU required
for the JPEG codec.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Make the STM32 VENC driver depends on the VIDEO_ENCODER_H264
in order to be compiled only if VIDEO_ENCODER_H264 is
enabled by an application.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Add video subsystem related Kconfig in order to allow an
application to enable encoder support.
This is useful for platforms having several video devices
available as well as several video encoders, since it allows
to only compile / enable part of those devices depending on
their kind.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
The mipid02 is just a bridge driver which does not deal with memory so
should not expose caps' min_vbuf_count.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Receiver drivers now need to set the format's size to expose it to
the application.
Application should base on the format size to allocate buffers. The
caps' min/max_line_count (which are needed only for HWs that cannot
support the whole image frame) can hence be dropped.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
The STM32 video encoder (VENC) peripheral is a hardware
accelerator allowing to compress RGB/YUV frames into
H264 video bitstream chunks.
Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
video_shell_get_ctrl_by_name() normalized the search string (`name`)
instead of the control's actual name (`cq->name`). This made the
comparison always succeed on the first control, causing incorrect
lookups at runtime.
Update the code to normalize `cq->name` before comparison so that
each control name is correctly checked against the search string.
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
The function asserted `!sz && !ctrls`, which is the inverse of the
intended precondition. This caused assertion failures on valid inputs.
Update the check to `sz && ctrls` so it fails only when size is zero
or the control pointer is NULL.
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Add support in the OV5640 driver to configure the bus-width and
data-shift properties from devicetree when operating in DVP
(parallel) mode.
This allows the number of parallel data lines and the bit shift
to be set directly via DTS, ensuring correct configuration across
different hardware designs.
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Replace the custom I2C read/write functions in the OV5640 driver
with the common Video CCI API helpers.
- Introduce OV5640_REG8/REG16 macros for register addressing
- Convert struct ov5640_reg to struct video_reg16
- Replace ov5640_{read,write,modify}_reg() with CCI API helpers
- Replace ov5640_write_multi_regs() with video_write_cci_multiregs16()
This aligns the OV5640 driver with other video sensor drivers
that already rely on the CCI helpers.
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
In the DCMI video driver, set the caps.min_vbuf_count field to
indicate that two buffers are needed. Fix use of un-initialized
memory breaking the samples in some situations.
Signed-off-by: Josuah Demangeon <me@josuah.net>
In the ESP32 video driver, set the caps.min_vbuf_count field to
indicate that a two buffers are enough. Fix use of un-initialized
memory breaking the samples in some situations.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Add support for the Renesas RA Capture Engine Unit (CEU),
including driver source files, Kconfig options, and DTS bindings.
- Add initial implementation of the RA CEU driver
- Add dedicated Kconfig and CMake integration
- Provide Devicetree bindings for the RA CEU
- Update module Kconfig to include the new driver
This enables image capture functionality using the CEU peripheral
on Renesas RA series MCUs.
Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Forward get/set selection to the camera source and update the driver's
video_format on set so buffer sizing and streaming follow the selected
region.
Signed-off-by: Armin Kessler <ake@espros.com>
Add support for NV12/NV21, NV16/NV61 and YUV420/YVU420
(semi)planar formats which can be output by the main #1 pipe.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
ISP is part of the pixel pipes hence it doesn't make any sense to
try to call ISP external handlers if the DCMIPP doesn't have pixel
pipes available.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Define a video device for each pipe instead for the main dcmipp device
since the pipe is the device that communicates with application
(zephyr,camera chosen node), not the dcmipp device.
This helps to enable camera controls as well.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
The pipe nodes are not video interfaces. Describe them as normal child
nodes instead of using port/endpoint.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
In HAL based stm32 drivers, dma handling is done internally to HAL.
Though, in order to avoid a dma_config() call is done to ensure stream
will be set as busy in zephyr dma driver to avoid potential resource
sharing conflict.
This dma_config() call was done while taking into account
STM32_DMA_STREAM_OFFSET, which is wrong as it will prevent zephyr dma
driver to set the right stream as busy.
Fix this in impacted drivers.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
stm32 dcmi driver requires a reset control hence ensure that
CONFIG_RESET is properly selected to allow proper build.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
stm32 dcmipp driver requires a reset control and pinctrl
(depending on the configuration) hence ensure that
CONFIG_RESET and CONFIG_PINCTRL are properly selected to allow
proper build.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Wrap K_HEAP_DEFINE to fit within 100-character CI limit and apply
consistent spacing.This is a formatting-only change.
Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
Adds an assertion and runtime log to ensure 'step' is not zero before
using it in division,preventing undefined behavior without modifying
the public API.
Avoids a signature change (void → int) to preserve API stability for
Zephyr 4.2.A more complete solution can be proposed for 4.3.
CID: 444378
Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
During #89407 a driver-specific header stm32_dcmipp.h got introduced to
support new functionnalities not yet covered by video APIs.
Move this header into a new <include/zephyr/drivers/video/> include
direcctory like what other driver classes do.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Commit 64149e4df6 added an "#if defined()"
for configuring DMA channels differently depending on SOC family of the
STM32 HAL, but did not include the STM32H7 family in the same group as
STM32F7. Fix it by adding the STM32H7 in the same #ifdef filter.
Fixes#92015
Signed-off-by: Josuah Demangeon <me@josuah.net>