Download Spectrum ONE - CCD-2000 Manual

Transcript
Programming with Windows DLL
APPENDIX G: PROGRAMMING WITH THE WINDOWS DLL
INTRODUCTION
This document outlines the use and implementation of the ISA Spectrum One CCD driver for
Windows. The section “Using the Driver” describes obtaining and using a device handle. The
section “Source” provides documentation for the source code. Additional source documentation
may be found in the CCDSRC help file provided with the source.
This driver provides all the functionality needed to setup acquisition and retrieve images from the
camera. Some of the supported setup parameters include exposure time, flush count, double
correlation integration time, active CCD surface regions, and temperature.
The driver supports the standard I/O controller board, the DMA I/O controller board (both polled
and interrupt-driven), and hardware emulation. The ICcd interface provides a consistent
presentation of the device no matter which of the aforementioned forms the device takes.
USING THE DRIVER
The abstract device interface handle is the only means by which the application can communicate
with a device. This “magic cookie” is created by one of the driver’s object creation functions
CcdCreateDevice or CcdCreateEmulatorXXX. This handle is defined in C++ as a pointer to the
abstract base class. This mechanism enforces interaction with the device without any knowledge
of the particular object’s interface implementation. No mechanism is provided which allows direct
access to any of the data of the object that implements the interface. Note that for efficiency,
direct access is allowed to the region buffers. See the Microsoft OLE 2 documentation in the
Windows SDK for more information on OLE interfaces and the Component Object Model (COM).
Note: It is strongly recommended that API version 1.1 or higher is used.
Obtaining a device interface handle
There are four distinct implementations (i.e., classes) of the ICcd interface currently provided by
the driver. They are the following:
• Emulator
• Standard I/O
• DMA I/O (polled)
• DMA I/O (interrupt-driven)
These may be broadly divided into two groups: hardware and emulated. The hardware devices
provide ICcd implemented on hardware. The emulator devices implement ICcd in software.
STDAPI CcdCreateDevice(HCCDI *phccdi)
STDAPI CcdCreateEmulatorFromFile(LPCSTR lpszPath, HCCDI *phccdi)
125