Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

The Keith&Koep Seco camera driver has a custom interface to get pictures and control camera features.
It consists of a camera-specific and a common part.

Registry Settings

Camera-timings are configured through the registry.

Code Block
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Camera]
   "Dll"="camera.dll"                ; common camera.dll
   "Prefix"="CXM"                    ; together with Index,
   "Index"=dword:1                   ; specifies to create driver at CXM1:
   "Order"=dword:2
   "FriendlyName"="Camera Driver"
!-- For the older camera driver (pre 02.07.2009) the registry settings
!-- for a camera are here:
   "Control0"=dword:900003f9         ; see PXA-Developers-Manual for details
   "Control1"=dword:013f8112         ; on Control0 to Control4.
   "Control2"=dword:fa000000
   "Control3"=dword:0e0001df
   "Control4"=dword:00b80001
   "Timeout"=dword:007BFA48	     ; 5s
   "CameraDLL"="ov7660.dll"          ; custom camera-specific DLL.
!-- For new camera drivers, each camera has its own sub-key.
!-- Which camera will be used is determined by the "Name"-key:
   "Name"="ov7660"                   ; Name of the camera.
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Camera\OV7660]
   "Control1"=dword:013f8112         ; on Control0 to Control4.
   "Control2"=dword:fa000000
   "Control3"=dword:0e0001df
   "Control4"=dword:00b80001
   "Timeout"=dword:007BFA48	     ; 5s
   "CameraDLL"="ov7660.dll"          ; custom camera-specific DLL.

The Custom/Camera-Specific Part

The custom camera DLL needs to export following functions:

  • int InitCamera( void)

  • BOOL IoctlCamera( DWORD dwCode, PVOID pBufIn, DWORD dwLenIn, PDWORD pdwBufOut, DWORD dwLenOut, PDWORD pdwActualOut)

  • int DeInitCamera( void)

InitCamera

This function gets called on the CreateFile(…)-call of the application.

DeInitCamera

This function gets called on the CloseHandle(…)-call of the application.

IoctlCamera

This function gets called on every DeviceIoControl(…)-call to the camera-driver.
If this function returns TRUE, it indicates that this ioctl-call is handled by the custom-driver.
If it returns FALSE it indicates, that the common-camera-driver should do additional action. i.e. when using IOCTL_SET_CAMERA_FEATURE with CAM_RESOLUTION you would typically set some registers in the camera and return FALSE, so the common driver adjust the resolution of the quick-capture-interface of the processor.

Application

The application should open the camera-driver with a call to:

...

Where g_pFrame is a pointer to a memory-region which should receive the captured data and FRAME_SIZE is the size of the memory-region reserved at g_pFrame.

Download

PXACamera sample with new Camera Driver. Direct preview within camera driver made for Trizeps IV IPAN7 with PAL color conversion. 50fps:

PXACamera sample application for Windows Embbedded CE6 (Trizeps IV & Trizeps V):

Sample of custom camera drivers: (Trizeps IV & Trizeps V)

Windows Embedded CE6-Image for Trizeps5 running on uConXS (Spark) and using Omnivision OV9655 camera: