Skip to content

Commit

Permalink
samples: video: capture: add support for SMARTDMA
Browse files Browse the repository at this point in the history
Add support for using the SMARTDMA engine on the FRDM-MCXN947 board with
the video capture sample.

Signed-off-by: Daniel DeGrasse <[email protected]>
  • Loading branch information
danieldegrasse committed May 15, 2024
1 parent 0d1b535 commit ecdd67f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions samples/subsys/video/capture/boards/frdm_mcxn947_cpu0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=40000
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=2
# Workaround for issue where SDMA driver needs to start before camera, so that
# clock output will be generated for camera device
CONFIG_CHECK_INIT_PRIORITIES=n
10 changes: 10 additions & 0 deletions samples/subsys/video/capture/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ int main(void)
return 0;
}

video = dev;
#elif defined(CONFIG_VIDEO_MCUX_SDMA)
const struct device *const dev = DEVICE_DT_GET_ONE(nxp_video_smartdma);

if (!device_is_ready(dev)) {
LOG_ERR("%s: device not ready.\n", dev->name);
return 0;
}

video = dev;
#endif

Expand Down Expand Up @@ -78,6 +87,7 @@ int main(void)
(char)(fmt.pixelformat >> 24),
fmt.width, fmt.height);


/* Size to allocate for each buffer */
bsize = fmt.pitch * fmt.height / caps.vbuf_per_frame;

Expand Down

0 comments on commit ecdd67f

Please sign in to comment.