|
手上有一个从天嵌买的ov9650摄像头,天嵌也提供驱动了,程序可以调用的驱动函数如下:
CIS_Close
CIS_Deinit
CIS_Init
CIS_IOControl
CIS_Open
CIS_PowerDown
CIS_PowerUp
CIS_Read
CIS_Seek
CIS_Write
但是,看了下驱动源代码,这几个函数的实现如下:
DWORD CIS_Open(DWORD hDeviceContext, DWORD AccessCode, DWORD ShareMode)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_Open\r\n")));
RETAILMSG(1,(TEXT("CAMERA: CIS_Open---------\r\n")));
RETAILMSG(1,(TEXT("CAMERA: CIS_Open----------\r\n")));
RETAILMSG(1,(TEXT("CAMERA: CIS_Open-----------\r\n")));
DRIVER_PREVIEW_ENABLE = 2;
return TRUE;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
BOOL CIS_Close(DWORD hOpenContext)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_Close\r\n")));
return TRUE;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CIS_PowerDown(DWORD hDeviceContext)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_PowerDown\r\n")));
m_Dx = (_CEDEVICE_POWER_STATE)D4;
Camif_Capture(CAPTURE_OFF, CAPTURE_OFF);
CamClockOn(FALSE);
//RETAILMSG(1,(TEXT("CAMERA: CIS_PowerDown, m_Dx = D%u, init %d \r\n"), m_Dx, mInitialized));
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CIS_PowerUp(DWORD hDeviceContext)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_PowerUp\r\n")));
m_Dx = (_CEDEVICE_POWER_STATE)D0;
//
// 1. Camera IO setup
//
CamGpioInit();
//
// 2. Camera Clock setup
//
CamClockOn(TRUE);
// 3. Camera i/f reset
CAM_IF_Reset();
if (image_size == 1)
CamInit(QCIF_XSIZE, QCIF_YSIZE, QCIF_XSIZE, QCIF_YSIZE, 112, 20, COPIFRAMEBUFFER_B, COPIFRAMEBUFFER_A);
else if (image_size == 2)
CamInit(CIF_XSIZE, CIF_YSIZE, QCIF_XSIZE, QCIF_YSIZE, 112, 20, COPIFRAMEBUFFER_B, COPIFRAMEBUFFER_A);
RETAILMSG(1,(TEXT("CAMERA: CIS_PowerUp, m_Dx = D%u\r\n"), m_Dx));
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
DWORD CIS_Read(DWORD hOpenContext, LPVOID pBuffer, DWORD Count)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_Read\r\n")));
return TRUE;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
DWORD CIS_Seek(DWORD hOpenContext, long Amount, DWORD Type)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_Seek\r\n")));
return 0;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
DWORD CIS_Write(DWORD hOpenContext, LPCVOID pSourceBytes, DWORD NumberOfBytes)
{
RETAILMSG(1,(TEXT("CAMERA: CIS_Write\r\n")));
return 0;
}
这几个函数实际根本没对camera做实际操作,不知道大家用过ov9650吗,能不能给提供点资料
|
|