Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

RTOS/AM5728: TI-RTOS: Use External Camera Sensor API to Drive AR0132

$
0
0

Part Number:AM5728

Tool/software: TI-RTOS

Hi

I used External Camera Sensor API to drive ar0132 at TI-RTOS project. But there were some wrong when debug into Fvid2_create function, the whole initial function is pasted bellow:

int cr_vin2a_initial_bsp(Fvid2_Handle *fvid2handle)
{
// Typicall API calling sequence for video decoder in context of video capture application would be like below
//
// Fvid2_create() - create the sensor driver instance and take the sensor to standby
// IOCTL_BSP_VID_SENSOR_GET_CHIP_ID - check if device is active
// IOCTL_BSP_VID_SENSOR_GET_FEATURES - To get the sensor information and support
// IOCTL_BSP_VID_SENSOR_SET_CONFIG - setup the device for a particular mode
// Fvid2_start() - Start sensor
// Fvid2_stop() - Take sensor to standby
// Fvid2_delete() - delete sensor driver device
// Delete the capture driver
 int rtn =0;
 Fvid2_Handle fvid2Handle;
 Bsp_VidSensorCreateParams crtParams;
 Bsp_VidSensorConfigRegs crtParamsCfgReg;
 Bsp_VidSensorCreateStatus crtStatus;
 Bsp_VidSensorChipIdParams chipidParams;
 Bsp_VidSensorChipIdStatus chipidStatus;
 Bsp_VidSensorFeatures features;
 Bsp_VidSensorConfigParams cfgParams;

 crtParams.deviceI2cAddr[0] = 0x10;
 crtParams.deviceI2cInstId = 4;//IC5
 crtParams.deviceResetGpio[0] = BSP_VID_SENSOR_GPIO_NONE;
 crtParams.numDevicesAtPort = 1;
 crtParams.numSensorCfg = 1;
 crtParams.sensorCfg = &crtParamsCfgReg;
 crtParamsCfgReg.regAddr = 0x3140;
 crtParamsCfgReg.regMask = 0xFFFF;
 crtParamsCfgReg.regValue = 0x0001;
 chipidStatus.chipId = 0;
 chipidStatus.chipRevision = 0;
 chipidStatus.firmwareVersion = 0;
 fvid2Handle = Fvid2_create( FVID2_VID_SENSOR_APT_AR0132_DRV,
 0,
 &crtParams,
 &crtStatus,
 NULL);
 fvid2handle = &fvid2Handle;
 chipidParams.deviceNum = 1;
 Fvid2_control( fvid2Handle,
 IOCTL_BSP_VID_SENSOR_GET_CHIP_ID,
 &chipidParams,
 &chipidStatus);
 Fvid2_control( fvid2Handle,
 IOCTL_BSP_VID_SENSOR_GET_FEATURES,
 &features,
 NULL);
 cfgParams.bpp = FVID2_BPP_BITS12;
 cfgParams.dataformat = FVID2_DF_RAW12;
 cfgParams.fps = FVID2_FPS_5;
 cfgParams.height = 720;
 cfgParams.width = 1280;
 cfgParams.standard = FVID2_STD_AUTO_DETECT;
 cfgParams.videoIfWidth = FVID2_VIFW_12BIT;
 Fvid2_control( fvid2Handle,
 IOCTL_BSP_VID_SENSOR_SET_CONFIG,
 &cfgParams,
 NULL);
 rtn = Fvid2_start(fvid2Handle,NULL);
 return rtn;
}

Could anyone help me to find the mistakes?
I know there are some examples in pdk,but it's pretty complex cause so many stream and channels are used in the example. But I just want to drive only AR0132(mono mode) in my project.

Viewing all articles
Browse latest Browse all 17527

Trending Articles