/**< Frame Attribute: Pitch in bytes */ #define APP_CAPT_FRAME_PITCH ((uint32_t)\ (APP_CAPT_FRAME_WIDTH * APP_CAPT_FRAME_BPP)) /**< Frame Attribute: size in bytes */ #define APP_CAPT_FRAME_SIZE ((uint32_t)\ (APP_CAPT_FRAME_HEIGHT * APP_CAPT_FRAME_WIDTH * APP_CAPT_FRAME_BPP)) /**< For Ub960 Pattern Generator, most significant byte of active line length in * bytes */ #define APP_CAPT_FRAME_LINE_LEN_HIGH ((APP_CAPT_FRAME_PITCH & 0xFF00)>>8) /**< Number of CSIRX instances exist in SOC */ #define APP_TOTAL_CAPT_INST (CSIRX_INSTANCE_ID_MAX) /**< Number of CSIRX instances to test parallelly */ #define APP_CAPT_TEST_INST_NUM ((uint32_t)1U) /**< Number of channels */ #define APP_CAPT_CH_NUM ((uint32_t)1U)//4 /**< Input Image Data format */ #define APP_CAPT_IMAGE_DT (FVID2_CSI2_DF_RAW8)//FVID2_CCSF_BITS12_UNPACKED16 /**< Frame storage format. Only valid for RAW12 DT. */ #define APP_CAPT_IMAGE_STORAGE_FORMAT FVID2_CCSF_BITS8_PACKED//(FVID2_CCSF_BITS12_UNPACKED16) /**< Number of frames per stream */ #define APP_CAPT_FRAMES_PER_CH ((uint32_t)4U)//WGO orginally was 4 /**< Frame Attribute: Width in pixels */ #define APP_CAPT_FRAME_WIDTH ((uint32_t)1120U) /**< Frame Attribute: Height in pixels */ #define APP_CAPT_FRAME_HEIGHT ((uint32_t)1360U) /**< Frame Attribute: Bytes per pixel */ #define APP_CAPT_FRAME_BPP ((uint32_t)1U) /*when set to 1 it causes crash*/ /**< I2C transaction timeout */ #define APP_I2C_TRANSACTION_TIMEOUT ((uint32_t)2000U) static void CameraApp_initCaptParams(CsirxApp_CaptInstObj* appInstObj) { uint32_t loopCnt = 0U; if (CSIRX_INSTANCE_ID_0 == appInstObj->instId) { appInstObj->boardCsiInstID = BOARD_CSI_INST_0;//WGO CEER appInstObj->cameraSensor = APP_CSIRX_INST0_CAMERA_SENSOR; } else if (CSIRX_INSTANCE_ID_1 == appInstObj->instId) { appInstObj->boardCsiInstID = BOARD_CSI_INST_1; appInstObj->cameraSensor = APP_CSIRX_INST1_CAMERA_SENSOR; } #if defined(SOC_J784S4) else if (CSIRX_INSTANCE_ID_2 == appInstObj->instId) { appInstObj->boardCsiInstID = BOARD_CSI_INST_2; appInstObj->cameraSensor = APP_CSIRX_INST2_CAMERA_SENSOR; } #endif else { GT_0trace(CsirxAppTrace, GT_ERR, APP_NAME ": Invalid Capture Instance\r\n"); } /* set instance configuration parameters */ Csirx_createParamsInit(&appInstObj->createPrms); appInstObj->createPrms.numCh = APP_CAPT_CH_NUM; /* set channel configuration parameters */ for (loopCnt = 0U ; loopCnt < appInstObj->createPrms.numCh ; loopCnt++) { appInstObj->chFrmCnt[loopCnt] = 0U; appInstObj->createPrms.chCfg[loopCnt].chId = loopCnt; appInstObj->createPrms.chCfg[loopCnt].chType = CSIRX_CH_TYPE_CAPT; appInstObj->createPrms.chCfg[loopCnt].vcNum = loopCnt; appInstObj->createPrms.chCfg[loopCnt].inCsiDataType = APP_CAPT_IMAGE_DT; appInstObj->createPrms.chCfg[loopCnt].outFmt.width = APP_CAPT_FRAME_WIDTH; appInstObj->createPrms.chCfg[loopCnt].outFmt.height = APP_CAPT_FRAME_HEIGHT; appInstObj->createPrms.chCfg[loopCnt].outFmt.pitch[0U] = APP_CAPT_FRAME_PITCH; appInstObj->createPrms.chCfg[loopCnt].outFmt.dataFormat = FVID2_DF_BGRX32_8888; appInstObj->createPrms.chCfg[loopCnt].outFmt.ccsFormat = APP_CAPT_IMAGE_STORAGE_FORMAT; } /* set module configuration parameters */ appInstObj->createPrms.instCfg.enableCsiv2p0Support = UTRUE; appInstObj->createPrms.instCfg.numDataLanes = 4U; appInstObj->createPrms.instCfg.enableErrbypass = UTRUE;// WGO changed from UFALSE; appInstObj->createPrms.instCfg.enableStrm[CSIRX_CAPT_STREAM_ID] = 1U; for (loopCnt = 0U ; loopCnt < appInstObj->createPrms.instCfg.numDataLanes ; loopCnt++) { appInstObj->createPrms.instCfg.dataLanesMap[loopCnt] = (loopCnt + 1U); } /* set frame drop buffer parameters */ appInstObj->createPrms.frameDropBufLen = (APP_CAPT_FRAME_WIDTH * APP_CAPT_FRAME_BPP); appInstObj->createPrms.frameDropBuf = (uint64_t)&gFrmDropBuf; /* This will be updated once Fvid2_create() is done */ appInstObj->createStatus.retVal = FVID2_SOK; appInstObj->drvHandle = NULL; Fvid2CbParams_init(&appInstObj->cbPrms); appInstObj->cbPrms.cbFxn = (Fvid2_CbFxn) &CsirxApp_frameCompletionCb; appInstObj->cbPrms.appData = appInstObj; appInstObj->numFramesRcvd = 0U; appInstObj->frameErrorCnt = 0U; appInstObj->maxWidth = APP_CAPT_FRAME_WIDTH; appInstObj->maxHeight = APP_CAPT_FRAME_HEIGHT; /* Initialize capture instance status */ Csirx_instStatusInit(&appInstObj->captStatus); }