STM32N6 NPU Deployment — Politecnico di Milano  1.0
Documentation for Neural Network Deployment on STM32N6 NPU - Politecnico di Milano 2024-2025
app_camerapipeline.c File Reference
#include <assert.h>
#include "cmw_camera.h"
#include "app_camerapipeline.h"
#include "app_config.h"
#include "crop_img.h"
Include dependency graph for app_camerapipeline.c:

Go to the source code of this file.

Macros

#define CAMERA_WIDTH   0
 
#define CAMERA_HEIGHT   0
 
#define CAMERA_FPS   30
 

Functions

static void DCMIPP_PipeInitDisplay (CMW_CameraInit_t *camConf, uint32_t *bg_width, uint32_t *bg_height)
 
static void DCMIPP_PipeInitNn (uint32_t *pitch)
 
void CameraPipeline_Init (uint32_t *lcd_bg_width, uint32_t *lcd_bg_height, uint32_t *pitch_nn)
 Init the camera and the 2 DCMIPP pipes. More...
 
void CameraPipeline_DeInit (void)
 
void CameraPipeline_DisplayPipe_Start (uint8_t *display_pipe_dst, uint32_t cam_mode)
 
void CameraPipeline_NNPipe_Start (uint8_t *nn_pipe_dst, uint32_t cam_mode)
 
void CameraPipeline_DisplayPipe_Stop ()
 
void CameraPipeline_IspUpdate (void)
 
int CMW_CAMERA_PIPE_FrameEventCallback (uint32_t pipe)
 Frame event callback. More...
 

Variables

int32_t cameraFrameReceived
 Camera frame ready flag. More...
 

Detailed Description

Author
GPM Application Team
Attention

Copyright (c) 2023 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file app_camerapipeline.c.

Macro Definition Documentation

◆ CAMERA_FPS

#define CAMERA_FPS   30

Definition at line 36 of file app_camerapipeline.c.

◆ CAMERA_HEIGHT

#define CAMERA_HEIGHT   0

Definition at line 35 of file app_camerapipeline.c.

◆ CAMERA_WIDTH

#define CAMERA_WIDTH   0

Definition at line 34 of file app_camerapipeline.c.

Function Documentation

◆ CameraPipeline_DeInit()

void CameraPipeline_DeInit ( void  )

Definition at line 139 of file app_camerapipeline.c.

◆ CameraPipeline_DisplayPipe_Start()

void CameraPipeline_DisplayPipe_Start ( uint8_t *  display_pipe_dst,
uint32_t  cam_mode 
)

Definition at line 146 of file app_camerapipeline.c.

Referenced by __attribute__().

Here is the caller graph for this function:

◆ CameraPipeline_DisplayPipe_Stop()

void CameraPipeline_DisplayPipe_Stop ( void  )

Definition at line 161 of file app_camerapipeline.c.

◆ CameraPipeline_Init()

void CameraPipeline_Init ( uint32_t *  lcd_bg_width,
uint32_t *  lcd_bg_height,
uint32_t *  pitch_nn 
)

Init the camera and the 2 DCMIPP pipes.

Parameters
lcd_bg_widthdisplay width
lcd_bg_heightdisplay height
pitch_nnoutput pitch computed by the CMW

Definition at line 121 of file app_camerapipeline.c.

References CAMERA_FLIP, CAMERA_FPS, CAMERA_HEIGHT, CAMERA_WIDTH, DCMIPP_PipeInitDisplay(), and DCMIPP_PipeInitNn().

Referenced by __attribute__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CameraPipeline_IspUpdate()

void CameraPipeline_IspUpdate ( void  )

Definition at line 168 of file app_camerapipeline.c.

Referenced by __attribute__().

Here is the caller graph for this function:

◆ CameraPipeline_NNPipe_Start()

void CameraPipeline_NNPipe_Start ( uint8_t *  nn_pipe_dst,
uint32_t  cam_mode 
)

Definition at line 153 of file app_camerapipeline.c.

Referenced by __attribute__().

Here is the caller graph for this function:

◆ CMW_CAMERA_PIPE_FrameEventCallback()

int CMW_CAMERA_PIPE_FrameEventCallback ( uint32_t  pipe)

Frame event callback.

Parameters
hdcmipppointer to the DCMIPP handle
Return values
None

Definition at line 180 of file app_camerapipeline.c.

References cameraFrameReceived.

◆ DCMIPP_PipeInitDisplay()

static void DCMIPP_PipeInitDisplay ( CMW_CameraInit_t *  camConf,
uint32_t *  bg_width,
uint32_t *  bg_height 
)
static

Definition at line 40 of file app_camerapipeline.c.

References ASPECT_RATIO_CROP, ASPECT_RATIO_FIT, ASPECT_RATIO_FULLSCREEN, ASPECT_RATIO_MODE, and SCREEN_HEIGHT.

Referenced by CameraPipeline_Init().

Here is the caller graph for this function:

◆ DCMIPP_PipeInitNn()

static void DCMIPP_PipeInitNn ( uint32_t *  pitch)
static

Definition at line 85 of file app_camerapipeline.c.

References ASPECT_RATIO_CROP, ASPECT_RATIO_FIT, ASPECT_RATIO_FULLSCREEN, ASPECT_RATIO_MODE, COLOR_MODE, NN_BPP, NN_HEIGHT, and NN_WIDTH.

Referenced by CameraPipeline_Init().

Here is the caller graph for this function:

Variable Documentation

◆ cameraFrameReceived

int32_t cameraFrameReceived
extern

Camera frame ready flag.

Set to 1 by the DCMIPP interrupt handler when a new NN pipe frame has been captured in AXISRAM. The main loop polls this flag. Declared volatile to prevent compiler optimization of the polling loop.

Definition at line 179 of file main.c.

Referenced by __attribute__(), and CMW_CAMERA_PIPE_FrameEventCallback().