Part Number: TDA3XEVM
Tool/software: TI-RTOS
Hi,
I'm using TDA3x-EVM board and TDA3x-EVM CSI2 Camera daughterboard with UB954 Deserializer. I configure UB954 to pattern mode. Vision SDK version is 3.03.
I want to make following use-case:
IssCapture -> Null
Null link dump data type is NULL_LINK_COPY_TYPE_NONE. I just want to save captured frame to SD card, I don't wan't to use ISP. The problem I have is that I can't capture any data on ISS Capture link (although UB954 starts to send data). Is it possible to use ISS without ISP? When I run isscapt_baremetal_app provided by TI I'm able to capture frames. Can you help us with this problem. I uploaded some files so can check them:
chains_iss_test_pattern.c -> Main usecase file.
deser.c -> Deserializer pattern mode configuration.
iss_sensor_tda3xx.c -> Check code from 299 - 318 line
iss_sensor_dummy.c -> New dummy sensor file added to ISS framework.
Please note that we don't have any sensor, we just wan't to get data from deserializer.
Best regards,
Stefan.
/******************************************************************************
Copyright (c) [2012 - 2017] Texas Instruments Incorporated
All rights reserved not granted herein.
Limited License.
Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
license under copyrights and patents it now or hereafter owns or controls to
make, have made, use, import, offer to sell and sell ("Utilize") this software
subject to the terms herein. With respect to the foregoing patent license,
such license is granted solely to the extent that any such patent is necessary
to Utilize the software alone. The patent license shall not apply to any
combinations which include this software, other than combinations with devices
manufactured by or for TI ("TI Devices"). No hardware patent is licensed
hereunder.
Redistributions must preserve existing copyright notices and reproduce this
license (including the above copyright notice and the disclaimer and
(if applicable) source code license limitations below) in the documentation
and/or other materials provided with the distribution
Redistribution and use in binary form, without modification, are permitted
provided that the following conditions are met:
* No reverse engineering, decompilation, or disassembly of this software
is permitted with respect to any software provided in binary form.
* Any redistribution and use are licensed by TI for use only with TI Devices.
* Nothing shall obligate TI to provide you with source code for the software
licensed and provided to you in object code.
If software source code is provided to you, modification and redistribution of
the source code are permitted provided that the following conditions are met:
* Any redistribution and use of the source code, including any resulting
derivative works, are licensed by TI for use only with TI Devices.
* Any redistribution and use of any object code compiled from the source code
and any resulting derivative works, are licensed by TI for use only with TI
Devices.
Neither the name of Texas Instruments Incorporated nor the names of its
suppliers may be used to endorse or promote products derived from this software
without specific prior written permission.
DISCLAIMER.
THIS SOFTWARE IS PROVIDED BY TI AND TI�S LICENSORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL TI AND TI�S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*******************************************************************************
* INCLUDE FILES
*******************************************************************************
*/
#include "chains_iss_test_pattern_priv.h"
#include <src/include/chains_common.h>
#include <src/rtos/iss/include/iss_sensors.h>
#include <src/rtos/iss/include/iss_utils.h>
#include <src/rtos/iss/include/app_util_iss.h>
/*
* AEWB algorithm memory requirement cannot be calculated upfront.
* This size is known by running the use-case once with large size
* and then checking the log for unused memory in AEWB algorithm
*/
#define ALG_AEWB_MEM_SIZE (896*1024)
void configDeser(void);
Int32 Utils_fileWriteFile(char *fileName, Uint8 *addr, Uint32 size);
/* returns 0 if does not exist, 1 if it does */
Int32 xUtils_fileExists( char *fileName )
{
Int32 retVal = 0;
Int32 hndlFile;
hndlFile = File_open(fileName, "rb");
if(hndlFile < 0)
{
retVal = 0;
} else {
retVal = 1;
}
File_close( hndlFile );
return retVal;
}
/* creates a filepath from an index and the fmt with a %u in it
* tries to find the next available unused value
*/
Int32 xUtils_nextAvailableFile( char * buf, char * fmt, Int32 theIndex )
{
sprintf( buf, fmt, theIndex );
while( xUtils_fileExists( buf ) && theIndex < 9999 )
{
Vps_printf( "filename %s %d exists... skipping\n", buf, theIndex );
theIndex++;
sprintf( buf, fmt, theIndex );
}
if( theIndex >= 9999 ) {
theIndex = 0;
sprintf( buf, fmt, theIndex );
}
return theIndex;
}
Int32 lastExposureTime = 0;
Int32 xUtils_fileWriteInfo( char * filename, char * extra )
{
Int32 status = 0;
char buf [200];
sprintf( buf, "%s, %u, %s\n", filename, lastExposureTime, extra );
status = Utils_fileWriteFile( filename, (Uint8 *)buf, strlen( buf ));
return status;
}
/**
*******************************************************************************
*
* \brief SingleCameraFrameCopyObject
*
* This structure contains all the LinksId's and create Params.
* The same is passed to all create, start, stop functions.
*
*******************************************************************************
*/
typedef struct {
chains_iss_test_patternObj ucObj;
IssM2mSimcopLink_ConfigParams simcopConfig;
vpsissldcConfig_t ldcCfg;
vpsissvtnfConfig_t vtnfCfg;
UInt32 captureOutWidth;
UInt32 captureOutHeight;
UInt32 displayWidth;
UInt32 displayHeight;
Chains_Ctrl *chainsCfg;
IssM2mSimcopLink_OperatingMode simcopMode;
Bool bypassVtnf;
Bool bypassLdc;
AppUtils_Obj appSensInfo;
} chains_iss_test_patternAppObj;
char gChains_IssIspSimcop_Display_runTimeMenu[] = {
"\r\n "
"\r\n ===================="
"\r\n Chains Run-time Menu"
"\r\n ===================="
"\r\n "
"\r\n 0: Stop Chain"
"\r\n "
"\r\n 1: Save Captured Frame"
"\r\n "
"\r\n p: Print Performance Statistics "
"\r\n "
"\r\n Enter Choice: "
"\r\n "
};
/**
*******************************************************************************
*
* \brief Set link Parameters
*
* It is called in Create function of the auto generated use-case file.
*
* \param pUcObj [IN] Auto-generated usecase object
* \param appObj [IN] Application specific object
*
*******************************************************************************
*/
Void chains_iss_test_pattern_SetAppPrms(
chains_iss_test_patternObj *pUcObj, Void *appObj)
{
chains_iss_test_patternAppObj *pObj
= (chains_iss_test_patternAppObj*)appObj;
ChainsCommon_GetDisplayWidthHeight(
pObj->chainsCfg->displayType,
&pObj->displayWidth,
&pObj->displayHeight
);
/* Create the sensor now */
strncpy(pObj->appSensInfo.sensorName, "DUMMY", //pObj->chainsCfg->sensorName,
ISS_SENSORS_MAX_NAME);
pObj->appSensInfo.numCh = 1;
pObj->appSensInfo.ispOpMode = pObj->chainsCfg->ispOpMode;
pObj->appSensInfo.simcopOpMode = pObj->simcopMode;
pObj->appSensInfo.numCSI2Inst = 1;
appCreateISSSensor(&pObj->appSensInfo);
appInitIssCaptParams(&pObj->appSensInfo, pUcObj->IssCaptureLinkID,
&pUcObj->IssCapturePrm);
pObj->captureOutWidth = pUcObj->IssCapturePrm.outParams[0U].width;
pObj->captureOutHeight = pUcObj->IssCapturePrm.outParams[0U].height;
Vps_printf("Width: %d\n", pObj->captureOutWidth);
Vps_printf("Height: %d\n", pObj->captureOutHeight);
pUcObj->IssCapturePrm.allocBufferForRawDump = TRUE;
pUcObj->NullPrm.dumpDataType = NULL_LINK_COPY_TYPE_NONE;
/*
ChainsCommon_SetDisplayPrms(&pUcObj->Display_VideoPrm,
NULL,
pObj->chainsCfg->displayType,
pObj->displayWidth,
pObj->displayHeight
);
ChainsCommon_StartDisplayCtrl(
pObj->chainsCfg->displayType,
pObj->displayWidth,
pObj->displayHeight);
*/
}
/**
*******************************************************************************
*
* \brief Start the capture display Links
*
* Function sends a control command to capture and display link to
* to Start all the required links . Links are started in reverce
* order as information of next link is required to connect.
* System_linkStart is called with LinkId to start the links.
*
* \param pObj [IN] chains_iss_test_patternAppObj
*
* \return SYSTEM_LINK_STATUS_SOK on success
*
*******************************************************************************
*/
Void chains_iss_test_pattern_StartApp(chains_iss_test_patternAppObj *pObj)
{
Chains_memPrintHeapStatus();
//appStartIssSensorSerDes(&pObj->appSensInfo);
//ChainsCommon_StartDisplayDevice(pObj->chainsCfg->displayType);
chains_iss_test_pattern_Start(&pObj->ucObj);
Chains_prfLoadCalcEnable(TRUE, FALSE, FALSE);
}
/**
*******************************************************************************
*
* \brief Delete the capture display Links
*
* Function sends a control command to capture and display link to
* to delete all the prior created links
* System_linkDelete is called with LinkId to delete the links.
*
* \param pObj [IN] chains_iss_test_patternAppObj
*
*******************************************************************************
*/
Void chains_iss_test_pattern_StopAndDeleteApp(chains_iss_test_patternAppObj *pObj)
{
chains_iss_test_pattern_Stop(&pObj->ucObj);
chains_iss_test_pattern_Delete(&pObj->ucObj);
// ChainsCommon_StopDisplayCtrl();
appStopISSSensor(&pObj->appSensInfo);
appDeleteISSSensor(&pObj->appSensInfo);
ChainsCommon_StopDisplayDevice(pObj->chainsCfg->displayType);
/* Print the HWI, SWI and all tasks load */
/* Reset the accumulated timer ticks */
Chains_prfLoadCalcEnable(FALSE, TRUE, TRUE);
}
/**
*******************************************************************************
*
* \brief Single Channel Capture Display usecase function
*
* This functions executes the create, start functions
*
* Further in a while loop displays run time menu and waits
* for user inputs to print the statistics or to end the demo.
*
* Once the user inputs end of demo stop and delete
* functions are executed.
*
* \param chainsCfg [IN] Chains_Ctrl
*
*******************************************************************************
*/
Void Chains_iss_test_pattern(Chains_Ctrl *chainsCfg)
{
char ch;
UInt32 done = FALSE;
chains_iss_test_patternAppObj chainsObj;
Int32 CapImCounter = 0;
char fName[128];
Int32 status = 0;
IssCaptureLink_GetSaveFrameStatus rawSaveFrameStatus;
UInt32 chId = 0U;
chainsObj.bypassVtnf = 0; /* KW error fix */
chainsObj.bypassLdc = 0; /* KW error fix */
Vps_printf(" Entered Chains_iss_test_pattern \n");
if (TRUE == IssM2mIspLink_IsWdrMode(chainsCfg->ispOpMode))
{
Vps_printf(" CHAINS: Please make sure BSP is build with WDR and LDC enabled !!!\n");
}
chainsObj.chainsCfg = chainsCfg;
/* Initialize Video Sensor, so that Algorithm can use Params
from Vid Sensor layer */
chains_iss_test_pattern_Create(&chainsObj.ucObj, &chainsObj);
ChainsCommon_SetIssCaptureErrorHandlingCb(chainsObj.ucObj.IssCaptureLinkID);
chains_iss_test_pattern_StartApp(&chainsObj);
configDeser();
Task_sleep(100);
while(!done)
{
Vps_printf(gChains_IssIspSimcop_Display_runTimeMenu);
ch = Chains_readChar();
switch(ch)
{
case '0':
done = TRUE;
break;
case '1':
{
/* Send command to Capture Link to save a frame */
System_linkControl(
chainsObj.ucObj.IssCaptureLinkID,
ISSCAPTURE_LINK_CMD_SAVE_FRAME,
&chId,
sizeof(chId),
TRUE);
do {
System_linkControl(
chainsObj.ucObj.IssCaptureLinkID,
ISSCAPTURE_LINK_CMD_GET_SAVE_FRAME_STATUS,
&rawSaveFrameStatus,
sizeof(IssCaptureLink_GetSaveFrameStatus),
TRUE);
} while (rawSaveFrameStatus.isSaveFrameComplete == FALSE);
CapImCounter = xUtils_nextAvailableFile( fName, "raw%04u.raw", CapImCounter );
status = Utils_fileWriteFile( fName, (UInt8*)rawSaveFrameStatus.bufAddr, rawSaveFrameStatus.bufSize);
sprintf( fName, "raw%04u.txt", CapImCounter );
if(status)
{
Vps_printf("Error %d: Error performing file write\n",status);
xUtils_fileWriteInfo( fName, "RAW, Error" );
} else {
Vps_printf("Wrote image %s to file\n",fName);
xUtils_fileWriteInfo( fName, "RAW, OK" );
}
break;
}
case 'p':
case 'P':
ChainsCommon_PrintStatistics();
chains_iss_test_pattern_printStatistics(&chainsObj.ucObj);
break;
default:
Vps_printf("\nUnsupported option '%c'. Please try again\n", ch);
break;
}
}
chains_iss_test_pattern_StopAndDeleteApp(&chainsObj);
}
/******************************************************************************
Copyright (c) [2012 - 2017] Texas Instruments Incorporated
All rights reserved not granted herein.
Limited License.
Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
license under copyrights and patents it now or hereafter owns or controls to
make, have made, use, import, offer to sell and sell ("Utilize") this software
subject to the terms herein. With respect to the foregoing patent license,
such license is granted solely to the extent that any such patent is necessary
to Utilize the software alone. The patent license shall not apply to any
combinations which include this software, other than combinations with devices
manufactured by or for TI ("TI Devices"). No hardware patent is licensed
hereunder.
Redistributions must preserve existing copyright notices and reproduce this
license (including the above copyright notice and the disclaimer and
(if applicable) source code license limitations below) in the documentation
and/or other materials provided with the distribution
Redistribution and use in binary form, without modification, are permitted
provided that the following conditions are met:
* No reverse engineering, decompilation, or disassembly of this software
is permitted with respect to any software provided in binary form.
* Any redistribution and use are licensed by TI for use only with TI Devices.
* Nothing shall obligate TI to provide you with source code for the software
licensed and provided to you in object code.
If software source code is provided to you, modification and redistribution of
the source code are permitted provided that the following conditions are met:
* Any redistribution and use of the source code, including any resulting
derivative works, are licensed by TI for use only with TI Devices.
* Any redistribution and use of any object code compiled from the source code
and any resulting derivative works, are licensed by TI for use only with TI
Devices.
Neither the name of Texas Instruments Incorporated nor the names of its
suppliers may be used to endorse or promote products derived from this software
without specific prior written permission.
DISCLAIMER.
THIS SOFTWARE IS PROVIDED BY TI AND TI�S LICENSORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL TI AND TI�S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/**
*******************************************************************************
* \file iss_sensor_dummy.c
*
*
*
*******************************************************************************
*/
/*******************************************************************************
* INCLUDE FILES
*******************************************************************************
*/
#include <iss_sensor_if.h>
#include <iss_sensor_serdes.h>
/**< ISS AEWB plugin is included here to get the default AEWB configuration
from each sensor */
#include <algorithmLink_issAewb.h>
#include <ti/drv/vps/include/devices/bsp_device.h>
/*******************************************************************************
* Defines
*******************************************************************************
*/
/*******************************************************************************
* Data structure's
*******************************************************************************
*/
struct {
UInt32 maxCoarseIntgTime;
/**< Max Coarse integration time supported by sensor */
float lineIntgTimeInMs;
/**< Line Integration time in ms */
float pixIntgTimeInMs;
/**< Pixel Integration time in ms */
} gDummyDeviceObj;
/*******************************************************************************
* Local Functions Declarations
*******************************************************************************
*/
static Int32 Dummy_Start(UInt32 chId, IssSensor_CreateParams *pCreatePrms);
static Int32 Dummy_Stop(UInt32 chId, IssSensor_CreateParams *pCreatePrms);
static Int32 Dummy_SetAeParams(IssSensor_CreateParams *pCreatePrms,
IssSensor_AeParams *pAePrms);
static Int32 Dummy_GetDccParams(IssSensor_CreateParams *pCreatePrms,
IssSensor_DccParams *pDccPrms);
static Dummy_GetExpParams(IssSensor_CreateParams *pCreatePrms,
IssSensor_ExposureParams *pExpPrms);
static Void Dummy_InitAewbConfig(
IssSensor_CreateParams *pCreatePrms,
AlgorithmLink_IssAewbCreateParams *pAewbPrms);
static Void Dummy_GetIspConfig (
IssSensor_CreateParams *pCreatePrms,
IssIspConfigurationParameters *pIspCfg);
static Int32 Dummy_ReadWriteReg (
IssSensor_CreateParams *pCreatePrms, UInt32 readWriteFlag,
IssSensor_ReadWriteReg *pReg);
static Int32 Dummy_ReadReg(UInt8 i2cInstId,
UInt8 i2cAddr,
const UInt16 *regAddr,
UInt8 *regVal,
UInt32 numRegs);
static Int32 Dummy_WriteReg(UInt8 i2cInstId,
UInt8 i2cAddr,
const UInt16 *regAddr,
const UInt8 *regVal,
UInt32 numRegs);
/*******************************************************************************
* Globals
*******************************************************************************
*/
/* \brief Sensor Params structure used for registering this sensor to chains_iss
*/
static IssSensorIf_Params SensorParams_Dummy = {0};
/*******************************************************************************
* Function Definition
*******************************************************************************
*/
Void IssSensor_Dummy_Init()
{
Int32 status;
IssSensorIf_Params *prms = &SensorParams_Dummy;
IssSensor_Info *info = &SensorParams_Dummy.info;
IssSensorIf_Params_Init(prms);
strncpy(prms->name, "DUMMY", ISS_SENSORS_MAX_NAME);
prms->dccId = 19999;
info->width = 1280;
info->height = 720;
info->dataFormat = SYSTEM_DF_RGB24_888;
info->bpp = SYSTEM_BPP_BITS24;
info->features = ISS_SENSOR_FEATURE_LINEAR_MODE;
info->aewbMode = ALGORITHMS_ISS_AEWB_MODE_NONE;
info->maxExp = 1;
info->ramOffset = 25*1024*1024;
prms->start = Dummy_Start;
prms->stop = Dummy_Stop;
prms->setAeParams = Dummy_SetAeParams;
prms->getExpParams = Dummy_GetExpParams;
prms->getDccParams = Dummy_GetDccParams;
prms->initAewbConfig = Dummy_InitAewbConfig;
prms->getIspConfig = Dummy_GetIspConfig;
prms->readWriteReg = Dummy_ReadWriteReg;
status = IssSensorIf_RegisterSensor(prms);
UTILS_assert(SYSTEM_LINK_STATUS_SOK == status);
}
/*******************************************************************************
* Local Functions Definition
*******************************************************************************
*/
static Int32 Dummy_Start(UInt32 chId, IssSensor_CreateParams *pCreatePrms)
{
Int32 status = SYSTEM_LINK_STATUS_EFAIL;
Vps_printf(">>>>>>>>> Dummy_Stop! <<<<<<<<<\n");
return (status);
}
static Int32 Dummy_Stop(UInt32 chId,
IssSensor_CreateParams *pCreatePrms)
{
Int32 status = SYSTEM_LINK_STATUS_EFAIL;
Vps_printf(">>>>>>>>> Dummy_Stop! <<<<<<<<<\n");
return (status);
}
static Int32 Dummy_SetAeParams(IssSensor_CreateParams *pCreatePrms,
IssSensor_AeParams *pAePrms)
{
Vps_printf(">>>>>>>>> Dummy_SetAeParams! <<<<<<<<<\n");
return (SYSTEM_LINK_STATUS_SOK);
}
static Int32 Dummy_ReadReg(UInt8 i2cInstId,
UInt8 i2cAddr,
const UInt16 *regAddr,
UInt8 *regVal,
UInt32 numRegs)
{
Int32 status = SYSTEM_LINK_STATUS_SOK;
UInt32 cnt;
UInt8 rawRegVal[3];
for (cnt = 0; cnt < numRegs; cnt++)
{
/* Convert Registers address and value into 8bit array */
rawRegVal[0U] = (UInt8) ((regAddr[cnt] >> 8U) & (UInt8) 0xFF);
rawRegVal[1U] = (UInt8) ((regAddr[cnt] >> 0U) & (UInt8) 0xFF);
status = Bsp_deviceRawWrite8(i2cInstId, i2cAddr, rawRegVal, 2u);
if (FVID2_SOK == status)
{
status = Bsp_deviceRawRead8(i2cInstId, i2cAddr, &rawRegVal[2U],
1u);
regVal[cnt] = rawRegVal[2u];
}
}
return (status);
}
static Int32 Dummy_WriteReg(UInt8 i2cInstId,
UInt8 i2cAddr,
const UInt16 *regAddr,
const UInt8 *regValue,
UInt32 numRegs)
{
Int32 status = SYSTEM_LINK_STATUS_EFAIL;
UInt32 cnt;
UInt8 rawRegVal[3];
for (cnt = 0u; cnt < numRegs; cnt ++)
{
/* Convert Registers address and value into 8bit array */
rawRegVal[0U] = (UInt8) ((regAddr[cnt] >> 8U) & (UInt8) 0xFF);
rawRegVal[1U] = (UInt8) ((regAddr[cnt] >> 0U) & (UInt8) 0xFF);
rawRegVal[2U] = (UInt8) ((regValue[cnt] >> 0U) & (UInt8) 0xFF);
status = Bsp_deviceRawWrite8(i2cInstId, i2cAddr, rawRegVal, 3U);
if (SYSTEM_LINK_STATUS_SOK != status)
{
break;
}
}
return (status);
}
static Dummy_GetDccParams(IssSensor_CreateParams *pCreatePrms,
IssSensor_DccParams *pDccPrms)
{
Int32 status = SYSTEM_LINK_STATUS_SOK;
Vps_printf(">>>>>>>>> Dummy_GetDccParams! <<<<<<<<<\n");
return (status);
}
static Dummy_GetExpParams(IssSensor_CreateParams *pCreatePrms,
IssSensor_ExposureParams *pExpPrms)
{
Int32 status = SYSTEM_LINK_STATUS_SOK;
Vps_printf(">>>>>>>>> Dummy_GetExpParams! <<<<<<<<<\n");
return (status);
}
static Void Dummy_InitAewbConfig(
IssSensor_CreateParams *pCreatePrms,
AlgorithmLink_IssAewbCreateParams *pAewbPrms)
{
Vps_printf(">>>>>>>>> Dummy_InitAewbConfig! <<<<<<<<<\n");
}
static Void Dummy_GetIspConfig (
IssSensor_CreateParams *pCreatePrms,
IssIspConfigurationParameters *pIspCfg)
{
Vps_printf(">>>>>>>>> Dummy_GetIspConfig! <<<<<<<<<\n");
}
static Int32 Dummy_ReadWriteReg (
IssSensor_CreateParams *pCreatePrms, UInt32 readWriteFlag,
IssSensor_ReadWriteReg *pReg)
{
Int32 status;
UInt32 chId;
UInt8 regValue;
UTILS_assert(NULL != pReg);
UTILS_assert(NULL != pReg);
/* Assuming Channel Id as 0 */
chId = pReg->chId;
if (readWriteFlag)
{
regValue = pReg->regValue;
status = Dummy_WriteReg(pCreatePrms->i2cInstId,
pCreatePrms->i2cAddr[chId], &pReg->regAddr, ®Value, 1u);
}
else
{
status = Dummy_ReadReg(pCreatePrms->i2cInstId,
pCreatePrms->i2cAddr[chId], &pReg->regAddr, ®Value, 1u);
if (SYSTEM_LINK_STATUS_SOK == status)
{
pReg->regValue = regValue;
}
}
return (status);
}
/******************************************************************************
Copyright (c) [2012 - 2017] Texas Instruments Incorporated
All rights reserved not granted herein.
Limited License.
Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
license under copyrights and patents it now or hereafter owns or controls to
make, have made, use, import, offer to sell and sell ("Utilize") this software
subject to the terms herein. With respect to the foregoing patent license,
such license is granted solely to the extent that any such patent is necessary
to Utilize the software alone. The patent license shall not apply to any
combinations which include this software, other than combinations with devices
manufactured by or for TI ("TI Devices"). No hardware patent is licensed
hereunder.
Redistributions must preserve existing copyright notices and reproduce this
license (including the above copyright notice and the disclaimer and
(if applicable) source code license limitations below) in the documentation
and/or other materials provided with the distribution
Redistribution and use in binary form, without modification, are permitted
provided that the following conditions are met:
* No reverse engineering, decompilation, or disassembly of this software
is permitted with respect to any software provided in binary form.
* Any redistribution and use are licensed by TI for use only with TI Devices.
* Nothing shall obligate TI to provide you with source code for the software
licensed and provided to you in object code.
If software source code is provided to you, modification and redistribution of
the source code are permitted provided that the following conditions are met:
* Any redistribution and use of the source code, including any resulting
derivative works, are licensed by TI for use only with TI Devices.
* Any redistribution and use of any object code compiled from the source code
and any resulting derivative works, are licensed by TI for use only with TI
Devices.
Neither the name of Texas Instruments Incorporated nor the names of its
suppliers may be used to endorse or promote products derived from this software
without specific prior written permission.
DISCLAIMER.
THIS SOFTWARE IS PROVIDED BY TI AND TI�S LICENSORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL TI AND TI�S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/**
*******************************************************************************
* \file iss_sensor_tda3xx.c
*
*
*
*******************************************************************************
*/
/*******************************************************************************
* INCLUDE FILES
*******************************************************************************
*/
/* Including system.h for Int32/UInt32 data type */
#include <include/link_api/system.h>
#include <ti/drv/vps/include/platforms/bsp_platform.h>
#include <ti/drv/vps/include/boards/bsp_board.h>
#include <ti/drv/vps/include/vps.h>
#include <ti/drv/vps/include/vps_capture.h>
#include <ti/drv/vps/include/devices/bsp_device.h>
#include <ti/drv/vps/examples/utility/bsputils_ub960.h>
#include <iss_sensors.h>
#include <iss_sensor_serdes.h>
#include <iss_utils.h>
/*******************************************************************************
* Defines
*******************************************************************************
*/
/* I2C Instance for the board Mux */
#define CHAINS_COMMON_TDA3XX_BOARD_MUX_I2C_INST (0U)
/* I2C Address of the board mux */
#define CHAINS_COMMON_TDA3XX_BOARD_MUX_I2C_ADDR (0x23U)
/*******************************************************************************
* Data Structures
*******************************************************************************
*/
typedef struct {
char name[ISS_SENSORS_MAX_NAME];
ChainsCommon_IssSensorIf info;
} ChainsCommon_SensorIntfInfo;
/*******************************************************************************
* Globals
*******************************************************************************
*/
const static IssUtils_Ub96xSerDesCfg gSensorSerDesInfo[] = {
{SENSOR_APTINA_AR0132, NULL, 0, NULL, 0, BSPUTILS_FPDCAMPOWERLEVEL_OFF, 0U},
{SENSOR_APTINA_AR0140, NULL, 0, NULL, 0, BSPUTILS_FPDCAMPOWERLEVEL_OFF, 0U},
{SENSOR_OMNIVISION_OV10640_CSI2, NULL, 0, NULL, 0, BSPUTILS_FPDCAMPOWERLEVEL_OFF, 0U},
{SENSOR_SONY_IMX224_CSI2, NULL, 0, NULL, 0, BSPUTILS_FPDCAMPOWERLEVEL_OFF, 0U},
{SENSOR_OMNIVISION_OV10640_IMI, gAppIssUtilsUb960Cfg_OV10640_IMI, OV10640_IMI_DES_CFG_SIZE,
gUB913_OV10640_IMI_SerCfg, OV10640_IMI_SER_CFG_SIZE,
BSPUTILS_FPDCAMPOWERLEVEL_12V0, 100U},
{SENSOR_APTINA_AR0140_TIDA262, gAppIssUtilsUb960Cfg_AR0140_TIDA0262_DesCfg, AR0140_TIDA0262_DES_CFG_SIZE,
gUB913_AR0140_TIDA0262_SerCfg, AR0140_TIDA0262_SER_CFG_SIZE,
BSPUTILS_FPDCAMPOWERLEVEL_12V0, 100U},
{SENSOR_OMNIVISION_OV2775_TIDA1130, gAppIssUtilsUb960Cfg_OV2775_TIDA1130_DesCfg, OV2775_TIDA1130_DES_CFG_SIZE,
gUB953_OV2775_TIDA1130_SerCfg, OV2775_TIDA1130_SER_CFG_SIZE,
BSPUTILS_FPDCAMPOWERLEVEL_12V0, 100U},
{SENSOR_SONY_IMX390_UB953_D3, gUB960DesCfg_D3IMX390, IMX390_D3_DES_CFG_SIZE,
gAppIssUtilsUB953SerCfg_D3IMX390, IMX390_D3_SER_CFG_SIZE,
BSPUTILS_FPDCAMPOWERLEVEL_12V0, 2000U},
{SENSOR_OMNIVISION_OV2775_CSI2, NULL, 0, NULL, 0, BSPUTILS_FPDCAMPOWERLEVEL_OFF, 0U},
{SENSOR_APTINA_AR0143_MARS, gAppIssUtilsUb960Cfg_MARS_AR0143,AR143_MARS_DES_CFG_SIZE,
gUB913MarsAR0143SerCfg, AR143_MARS_SER_CFG_SIZE,
BSPUTILS_FPDCAMPOWERLEVEL_12V0, 500U},
};
const static ChainsCommon_SensorIntfInfo gSensorInterfaceInfo[] = {
{SENSOR_APTINA_AR0132,
{1u, {0x10}, {0x10}, FALSE, SYSTEM_VIFW_12BIT, SYSTEM_VIFM_SCH_CPI}},
{SENSOR_APTINA_AR0140,
{1u, {0x10}, {0x10}, FALSE, SYSTEM_VIFW_12BIT, SYSTEM_VIFM_SCH_CPI}},
{SENSOR_OMNIVISION_OV10640_CSI2,
{1u, {0x32}, {0x32}, FALSE, SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/, 0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 2}, /* Clock Lane */
{FALSE, 1}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
400 /* csi2PhyClk */ }}},
{SENSOR_SONY_IMX224_CSI2,
{1u, {0x36}, {0x36}, FALSE, SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/, 0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 2u}, /* Clock Lane */
{FALSE, 1u}, /* data1Lane */
{FALSE, 3u}, /* data2Lane */
{FALSE, 4u}, /* data3Lane*/
{FALSE, 5u}},/* data4Lane */
150u /* csi2PhyClk */ }}},
{SENSOR_OMNIVISION_OV10640_IMI,
{
#ifdef BOARD_TYPE_TDA3XX_RVP
0u, /* TDA3X RVP board uses I2C instance 0 */
#else
1u, /* TDA3X EVM board uses I2C instance 1 */
#endif
{PORT_0_SENSOR_ADDR, PORT_1_SENSOR_ADDR, PORT_2_SENSOR_ADDR, PORT_3_SENSOR_ADDR}, /* Sensor alias address */
{PORT_0_SER_ADDR, PORT_1_SER_ADDR, PORT_2_SER_ADDR, PORT_3_SER_ADDR}, /* Serializer alias address */
TRUE, /* isMultiChannel */
SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/,
0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 1}, /* Clock Lane */
{FALSE, 2}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
800 /* csi2PhyClk */ },
FVID2_VID_SENSOR_IMI_OV10640_DRV, /* sensorDrvId */
TRUE, /* sensorBroadcast */
TRUE}}, /* enableFsin */
{SENSOR_APTINA_AR0140_TIDA262,
{
#ifdef BOARD_TYPE_TDA3XX_RVP
0u, /* TDA3X RVP board uses I2C instance 0 */
#else
1u, /* TDA3X EVM board uses I2C instance 1 */
#endif
{PORT_0_SENSOR_ADDR, PORT_1_SENSOR_ADDR, PORT_2_SENSOR_ADDR, PORT_3_SENSOR_ADDR}, /* Sensor alias address */
{PORT_0_SER_ADDR, PORT_1_SER_ADDR, PORT_2_SER_ADDR, PORT_3_SER_ADDR}, /* Serializer alias address */
TRUE, /* isMultiChannel */
SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/,
0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 1}, /* Clock Lane */
{FALSE, 2}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
800 /* csi2PhyClk */ },
FVID2_VID_SENSOR_TIDA00262_APT_AR0140_DRV, /* sensorDrvId */
FALSE, /* sensorBroadcast */
FALSE}}, /* enableFsin */
#ifdef BOARD_TYPE_TDA3XX_RVP
{SENSOR_OMNIVISION_OV2775_TIDA1130,
{
0u, /* TDA3X RVP board uses I2C instance 1 */
{PORT_0_SENSOR_ADDR, PORT_1_SENSOR_ADDR, PORT_2_SENSOR_ADDR, PORT_3_SENSOR_ADDR}, /* Sensor alias address */
{PORT_0_SER_ADDR, PORT_1_SER_ADDR, PORT_2_SER_ADDR, PORT_3_SER_ADDR}, /* Serializer alias address */
TRUE, /* isMultiChannel */
SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/,
0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 1}, /* Clock Lane */
{FALSE, 2}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
800 /* csi2PhyClk */ },
FVID2_VID_SENSOR_OV2775_TIDA1130_DRV, /* sensorDrvId */
FALSE, /* sensorBroadcast */
FALSE}}, /* enableFsin */
{SENSOR_SONY_IMX390_UB953_D3,
{
0u, /* TDA3X EVM board uses I2C instance 1 */
{PORT_0_SENSOR_ADDR, PORT_1_SENSOR_ADDR, PORT_2_SENSOR_ADDR, PORT_3_SENSOR_ADDR}, /* Sensor alias address */
{PORT_0_SER_ADDR, PORT_1_SER_ADDR, PORT_2_SER_ADDR, PORT_3_SER_ADDR}, /* Serializer alias address */
TRUE, /* isMultiChannel */
SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/,
0 /*Virtual Channel Id*/,
1, /* Is CSI Enable Required in UB960 */
{TRUE /* isCplxCfgValid */,
{{FALSE, 1}, /* Clock Lane */
{FALSE, 2}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
800 /* csi2PhyClk */ },
FVID2_VID_SENSOR_D3_SONY_IMX390_DRV, /* sensorDrvId */
FALSE, /* sensorBroadcast */
FALSE}, /* enable Fsin */
},
#endif
{SENSOR_OMNIVISION_OV2775_CSI2,
{1u, {0x36}, {0x36}, FALSE, SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/, 0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 3}, /* Clock Lane */
{FALSE, 4}, /* data1Lane */
{FALSE, 2}, /* data2Lane */
{FALSE, 0}, /* data3Lane*/
{FALSE, 0}},/* data4Lane */
480 /* csi2PhyClk */ }}},
{SENSOR_APTINA_AR0143_MARS,
{
#ifdef BOARD_TYPE_TDA3XX_RVP
0u, /* TDA3X RVP board uses I2C instance 0 */
#else
1u, /* TDA3X EVM board uses I2C instance 1 */
#endif
{PORT_0_SENSOR_ADDR, PORT_1_SENSOR_ADDR, PORT_2_SENSOR_ADDR, PORT_3_SENSOR_ADDR}, /* Sensor alias address */
{PORT_0_SER_ADDR, PORT_1_SER_ADDR, PORT_2_SER_ADDR, PORT_3_SER_ADDR}, /* Serializer alias address */
TRUE, /* isMultiChannel */
SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW12 /* CSI2 DataFormat*/,
0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 1}, /* Clock Lane */
{FALSE, 2}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
800 /* csi2PhyClk */ },
FVID2_VID_SENSOR_MARS_APT_AR0143_DRV, /* sensorDrvId */
FALSE, /* sensorBroadcast */
FALSE}}, /* enableFsin */
// Koncar
{"DUMMY",
{
1u, /* TDA3X EVM board uses I2C instance 1 */
{0x60}, /* Sensor alias address */
{0x60}, /* Serializer alias address */
FALSE, /* isMultiChannel */
SYSTEM_VIFW_4LANES, SYSTEM_VIFM_SCH_CSI2,
SYSTEM_CSI2_RAW8 /* CSI2 DataFormat*/,
0 /*Virtual Channel Id*/,
0, /* IsCSIPostEnable Required */
{TRUE /* isCplxCfgValid */,
{{FALSE, 1}, /* Clock Lane */
{FALSE, 2}, /* data1Lane */
{FALSE, 3}, /* data2Lane */
{FALSE, 4}, /* data3Lane*/
{FALSE, 5}},/* data4Lane */
400 /* csi2PhyClk */ },
19999, /* sensorDrvId */
FALSE, /* sensorBroadcast */
FALSE}}, /* enableFsin */
};
/*******************************************************************************
* Local Functions Declarations
*******************************************************************************
*/
/*******************************************************************************
* Function Definition
*******************************************************************************
*/
Int32 ChainsPlatform_GetSensorSerDesCfg(char name[],
IssUtils_Ub96xSerDesCfg* cfg)
{
Int32 status = SYSTEM_LINK_STATUS_EFAIL;
UInt32 cnt, numSensors;
UTILS_assert(NULL != cfg);
numSensors = sizeof(gSensorSerDesInfo)/sizeof(IssUtils_Ub96xSerDesCfg);
for (cnt = 0u; cnt < numSensors; cnt ++)
{
if (0 == strncmp(name, gSensorSerDesInfo[cnt].name,
ISS_SENSORS_MAX_NAME))
{
cfg->desCfgScript = gSensorSerDesInfo[cnt].desCfgScript;
cfg->num_des_registers= gSensorSerDesInfo[cnt].num_des_registers;
cfg->serCfgScript = gSensorSerDesInfo[cnt].serCfgScript;
cfg->num_ser_registers= gSensorSerDesInfo[cnt].num_ser_registers;
cfg->cam_pwr_level = gSensorSerDesInfo[cnt].cam_pwr_level;
cfg->waitAfterPowerOn = gSensorSerDesInfo[cnt].waitAfterPowerOn;
status = SYSTEM_LINK_STATUS_SOK;
break;
}
}
return (status);
}
Int32 ChainsPlatform_GetSensorIntfInfo(char name[],
ChainsCommon_IssSensorIf *info)
{
Int32 status = SYSTEM_LINK_STATUS_EFAIL;
UInt32 cnt, numSensors;
UTILS_assert(NULL != info);
numSensors = sizeof(gSensorInterfaceInfo)/sizeof(ChainsCommon_SensorIntfInfo);
for (cnt = 0u; cnt < numSensors; cnt ++)
{
if (0 == strncmp(name, gSensorInterfaceInfo[cnt].name,
ISS_SENSORS_MAX_NAME))
{
info->i2cInstId = gSensorInterfaceInfo[cnt].info.i2cInstId;
info->i2cAddr[0] = gSensorInterfaceInfo[cnt].info.i2cAddr[0];
info->i2cAddr[1] = gSensorInterfaceInfo[cnt].info.i2cAddr[1];
info->i2cAddr[2] = gSensorInterfaceInfo[cnt].info.i2cAddr[2];
info->i2cAddr[3] = gSensorInterfaceInfo[cnt].info.i2cAddr[3];
info->i2cAddr[4] = gSensorInterfaceInfo[cnt].info.i2cAddr[4];
info->i2cAddr[5] = gSensorInterfaceInfo[cnt].info.i2cAddr[5];
info->i2cAddr[6] = gSensorInterfaceInfo[cnt].info.i2cAddr[6];
info->i2cAddr[7] = gSensorInterfaceInfo[cnt].info.i2cAddr[7];
info->i2cAddrSer[0] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[0];
info->i2cAddrSer[1] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[1];
info->i2cAddrSer[2] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[2];
info->i2cAddrSer[3] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[3];
info->i2cAddrSer[4] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[4];
info->i2cAddrSer[5] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[5];
info->i2cAddrSer[6] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[6];
info->i2cAddrSer[7] = gSensorInterfaceInfo[cnt].info.i2cAddrSer[7];
info->isMultiChannel = gSensorInterfaceInfo[cnt].info.isMultiChannel;
info->videoIfWidth = gSensorInterfaceInfo[cnt].info.videoIfWidth;
info->videoIfMode = gSensorInterfaceInfo[cnt].info.videoIfMode;
info->inCsi2DataFormat =
gSensorInterfaceInfo[cnt].info.inCsi2DataFormat;
info->inCsi2VirtualChanNum =
gSensorInterfaceInfo[cnt].info.inCsi2VirtualChanNum;
info->csi2Prms[0] = gSensorInterfaceInfo[cnt].info.csi2Prms[0];
info->csi2Prms[1] = gSensorInterfaceInfo[cnt].info.csi2Prms[1];
info->sensorDrvId = gSensorInterfaceInfo[cnt].info.sensorDrvId;
info->sensorBroadcast = gSensorInterfaceInfo[cnt].info.sensorBroadcast;
info->enableFsin = gSensorInterfaceInfo[cnt].info.enableFsin;
info->isEnableCSIPostConfig = gSensorInterfaceInfo[cnt].info.isEnableCSIPostConfig;
info->deserializerAddr[0] = gSensorInterfaceInfo[cnt].info.deserializerAddr[0];
info->deserializerAddr[1] = gSensorInterfaceInfo[cnt].info.deserializerAddr[1];
status = SYSTEM_LINK_STATUS_SOK;
break;
}
}
return (status);
}
Void ChainsPlatform_SetPinMux(char name[])
{
Int32 status;
UInt32 cnt, numSensors;
Bsp_BoardMode boardMode;
numSensors = sizeof(gSensorInterfaceInfo)/sizeof(ChainsCommon_IssSensorIf);
for (cnt = 0u; cnt < numSensors; cnt ++)
{
if ((0 == strncmp(name, gSensorInterfaceInfo[cnt].name,
ISS_SENSORS_MAX_NAME)) &&
(SYSTEM_VIFM_SCH_CPI == gSensorInterfaceInfo[cnt].info.videoIfMode))
{
switch (gSensorInterfaceInfo[cnt].info.videoIfWidth)
{
default:
boardMode = BSP_BOARD_MODE_NONE;
break;
case SYSTEM_VIFW_8BIT:
boardMode = BSP_BOARD_MODE_VIDEO_8BIT;
break;
case SYSTEM_VIFW_10BIT:
boardMode = BSP_BOARD_MODE_VIDEO_10BIT;
break;
case SYSTEM_VIFW_12BIT:
boardMode = BSP_BOARD_MODE_VIDEO_12BIT;
break;
case SYSTEM_VIFW_14BIT:
boardMode = BSP_BOARD_MODE_VIDEO_14BIT;
break;
case SYSTEM_VIFW_16BIT:
boardMode = BSP_BOARD_MODE_VIDEO_16BIT;
break;
case SYSTEM_VIFW_24BIT:
boardMode = BSP_BOARD_MODE_VIDEO_24BIT;
break;
}
/* Set pinmux */
status = Bsp_boardSetPinMux(FVID2_VPS_CAPT_VID_DRV,
VPS_CAPT_INST_ISS_CAL_A, boardMode);
UTILS_assert (SYSTEM_LINK_STATUS_SOK == status);
break;
}
}
}
Void ChainsBoard_SetBoardMux(char name[])
{
Int32 status;
UInt32 cnt, numSensors;
UInt8 regValue[3U];
numSensors = sizeof(gSensorInterfaceInfo)/sizeof(ChainsCommon_IssSensorIf);
for (cnt = 0u; cnt < numSensors; cnt ++)
{
if ((0 == strncmp(name, gSensorInterfaceInfo[cnt].name,
ISS_SENSORS_MAX_NAME)) &&
(SYSTEM_VIFM_SCH_CPI == gSensorInterfaceInfo[cnt].info.videoIfMode))
{
status = Bsp_boardReadTCA6424BoardMux(3, regValue);
UTILS_assert(status == BSP_SOK);
/* Select the CPI input by setting Mux Control 0 and 5 */
regValue[0u] |= (0x21);
/* Set VIN_MAP[0:2] to 010 for Aptina 12-bit - Level 2 */
regValue[2u] &= ~(0x3D);
status = Bsp_boardWriteTCA6424BoardMux(3, regValue);
UTILS_assert(status == BSP_SOK);
BspOsal_sleep(50);
break;
}
}
}
/*
*******************************************************************************
*
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* ALL RIGHTS RESERVED
*
*******************************************************************************
*/
/*******************************************************************************
* INCLUDE FILES
*******************************************************************************
*/
//#include <examples/tda2xx/include/chains.h>
#include <system_cfg.h>
#include <src/include/chains_common.h>
#include <ti/drv/vps/include/devices/bsp_device.h>
/**
* \brief Register address and value pair, with delay.
*/
typedef struct
{
UInt8 nRegAddr;
/**< Register Address */
UInt8 nRegValue;
/**< Slave Address */
UInt32 nDelay;
/**< Delay to be applied, after the register is programmed */
} BspUtils_Ub95xI2cParams;
static BspUtils_Ub95xI2cParams g954Cfg[] =
{
{0x33, 0x01, 0x0},
{0xB0, 0x00, 0x0},
{0xB1, 0x01, 0x0},
{0xB2, 0x01, 0x0},
{0xB1, 0x02, 0x0},
{0xB2, 0x33, 0x0},
{0xB1, 0x03, 0x0},
{0xB2, 0x24, 0x0},
{0xB1, 0x04, 0x0},
{0xB2, 0x0F, 0x0},
{0xB1, 0x05, 0x0},
{0xB2, 0x00, 0x0},
{0xB1, 0x06, 0x0},
{0xB2, 0x01, 0x0},
{0xB1, 0x07, 0x0},
{0xB2, 0xE0, 0x0},
{0xB1, 0x08, 0x0},
{0xB2, 0x02, 0x0},
{0xB1, 0x09, 0x0},
{0xB2, 0xD0, 0x0},
{0xB1, 0x0A, 0x0},
{0xB2, 0x04, 0x0},
{0xB1, 0x0B, 0x0},
{0xB2, 0x1A, 0x0},
{0xB1, 0x0C, 0x0},
{0xB2, 0x0C, 0x0},
{0xB1, 0x0D, 0x0},
{0xB2, 0x67, 0x0},
{0xB1, 0x0E, 0x0},
{0xB2, 0x21, 0x0},
{0xB1, 0x0F, 0x0},
{0xB2, 0x0A, 0x0},
};
void configDeser(void)
{
Int32 retVal;
Int32 idx;
Int32 errCount = 0;
for (idx = 0; idx < sizeof(g954Cfg) / sizeof(g954Cfg[0]); idx++)
{
retVal = Bsp_deviceWrite8(BSP_DEVICE_I2C_INST_ID_1,
0x30,
&(g954Cfg[idx].nRegAddr),
&(g954Cfg[idx].nRegValue),
(UInt32) 1U);
if (retVal != BSP_SOK)
{
errCount++;
Vps_printf("Error...\n");
}
}
if (errCount == 0)
{
Vps_printf("Deser configuration OK!\n");
}
}
