diff options
author | iximeow <me@iximeow.net> | 2019-03-14 15:52:30 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2019-03-14 15:52:30 -0700 |
commit | fa1bb24f1f8aaf8e598a3bc53d90922e445fe59a (patch) | |
tree | c5f65b4cecd6376a3b99646679f9714d5f9213a2 | |
parent | 051a2e73d031475e08e37953007fbb7869515fb6 (diff) |
add qhy headers.........
149 files changed, 30503 insertions, 0 deletions
diff --git a/include/qhy/Context.h b/include/qhy/Context.h new file mode 100644 index 0000000..ab2c490 --- /dev/null +++ b/include/qhy/Context.h @@ -0,0 +1,57 @@ +#pragma once
+
+#define QCAM_RAWDATACACHESIZE (75000000)
+#define QCAM_FRAMECACHESIZE 1
+#define QCAM_MAXCORECOUNT 16
+
+class Mutex
+{
+private:
+ CRITICAL_SECTION cs;
+
+public:
+ Mutex()
+ {
+ ::InitializeCriticalSection(&this->cs);
+ }
+
+ ~Mutex()
+ {
+ ::DeleteCriticalSection(&this->cs);
+ }
+
+ void Lock()
+ {
+ ::EnterCriticalSection(&this->cs);
+ }
+
+ void Unlock()
+ {
+ ::LeaveCriticalSection(&this->cs);
+ }
+};
+
+class CamContext
+{
+public:
+ unsigned char ioType;
+ HANDLE hCam;
+ int camType;
+ int resX, resY;
+ int frameLen;
+ unsigned char depth;
+
+ BOOL live;
+ unsigned char *rawDataCache;
+ HANDLE hIoThread;
+ BOOL raw;
+
+ CamContext()
+ {
+ this->hCam = INVALID_HANDLE_VALUE;
+ }
+
+};
+
+void InitContext(int framesize,CCyUSBDevice* pDev);
+CamContext* GetContext(HANDLE hCam);
diff --git a/include/qhy/CyAPI.h b/include/qhy/CyAPI.h new file mode 100644 index 0000000..2ec4f77 --- /dev/null +++ b/include/qhy/CyAPI.h @@ -0,0 +1,600 @@ +/*
+ ## Cypress CyAPI C++ library header file (CyAPI.h)
+ ## =======================================================
+ ##
+ ## Copyright Cypress Semiconductor Corporation, 2009-2012,
+ ## All Rights Reserved
+ ## UNPUBLISHED, LICENSED SOFTWARE.
+ ##
+ ## CONFIDENTIAL AND PROPRIETARY INFORMATION
+ ## WHICH IS THE PROPERTY OF CYPRESS.
+ ##
+ ## Use of this file is governed
+ ## by the license agreement included in the file
+ ##
+ ## <install>/license/license.rtf
+ ##
+ ## where <install> is the Cypress software
+ ## install root directory path.
+ ##
+ ## =======================================================
+*/
+
+#ifndef CyUSBH
+#define CyUSBH
+
+#include "cyusb30_def.h"
+
+/* Data straucture for the Vendor request and data */
+typedef struct vendorCmdData
+{
+ UCHAR *buf; /* Pointer to the data */
+ UCHAR opCode; /* Vendor request code */
+ UINT addr; /* Read/Write address */
+ long size; /* Size of the read/write */
+ bool isRead; /* Read or write */
+} vendorCmdData ;
+
+#ifndef __USB200_H__
+#define __USB200_H__
+#pragma pack(push,1)
+typedef struct _USB_DEVICE_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ USHORT bcdUSB;
+ UCHAR bDeviceClass;
+ UCHAR bDeviceSubClass;
+ UCHAR bDeviceProtocol;
+ UCHAR bMaxPacketSize0;
+ USHORT idVendor;
+ USHORT idProduct;
+ USHORT bcdDevice;
+ UCHAR iManufacturer;
+ UCHAR iProduct;
+ UCHAR iSerialNumber;
+ UCHAR bNumConfigurations;
+} USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR;
+
+typedef struct _USB_ENDPOINT_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bEndpointAddress;
+ UCHAR bmAttributes;
+ USHORT wMaxPacketSize;
+ UCHAR bInterval;
+} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR;
+
+typedef struct _USB_CONFIGURATION_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ USHORT wTotalLength;
+ UCHAR bNumInterfaces;
+ UCHAR bConfigurationValue;
+ UCHAR iConfiguration;
+ UCHAR bmAttributes;
+ UCHAR MaxPower;
+} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR;
+
+typedef struct _USB_INTERFACE_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bInterfaceNumber;
+ UCHAR bAlternateSetting;
+ UCHAR bNumEndpoints;
+ UCHAR bInterfaceClass;
+ UCHAR bInterfaceSubClass;
+ UCHAR bInterfaceProtocol;
+ UCHAR iInterface;
+} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR;
+
+typedef struct _USB_STRING_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ WCHAR bString[1];
+} USB_STRING_DESCRIPTOR, *PUSB_STRING_DESCRIPTOR;
+
+typedef struct _USB_COMMON_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+} USB_COMMON_DESCRIPTOR, *PUSB_COMMON_DESCRIPTOR;
+#pragma pack(pop)
+#endif
+
+/*******************************************************************************/
+class CCyIsoPktInfo {
+public:
+ LONG Status;
+ LONG Length;
+};
+
+/*******************************************************************************/
+
+
+/* {AE18AA60-7F6A-11d4-97DD-00010229B959} */
+static GUID CYUSBDRV_GUID = {0xae18aa60, 0x7f6a, 0x11d4, 0x97, 0xdd, 0x0, 0x1, 0x2, 0x29, 0xb9, 0x59};
+
+typedef enum {TGT_DEVICE, TGT_INTFC, TGT_ENDPT, TGT_OTHER } CTL_XFER_TGT_TYPE;
+typedef enum {REQ_STD, REQ_CLASS, REQ_VENDOR } CTL_XFER_REQ_TYPE;
+typedef enum {DIR_TO_DEVICE, DIR_FROM_DEVICE } CTL_XFER_DIR_TYPE;
+typedef enum {XMODE_BUFFERED, XMODE_DIRECT } XFER_MODE_TYPE;
+
+const int MAX_ENDPTS = 32;
+const int MAX_INTERFACES = 255;
+const int USB_STRING_MAXLEN = 256;
+
+#define BUFSIZE_UPORT 2048 //4096 - CDT 130492
+typedef enum { RAM = 1, I2CE2PROM, SPIFLASH } FX3_FWDWNLOAD_MEDIA_TYPE ;
+typedef enum { SUCCESS = 0, FAILED, INVALID_MEDIA_TYPE, INVALID_FWSIGNATURE, DEVICE_CREATE_FAILED, INCORRECT_IMAGE_LENGTH, INVALID_FILE, SPILASH_ERASE_FAILED, CORRUPT_FIRMWARE_IMAGE_FILE,I2CE2PROM_UNKNOWN_I2C_SIZE } FX3_FWDWNLOAD_ERROR_CODE;
+
+#define CYWB_BL_4_BYTES_COPY(destination,source) {memcpy((void *)(destination), (void *)(source), 4);}
+
+/********************************************************************************
+*
+* The CCyEndPoint ABSTRACT Class
+*
+********************************************************************************/
+class CCyUSBEndPoint
+{
+protected:
+ bool WaitForIO(OVERLAPPED *ovLapStatus);
+
+ virtual PUCHAR BeginDirectXfer(PUCHAR buf, LONG bufLen, OVERLAPPED *ov);
+ virtual PUCHAR BeginBufferedXfer(PUCHAR buf, LONG bufLen, OVERLAPPED *ov);
+
+public:
+
+ CCyUSBEndPoint(void);
+ CCyUSBEndPoint(CCyUSBEndPoint& ept);
+ CCyUSBEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor);
+ CCyUSBEndPoint(HANDLE hDev, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor,USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor);
+
+ HANDLE hDevice;
+
+ /* The fields of an EndPoint Descriptor */
+ UCHAR DscLen;
+ UCHAR DscType;
+ UCHAR Address;
+ UCHAR Attributes;
+ USHORT MaxPktSize;
+ USHORT PktsPerFrame;
+ UCHAR Interval;
+ /* This are the fields for Super speed endpoint */
+ UCHAR ssdscLen;
+ UCHAR ssdscType;
+ UCHAR ssmaxburst; /* Maximum number of packets endpoint can send in one burst */
+ UCHAR ssbmAttribute; /* store endpoint attribute like for bulk it will be number of streams */
+ USHORT ssbytesperinterval;
+
+ /* Other fields */
+ ULONG TimeOut;
+ ULONG UsbdStatus;
+ ULONG NtStatus;
+
+ DWORD bytesWritten;
+ DWORD LastError;
+ bool bIn;
+
+ XFER_MODE_TYPE XferMode;
+
+ bool XferData(PUCHAR buf, LONG &len, CCyIsoPktInfo* pktInfos = NULL);
+ bool XferData(PUCHAR buf, LONG &bufLen, CCyIsoPktInfo* pktInfos, bool pktMode);
+ virtual PUCHAR BeginDataXfer(PUCHAR buf, LONG len, OVERLAPPED *ov) = 0;
+ virtual bool FinishDataXfer(PUCHAR buf, LONG &len, OVERLAPPED *ov, PUCHAR pXmitBuf, CCyIsoPktInfo* pktInfos = NULL);
+ bool WaitForXfer(OVERLAPPED *ov, ULONG tOut);
+ ULONG GetXferSize(void);
+ void SetXferSize(ULONG xfer);
+
+ bool Reset(void);
+ bool Abort(void);
+};
+
+
+/********************************************************************************
+*
+* The Control Endpoint Class
+*
+********************************************************************************/
+class CCyControlEndPoint : public CCyUSBEndPoint
+{
+public:
+ CCyControlEndPoint(void);
+ CCyControlEndPoint(CCyControlEndPoint& ept);
+ CCyControlEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor);
+
+ CTL_XFER_TGT_TYPE Target;
+ CTL_XFER_REQ_TYPE ReqType;
+ CTL_XFER_DIR_TYPE Direction;
+
+ UCHAR ReqCode;
+ WORD Value;
+ WORD Index;
+
+ bool Read(PUCHAR buf, LONG &len);
+ bool Write(PUCHAR buf, LONG &len);
+ PUCHAR BeginDataXfer(PUCHAR buf, LONG len, OVERLAPPED *ov);
+};
+
+
+/********************************************************************************
+*
+* The Isoc Endpoint Class
+*
+********************************************************************************/
+class CCyIsocEndPoint : public CCyUSBEndPoint
+{
+
+protected:
+ virtual PUCHAR BeginDirectXfer(PUCHAR buf, LONG bufLen, OVERLAPPED *ov);
+ virtual PUCHAR BeginBufferedXfer(PUCHAR buf, LONG bufLen, OVERLAPPED *ov);
+
+public:
+ CCyIsocEndPoint(void);
+ CCyIsocEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor);
+ CCyIsocEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor,USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor);
+
+ PUCHAR BeginDataXfer(PUCHAR buf, LONG len, OVERLAPPED *ov);
+ CCyIsoPktInfo* CreatePktInfos(LONG bufLen, int &packets);
+};
+
+
+/********************************************************************************
+*
+* The Bulk Endpoint Class
+*
+********************************************************************************/
+class CCyBulkEndPoint : public CCyUSBEndPoint
+{
+public:
+ CCyBulkEndPoint(void);
+ CCyBulkEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor);
+ CCyBulkEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor,USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor);
+
+ PUCHAR BeginDataXfer(PUCHAR buf, LONG len, OVERLAPPED *ov);
+};
+
+
+/********************************************************************************
+*
+* The Interrupt Endpoint Class
+*
+********************************************************************************/
+class CCyInterruptEndPoint : public CCyUSBEndPoint
+{
+public:
+ CCyInterruptEndPoint(void);
+ CCyInterruptEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor);
+ CCyInterruptEndPoint(HANDLE h, PUSB_ENDPOINT_DESCRIPTOR pEndPtDescriptor,USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor);
+
+ PUCHAR BeginDataXfer(PUCHAR buf, LONG len, OVERLAPPED *ov);
+};
+
+
+/********************************************************************************
+*
+* The Interface Class
+*
+********************************************************************************/
+class CCyUSBInterface
+{
+public:
+ CCyUSBEndPoint *EndPoints[MAX_ENDPTS]; /* Holds pointers to all the interface's endpoints,
+ plus a pointer to the Control endpoint zero */
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bInterfaceNumber;
+ UCHAR bAlternateSetting;
+ UCHAR bNumEndpoints; /* Not counting the control endpoint */
+ UCHAR bInterfaceClass;
+ UCHAR bInterfaceSubClass;
+ UCHAR bInterfaceProtocol;
+ UCHAR iInterface;
+
+ UCHAR bAltSettings;
+ USHORT wTotalLength; /* Needed in case Intfc has additional (non-endpt) descriptors */
+
+ CCyUSBInterface(HANDLE handle, PUSB_INTERFACE_DESCRIPTOR pIntfcDescriptor,UCHAR usb30Dummy);
+ CCyUSBInterface(HANDLE h, PUSB_INTERFACE_DESCRIPTOR pIntfcDescriptor);
+ CCyUSBInterface(CCyUSBInterface& ifc); /* Copy Constructor */
+ ~CCyUSBInterface(void);
+
+};
+
+
+/********************************************************************************
+*
+* The Config Class
+*
+********************************************************************************/
+class CCyUSBConfig
+{
+public:
+ CCyUSBInterface *Interfaces[MAX_INTERFACES];
+
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ USHORT wTotalLength;
+ UCHAR bNumInterfaces;
+ UCHAR bConfigurationValue;
+ UCHAR iConfiguration;
+ UCHAR bmAttributes;
+ UCHAR MaxPower;
+
+ UCHAR AltInterfaces;
+
+ CCyUSBConfig(void);
+ CCyUSBConfig(CCyUSBConfig& cfg); /* Copy Constructor */
+ CCyUSBConfig(HANDLE h, PUSB_CONFIGURATION_DESCRIPTOR pConfigDescr);
+ CCyUSBConfig(HANDLE h, PUSB_CONFIGURATION_DESCRIPTOR pConfigDescr,UCHAR usb30Dummy);
+ ~CCyUSBConfig(void);
+};
+
+
+/********************************************************************************
+*
+* The Bos USB20 Extesnion Class
+*
+********************************************************************************/
+class CCyBosUSB20Extesnion
+{
+public:
+ UCHAR bLength; /* Descriptor length */
+ UCHAR bDescriptorType; /* Descriptor Type */
+ UCHAR bDevCapabilityType; /* Device capability type */
+ UINT bmAttribute; /* Bitmap encoding for supprted feature and Link power managment supprted if set */
+
+ CCyBosUSB20Extesnion(void);
+ CCyBosUSB20Extesnion(HANDLE h,PUSB_BOS_USB20_DEVICE_EXTENSION BosUsb20ExtDesc);
+};
+
+
+/********************************************************************************
+*
+* The Bos SuperSpeed Capability Class
+*
+********************************************************************************/
+class CCyBosSuperSpeedCapability
+{
+public:
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bDevCapabilityType;
+ UCHAR bmAttribute;
+ USHORT SpeedsSuported;
+ UCHAR bFunctionalitySupporte;
+ UCHAR bU1DevExitLat;
+ USHORT bU2DevExitLat;
+
+ CCyBosSuperSpeedCapability(void);
+ CCyBosSuperSpeedCapability(HANDLE h,PUSB_BOS_SS_DEVICE_CAPABILITY pUSB_SuperSpeedUsb);
+
+};
+
+
+/********************************************************************************
+*
+* The Bos Container ID Class
+*
+********************************************************************************/
+class CCyBosContainerID
+{
+public:
+ UCHAR bLength; /* Descriptor length */
+ UCHAR bDescriptorType; /* Descriptor Type */
+ UCHAR bDevCapabilityType; /* Device capability type */
+ UCHAR bReserved; /* no use */
+ UCHAR ContainerID[USB_BOS_CAPABILITY_TYPE_CONTAINER_ID_SIZE]; /* UUID */
+
+ CCyBosContainerID(void);
+ CCyBosContainerID(HANDLE h,PUSB_BOS_CONTAINER_ID pContainerID);
+};
+
+
+/********************************************************************************
+*
+* The USB BOS Class
+*
+********************************************************************************/
+class CCyUSBBOS
+{
+public:
+
+ CCyBosContainerID *pContainer_ID;
+ CCyBosUSB20Extesnion *pUSB20_DeviceExt;
+ CCyBosSuperSpeedCapability *pSS_DeviceCap;
+
+ UCHAR bLength; /* Descriptor length */
+ UCHAR bDescriptorType; /* Descriptor Type */
+ USHORT wTotalLength; /* Total length of descriptor ( icluding device capabilty */
+ UCHAR bNumDeviceCaps; /* Number of device capability descriptors in BOS */
+
+ CCyUSBBOS(void);
+ CCyUSBBOS(HANDLE h,PUSB_BOS_DESCRIPTOR pBosDescrData);
+ ~CCyUSBBOS();
+};
+
+/*********************************************************************************
+*
+* The USB Device Class - This is the main class that contains members of all the
+* other classes.
+*
+* To use the library, create an instance of this Class and call it's Open method.
+*
+*********************************************************************************/
+class CCyUSBDevice
+{
+ /* The public members are accessible (i.e. corruptible) by the user of the library
+ * Algorithms of the class don't rely on any public members. Instead, they use the
+ * private members of the class for their calculations. */
+
+public:
+
+ CCyUSBDevice(HANDLE hnd = NULL, GUID guid = CYUSBDRV_GUID, BOOL bOpen = true);
+ ~CCyUSBDevice(void);
+
+ CCyUSBEndPoint **EndPoints; /* Shortcut to USBCfgs[CfgNum]->Interfaces[IntfcIndex]->Endpoints */
+ CCyUSBEndPoint *EndPointOf(UCHAR addr);
+
+ CCyUSBBOS *UsbBos;
+ CCyIsocEndPoint *IsocInEndPt;
+ CCyIsocEndPoint *IsocOutEndPt;
+ CCyBulkEndPoint *BulkInEndPt;
+ CCyBulkEndPoint *BulkOutEndPt;
+ CCyControlEndPoint *ControlEndPt;
+ CCyInterruptEndPoint *InterruptInEndPt;
+ CCyInterruptEndPoint *InterruptOutEndPt;
+
+
+ USHORT StrLangID;
+ ULONG LastError;
+ ULONG UsbdStatus;
+ ULONG NtStatus;
+ ULONG DriverVersion;
+ ULONG USBDIVersion;
+ char DeviceName[USB_STRING_MAXLEN];
+ char FriendlyName[USB_STRING_MAXLEN];
+ wchar_t Manufacturer[USB_STRING_MAXLEN];
+ wchar_t Product[USB_STRING_MAXLEN];
+ wchar_t SerialNumber[USB_STRING_MAXLEN];
+
+ CHAR DevPath[USB_STRING_MAXLEN];
+
+ USHORT BcdUSB;
+ USHORT VendorID;
+ USHORT ProductID;
+ UCHAR USBAddress;
+ UCHAR DevClass;
+ UCHAR DevSubClass;
+ UCHAR DevProtocol;
+ INT MaxPacketSize;
+ USHORT BcdDevice;
+
+ UCHAR ConfigValue;
+ UCHAR ConfigAttrib;
+ UCHAR MaxPower;
+
+ UCHAR IntfcClass;
+ UCHAR IntfcSubClass;
+ UCHAR IntfcProtocol;
+ bool bHighSpeed;
+ bool bSuperSpeed;
+
+ DWORD BytesXfered;
+
+ UCHAR DeviceCount(void);
+ UCHAR ConfigCount(void);
+ UCHAR IntfcCount(void);
+ UCHAR AltIntfcCount(void);
+ UCHAR EndPointCount(void);
+
+ void SetConfig(UCHAR cfg);
+ UCHAR Config(void) { return CfgNum; } /* Normally 0 */
+ UCHAR Interface(void) { return IntfcNum; } /* Usually 0 */
+
+ /* No SetInterface method since only 1 intfc per device (per Windows) */
+ UCHAR AltIntfc(void);
+ bool SetAltIntfc(UCHAR alt);
+
+ GUID DriverGUID(void) { return DrvGuid; }
+ HANDLE DeviceHandle(void) { return hDevice; }
+ void UsbdStatusString(ULONG stat, PCHAR s);
+ bool CreateHandle(UCHAR dev);
+ void DestroyHandle();
+
+ bool Open(UCHAR dev);
+ void Close(void);
+ bool Reset(void);
+ bool ReConnect(void);
+ bool Suspend(void);
+ bool Resume(void);
+ bool IsOpen(void) { return (hDevice != INVALID_HANDLE_VALUE); }
+
+ UCHAR PowerState(void);
+
+ bool GetBosDescriptor(PUSB_BOS_DESCRIPTOR descr);
+ bool GetBosUSB20DeviceExtensionDescriptor(PUSB_BOS_USB20_DEVICE_EXTENSION descr);
+ bool GetBosContainedIDDescriptor(PUSB_BOS_CONTAINER_ID descr);
+ bool GetBosSSCapabilityDescriptor(PUSB_BOS_SS_DEVICE_CAPABILITY descr);
+
+ void GetDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR descr);
+ void GetConfigDescriptor(PUSB_CONFIGURATION_DESCRIPTOR descr);
+ void GetIntfcDescriptor(PUSB_INTERFACE_DESCRIPTOR descr);
+ CCyUSBConfig GetUSBConfig(int index);
+
+private:
+
+ USB_DEVICE_DESCRIPTOR USBDeviceDescriptor;
+ PUSB_CONFIGURATION_DESCRIPTOR USBConfigDescriptors[2];
+ PUSB_BOS_DESCRIPTOR pUsbBosDescriptor;
+
+ CCyUSBConfig *USBCfgs[2];
+
+ HANDLE hWnd;
+ HANDLE hDevice;
+ HANDLE hDevNotification;
+ HANDLE hHndNotification;
+
+ GUID DrvGuid;
+
+ UCHAR Devices;
+ UCHAR Interfaces;
+ UCHAR AltInterfaces;
+ UCHAR Configs;
+
+ UCHAR DevNum;
+ UCHAR CfgNum;
+ UCHAR IntfcNum; /* The current selected interface's bInterfaceNumber */
+ UCHAR IntfcIndex; /* The entry in the Config's interfaces table matching to IntfcNum and AltSetting */
+
+ bool GetInternalBosDescriptor();
+ void GetDevDescriptor(void);
+ void GetCfgDescriptor(int descIndex);
+ void GetString(wchar_t *s, UCHAR sIndex);
+ void SetStringDescrLanguage(void);
+ void SetAltIntfcParams(UCHAR alt);
+ bool IoControl(ULONG cmd, PUCHAR buf, ULONG len);
+
+ void SetEndPointPtrs(void);
+ void GetDeviceName(void);
+ void GetFriendlyName(void);
+ void GetDriverVer(void);
+ void GetUSBDIVer(void);
+ void GetSpeed(void);
+ void GetUSBAddress(void);
+ //void CloseEndPtHandles(void);
+
+ bool RegisterForPnpEvents(HANDLE h);
+};
+
+
+/********************************************************************************
+*
+* The FX3 Device Class
+*
+********************************************************************************/
+class CCyFX3Device: public CCyUSBDevice
+{
+public:
+ CCyFX3Device(void);
+ ~CCyFX3Device(void);
+ bool IsBootLoaderRunning();
+ FX3_FWDWNLOAD_ERROR_CODE DownloadFw(char *fileName, FX3_FWDWNLOAD_MEDIA_TYPE enMediaType);
+
+private:
+
+ bool Ep0VendorCommand(vendorCmdData cmdData);
+ bool SetProgramEntry(UCHAR opCode,UINT start_addr);
+
+ bool DownloadBufferToDevice(UINT start_addr, USHORT count, UCHAR *data_buf, UCHAR opCode);
+ bool UploadBufferFromDevice(UINT start_addr, USHORT count, UCHAR *data_buf, UCHAR opCode);
+
+ FX3_FWDWNLOAD_ERROR_CODE DownloadFwToRam(PUCHAR buffer_p, UINT fw_size, UCHAR opCode);
+ FX3_FWDWNLOAD_ERROR_CODE DownloadUserIMGtoI2CE2PROM(PUCHAR buffer_p, UINT fw_size, UCHAR opCode);
+ FX3_FWDWNLOAD_ERROR_CODE DownloadUserIMGtoSPIFLASH(PUCHAR buffer_p, UINT fw_size, UCHAR opCode);
+
+ FX3_FWDWNLOAD_ERROR_CODE EraseSectorOfSPIFlash(UINT SectorNumber, UCHAR opCode);
+ bool WriteToSPIFlash(PUCHAR Buf, UINT buflen, UINT ByteAddress, UCHAR opCode);
+};
+
+/********************************************************************************/
+
+#endif
\ No newline at end of file diff --git a/include/qhy/CyUSB30_def.h b/include/qhy/CyUSB30_def.h new file mode 100644 index 0000000..4d2bfb3 --- /dev/null +++ b/include/qhy/CyUSB30_def.h @@ -0,0 +1,90 @@ +/*
+ ## Cypress CyAPI C++ library USB3.0 defination header file (CyUSB30_def.h)
+ ## =======================================================
+ ##
+ ## Copyright Cypress Semiconductor Corporation, 2009-2012,
+ ## All Rights Reserved
+ ## UNPUBLISHED, LICENSED SOFTWARE.
+ ##
+ ## CONFIDENTIAL AND PROPRIETARY INFORMATION
+ ## WHICH IS THE PROPERTY OF CYPRESS.
+ ##
+ ## Use of this file is governed
+ ## by the license agreement included in the file
+ ##
+ ## <install>/license/license.rtf
+ ##
+ ## where <install> is the Cypress software
+ ## install root directory path.
+ ##
+ ## =======================================================
+*/
+#ifndef _CYUSB30_H
+#define _CYUSB30_H
+
+//#pragma pack(1)
+#pragma pack(push, 1)
+// USB3.0 specific constant defination
+#define BCDUSBJJMASK 0xFF00 //(0xJJMN JJ - Major version,M Minor version, N sub-minor vesion)
+#define USB30MAJORVER 0x0300
+#define USB20MAJORVER 0x0200
+
+#define USB_BOS_DESCRIPTOR_TYPE 0x0F
+#define USB_DEVICE_CAPABILITY 0x10
+#define USB_SUPERSPEED_ENDPOINT_COMPANION 0x30
+#define USB_BOS_CAPABILITY_TYPE_Wireless_USB 0x01
+#define USB_BOS_CAPABILITY_TYPE_USB20_EXT 0x02
+#define USB_BOS_CAPABILITY_TYPE_SUPERSPEED_USB 0x03
+#define USB_BOS_CAPABILITY_TYPE_CONTAINER_ID 0x04
+#define USB_BOS_CAPABILITY_TYPE_CONTAINER_ID_SIZE 0x10
+
+#define USB_BOS_DEVICE_CAPABILITY_TYPE_INDEX 0x2
+//constant defination
+typedef struct _USB_BOS_DESCRIPTOR
+{
+ UCHAR bLength;/* Descriptor length*/
+ UCHAR bDescriptorType;/* Descriptor Type */
+ USHORT wTotalLength;/* Total length of descriptor ( icluding device capability*/
+ UCHAR bNumDeviceCaps;/* Number of device capability descriptors in BOS */
+}USB_BOS_DESCRIPTOR,*PUSB_BOS_DESCRIPTOR;
+
+typedef struct _USB_BOS_USB20_DEVICE_EXTENSION
+{
+ UCHAR bLength;/* Descriptor length*/
+ UCHAR bDescriptorType;/* Descriptor Type */
+ UCHAR bDevCapabilityType;/* Device capability type*/
+ UINT bmAttribute;// Bitmap encoding for supprted feature and Link power managment supprted if set
+}USB_BOS_USB20_DEVICE_EXTENSION,*PUSB_BOS_USB20_DEVICE_EXTENSION;
+
+typedef struct _USB_BOS_SS_DEVICE_CAPABILITY
+{
+ UCHAR bLength;/* Descriptor length*/
+ UCHAR bDescriptorType;/* Descriptor Type */
+ UCHAR bDevCapabilityType;/* Device capability type*/
+ UCHAR bmAttribute;// Bitmap encoding for supprted feature and Link power managment supprted if set
+ USHORT wSpeedsSuported;//low speed supported if set,full speed supported if set,high speed supported if set,super speed supported if set,15:4 nt used
+ UCHAR bFunctionalitySupporte;
+ UCHAR bU1DevExitLat;//U1 device exit latency
+ USHORT bU2DevExitLat;//U2 device exit latency
+}USB_BOS_SS_DEVICE_CAPABILITY,*PUSB_BOS_SS_DEVICE_CAPABILITY;
+
+typedef struct _USB_BOS_CONTAINER_ID
+{
+ UCHAR bLength;/* Descriptor length*/
+ UCHAR bDescriptorType;/* Descriptor Type */
+ UCHAR bDevCapabilityType;/* Device capability type*/
+ UCHAR bReserved; // no use
+ UCHAR ContainerID[USB_BOS_CAPABILITY_TYPE_CONTAINER_ID_SIZE];/* UUID */
+}USB_BOS_CONTAINER_ID,*PUSB_BOS_CONTAINER_ID;
+
+typedef struct _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR
+{
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bMaxBurst;
+ UCHAR bmAttributes;
+ USHORT bBytesPerInterval;
+}USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR,*PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR;
+#pragma pack(pop)
+#endif /*_CYUSB30_H*/
+
diff --git a/include/qhy/Io.h b/include/qhy/Io.h new file mode 100644 index 0000000..9cf1f3d --- /dev/null +++ b/include/qhy/Io.h @@ -0,0 +1,38 @@ +#ifdef WIN32
+
+#pragma once
+
+#include "CyAPI.h"
+#include "stdint.h"
+
+class CamContext;
+
+void EnumCam(CamContext* contextList,CCyUSBDevice *pDev);
+uint32_t __stdcall IoThread(void* pParams);
+uint32_t __stdcall DbgIoThread(void* pParams);
+BOOL I2CRead(HANDLE hCam, uint16_t index, uint16_t* pValue);
+BOOL I2CCacheRead(HANDLE hCam, uint16_t index, uint16_t* pValue);
+BOOL I2CWrite(HANDLE hCam, uint16_t index, uint16_t value);
+BOOL I2CBatchRead(HANDLE hCam, uint16_t index, uint8_t* data, uint16_t len);
+BOOL I2CCacheBatchRead(HANDLE hCam, uint16_t index, uint8_t* data, uint16_t len);
+BOOL I2CBatchWrite(HANDLE hCam, uint16_t index, uint8_t* data, uint16_t len);
+BOOL I2CBatchWriteEx(HANDLE hCam, uint8_t i2caddr,uint8_t* data, uint16_t len);
+uint16_t GetFirmwareVersion(HANDLE hCam);
+BOOL EepromRead(HANDLE hCam, uint8_t index, uint8_t* data, uint16_t len);
+BOOL EepromWrite(HANDLE hCam, uint8_t index, uint8_t* data, uint16_t len);
+BOOL SetMode(HANDLE hCam);
+BOOL SetBin(HANDLE hCam);
+BOOL SetSubframe(HANDLE hCam);
+BOOL SetDepth(HANDLE hCam);
+BOOL SetTransferSpeed(HANDLE hCam);
+BOOL SetExposeTime(HANDLE hCam);
+BOOL SetGain(HANDLE hCam);
+BOOL BeginTransfer(HANDLE hCam);
+void StopTransfer(HANDLE hCam);
+void AbortTransfer(HANDLE hCam);
+BOOL SetHBlanking(HANDLE hCam);
+BOOL SetHighGainBoost(HANDLE hCam);
+BOOL SetFinetune(HANDLE hCam);
+BOOL GetSingleFrame(HANDLE hCam,uint8_t *data,uint32_t len,uint32_t duration);
+
+#endif
\ No newline at end of file diff --git a/include/qhy/Pipeline.h b/include/qhy/Pipeline.h new file mode 100644 index 0000000..f7b559e --- /dev/null +++ b/include/qhy/Pipeline.h @@ -0,0 +1,3 @@ +#pragma once
+
+uint32_t __stdcall PipelineThread(void* pParams);
diff --git a/include/qhy/QDef.h b/include/qhy/QDef.h new file mode 100644 index 0000000..72c318e --- /dev/null +++ b/include/qhy/QDef.h @@ -0,0 +1,106 @@ +//// QDef.h
+
+#ifndef _QDEF_H_
+#define _QDEF_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define QCAM_MAXCAMERACOUNT 16
+
+#define QCAM_IOTYPE_USB 10
+#define QCAM_IOTYPE_ETHERNET 20
+
+#define QCAM_CAMTYPE_UNKNOWN -1
+
+//QHYCCD A series and QHY27/28/29
+#define QCAM_CAMTYPE_QHY16200A 200
+#define QCAM_CAMTYPE_IC8300 201
+#define QCAM_CAMTYPE_QHY90A 202
+#define QCAM_CAMTYPE_QHY29 203
+#define QCAM_CAMTYPE_QHY28 204
+#define QCAM_CAMTYPE_QHY814A 205
+#define QCAM_CAMTYPE_QHY16803A 206
+#define QCAM_CAMTYPE_QHY27 207
+#define QCAM_CAMTYPE_QHY09000A 208
+#define QCAM_CAMTYPE_QHY695A 299
+
+#define QCAM_CAMTYPE_QHY5II 350
+#define QCAM_CAMTYPE_QHY5TII 351
+#define QCAM_CAMTYPE_QHY5VII 352
+#define QCAM_CAMTYPE_QHY5UII 353
+#define QCAM_CAMTYPE_QHY5PII_M 354
+#define QCAM_CAMTYPE_QHY5LII_M 355
+#define QCAM_CAMTYPE_QHY5XII 356
+#define QCAM_CAMTYPE_QHY5FII 357
+#define QCAM_CAMTYPE_QHY5HII 358
+#define QCAM_CAMTYPE_MINICAM5S_M 359
+#define QCAM_CAMTYPE_MINICAM5S_C 360
+#define QCAM_CAMTYPE_QHY16000 361
+#define QCAM_CAMTYPE_MINICAM5F_M 362
+#define QCAM_CAMTYPE_MINICAM5F_C 363
+#define QCAM_CAMTYPE_QHY5 364
+#define QCAM_CAMTYPE_QHY5LII_C 365
+#define QCAM_CAMTYPE_QHY5PII_C 366
+#define QCAM_CAMTYPE_QHY5RII 400
+#define QCAM_CAMTYPE_PLUTO285 520
+#define QCAM_CAMTYPE_URANUS285 620
+#define QCAM_CAMTYPE_URANUS694 660
+#define QCAM_CAMTYPE_URANUS814 690
+
+
+
+#define QCAM_CAMTYPE_QHY8L 891
+#define QCAM_CAMTYPE_QHY9S 892
+#define QCAM_CAMTYPE_QHY10 893
+#define QCAM_CAMTYPE_QHY11 894
+#define QCAM_CAMTYPE_QHY21 895
+#define QCAM_CAMTYPE_QHY22 896
+#define QCAM_CAMTYPE_QHY23 897
+#define QCAM_CAMTYPE_TITAN174U 900
+#define QCAM_CAMTYPE_TITAN178U 910
+#define QCAM_CAMTYPE_TITAN224U 920
+#define QCAM_CAMTYPE_TITAN226U 930
+#define QCAM_CAMTYPE_TITAN185U 931
+#define QCAM_CAMTYPE_TITAN236U 932
+#define QCAM_CAMTYPE_TITANG400U 933
+#define QCAM_CAMTYPE_TITAN290U 934
+#define QCAM_CAMTYPE_TITAN163U 935
+#define QCAM_CAMTYPE_TITAN165U 936
+#define QCAM_CAMTYPE_TITAN367U 937
+#define QCAM_CAMTYPE_TITAN183U 938
+#define QCAM_CAMTYPE_QHY5III 999
+
+//#define QCAM_CAMTYPE_QHY5LII_M 53
+//#define QCAM_CAMTYPE_QHY5LII_C 531
+
+#define QCAM_MODE_FOCUS 10
+#define QCAM_MODE_PREVIEW 20
+#define QCAM_MODE_FULL 30
+
+#define QCAM_DEPTH_BIT8 10
+#define QCAM_DEPTH_BIT16 20
+
+#define QCAM_TRANSFERSPEED_HIGH 10
+#define QCAM_TRANSFERSPEED_MEDIUM 20
+#define QCAM_TRANSFERSPEED_LOW 30
+
+#define QCAM_SCENE_AUTO 10
+#define QCAM_SCENE_MICROSCOPE 20
+#define QCAM_SCENE_FLUORESCENCE 30
+
+#define QCAM_AWBMODE_GLOBAL 10
+#define QCAM_AWBMODE_SPOT 20
+
+#define QCAM_DEMOSAICMODE_NONE 0
+#define QCAM_DEMOSAICMODE_RGGB 1
+#define QCAM_DEMOSAICMODE_GRBG 2
+#define QCAM_DEMOSAICMODE_BGGR 3
+#define QCAM_DEMOSAICMODE_GBRG 4
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/qhy/QGigE.h b/include/qhy/QGigE.h new file mode 100644 index 0000000..00bd9e2 --- /dev/null +++ b/include/qhy/QGigE.h @@ -0,0 +1,80 @@ +#ifndef _Q_GIGE_H_
+#define _Q_GIGE_H_
+
+#include "stdint.h"
+#include "qhyccdstruct.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define QGIGE_MAXCAMERACOUNT 16
+
+
+#define QGIGE_CAMTYPE_UNKNOWN DEVICETYPE_UNKNOW
+#define QGIGE_CAMTYPE_SOLAR800G DEVICETYPE_SOLAR800G
+#define QGIGE_CAMTYPE_QHY15 DEVICETYPE_QHY15G
+#define QGIGE_CAMTYPE_A0340 DEVICETYPE_A0340G
+#define QGIGE_CAMTYPE_A08050 DEVICETYPE_QHY08050G
+#define QGIGE_CAMTYPE_TEST694 DEVICETYPE_QHY694G
+#define QGIGE_CAMTYPE_TEST16050 DEVICETYPE_QHY27G
+#define QGIGE_CAMTYPE_TEST814 DEVICETYPE_QHY23G
+#define QGIGE_CAMTYPE_A16000 DEVICETYPE_QHY16000G
+#define QGIGE_CAMTYPE_A814 DEVICETYPE_QHY814G
+#define QGIGE_CAMTYPE_A45GX DEVICETYPE_QHY45GX
+
+
+#define QGIGE_DEPTH_8BIT 10
+#define QGIGE_DEPTH_16BIT 20
+
+#define QGIGE_READOUTSPEED_HIGH 10
+#define QGIGE_READOUTSPEED_MEDIUM 20
+#define QGIGE_READOUTSPEED_LOW 30
+
+#ifdef WIN32
+void __stdcall QGigEInit(HANDLE* hGigEList, uint32_t* pCamCount);
+void __stdcall QGigEUninit();
+
+uint32_t __stdcall QGigEGetCamType(HANDLE hGigE);
+GUID __stdcall QGigEGetCamGuid(HANDLE hGigE);
+
+bool __stdcall QGigESetBinning(HANDLE hGigE, uint8_t h, uint8_t v);
+bool __stdcall QGigESetDepth(HANDLE hGigE, uint8_t depth);
+bool __stdcall QGigESetReadoutSpeed(HANDLE hGigE, uint8_t readoutSpeed);
+bool __stdcall QGigESetExposure(HANDLE hGigE, double exp);
+bool __stdcall QGigESetGain(HANDLE hGigE, uint16_t gain);
+bool __stdcall QGigESetFinetune(HANDLE hGigE, uint8_t* finetune);
+bool __stdcall QGigESetRaw(HANDLE hGigE, bool raw);
+
+bool __stdcall QGigEBeginLive(HANDLE hGigE);
+bool __stdcall QGigEGetLiveFrame(HANDLE hGigE, void* data, uint32_t* pW, uint32_t* pH, uint32_t* pBpp);
+void __stdcall QGigEStopLive(HANDLE hGigE);
+bool __stdcall QGigECapture(HANDLE hGigE, void* data, uint32_t* pW, uint32_t* pH, uint32_t* pBpp);
+void __stdcall QGigEAbortCapture(HANDLE hGigE);
+
+bool __stdcall QGigESetTrigerFunction(HANDLE hGigE,bool value);
+
+bool __stdcall QGigESetTargetTemperature(HANDLE hGigE, double temp);
+bool __stdcall QGigESetCoolingPower(HANDLE hGigE,uint8_t power);
+bool __stdcall QGigEBeginCooling(HANDLE hGigE);
+void __stdcall QGigEStopCooling(HANDLE hGigE);
+bool __stdcall QGigEGetCoolerStatus(HANDLE hGigE, double* pTemp, uint8_t* pPower);
+
+bool __stdcall QGigESendRequest(HANDLE hGigE, bool hasResponse, uint16_t cmd, uint8_t* data, uint32_t len);
+
+bool __stdcall QGigEAdWrite(HANDLE hGigE, uint16_t addr, uint32_t value);
+
+bool __stdcall QGigEEepromRead(HANDLE hGigE, uint8_t index, uint8_t* data, uint16_t len);
+bool __stdcall QGigEEepromWrite(HANDLE hGigE, uint8_t index, uint8_t* data, uint16_t len);
+
+bool __stdcall QGigESend2Uart(HANDLE hGigE, int8_t* data, uint16_t len);
+bool __stdcall QGigEReceiveFromUart(HANDLE hGigE, int8_t* data, uint16_t len);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/qhy/QUsb.h b/include/qhy/QUsb.h new file mode 100644 index 0000000..db29961 --- /dev/null +++ b/include/qhy/QUsb.h @@ -0,0 +1,75 @@ +// QUsb.h
+#include "CyAPI.h"
+#include "stdint.h"
+
+#ifndef _QUSB_H_
+#define _QUSB_H_
+
+#define QUSB_MAXCAMERACOUNT 16
+#define QUSB_TXSIZE 524288
+#define QUSB_TXCOUNT 16
+
+#define SingleFrameUSBPacketSize 2048 * 20 *2
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+class Transaction
+{
+public:
+ OVERLAPPED ov;
+ PUCHAR cyContext;
+ unsigned char* data;
+
+ Transaction()
+ {
+ this->ov.hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
+ this->data = new unsigned char[QUSB_TXSIZE];
+ this->cyContext = NULL;
+ }
+};
+
+class UsbContext
+{
+public:
+ CCyUSBDevice* pDev;
+ Transaction txList[QUSB_TXCOUNT];
+ HANDLE hAbortEvent;
+ int lastTxIndex;
+
+ UsbContext()
+ {
+ this->pDev = NULL;
+ this->hAbortEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
+ this->lastTxIndex = -1;
+ }
+};
+
+
+
+
+
+void __cdecl QUsbEnumCam(HANDLE* hCamList,CCyUSBDevice* pDev);
+
+bool __cdecl QUsbReadRawData(HANDLE hCam, unsigned char* data, int32_t len,uint32_t duration);
+
+
+
+bool __cdecl QUsbBeginReadRawData(HANDLE hCam);
+bool __cdecl QUsbWaitForData(HANDLE hCam, uint8_t** pData, int32_t* pLen);
+bool __cdecl QUsbResumeRawDataRead(HANDLE hCam);
+bool __cdecl QUsbAbortWait(HANDLE hCam);
+bool __cdecl QUsbStopReadRawData(HANDLE hCam);
+
+
+
+bool __cdecl QUsbBeginReadRawDataSingle(HANDLE hCam,uint32_t PacketSize);
+bool __cdecl QUsbResumeRawDataReadSingle(HANDLE hCam,uint32_t PacketSize);
+bool __cdecl QUsbWaitForDataSingle(HANDLE hCam, uint8_t** pData, int32_t* pLen,uint32_t PacketSize);
+bool __cdecl QUsbStopReadRawDataSingle(HANDLE hCam);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/qhy/Stdafx.h b/include/qhy/Stdafx.h new file mode 100644 index 0000000..04a5670 --- /dev/null +++ b/include/qhy/Stdafx.h @@ -0,0 +1,6 @@ +#pragma once
+
+#include <windows.h>
+#include <stdio.h>
+#include <math.h>
+#include <process.h>
diff --git a/include/qhy/UsbdStatus.h b/include/qhy/UsbdStatus.h new file mode 100644 index 0000000..f4f0dca --- /dev/null +++ b/include/qhy/UsbdStatus.h @@ -0,0 +1,46 @@ +
+// Note: see usbdi.h in the DDK for the USBD_STATUS source definitions
+typedef LONG USBD_STATUS;
+#define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL)
+#define USBD_STATE(Status) ((ULONG)(Status) & 0xF0000000L)
+
+// HC status codes (Note: both error and stall bit are set)
+#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L)
+#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L)
+#define USBD_STATUS_HALTED ((USBD_STATUS)0xC0000000L)
+#define USBD_STATUS_ERROR ((USBD_STATUS)0x80000000L)
+
+#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L)
+#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L)
+#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L)
+#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L)
+#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L)
+#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L)
+#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L)
+#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L)
+#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L)
+#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL)
+#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL)
+#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL)
+#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL)
+#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL)
+#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L)
+
+#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L)
+#define USBD_STATUS_NO_MEMORY ((USBD_STATUS)0x80000100L)
+#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L)
+#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L)
+#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L)
+#define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L)
+#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L)
+#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L)
+#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L)
+#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L)
+#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L)
+#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L)
+#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L)
+#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED ((USBD_STATUS)0xC0000D00L)
+#define USBD_STATUS_CANCELED ((USBD_STATUS)0x00010000L)
+#define USBD_STATUS_CANCELING ((USBD_STATUS)0x00020000L)
+
+
diff --git a/include/qhy/VersionNo.h b/include/qhy/VersionNo.h new file mode 100644 index 0000000..46e31bb --- /dev/null +++ b/include/qhy/VersionNo.h @@ -0,0 +1,26 @@ +/*
+ ## Cypress CyAPI C++ library version number header file (VersionNo.h)
+ ## =======================================================
+ ##
+ ## Copyright Cypress Semiconductor Corporation, 2009-2012,
+ ## All Rights Reserved
+ ## UNPUBLISHED, LICENSED SOFTWARE.
+ ##
+ ## CONFIDENTIAL AND PROPRIETARY INFORMATION
+ ## WHICH IS THE PROPERTY OF CYPRESS.
+ ##
+ ## Use of this file is governed
+ ## by the license agreement included in the file
+ ##
+ ## <install>/license/license.rtf
+ ##
+ ## where <install> is the Cypress software
+ ## install root directory path.
+ ##
+ ## =======================================================
+*/
+#define FILEVER 1,2,1,0
+#define PRODUCTVER 1,2,1,0
+#define STRFILEVER "1, 2, 1, 0"
+#define STRPRODUCTVER "1, 2, 1, 0"
+#define STRFILEVER_ASSENBLY "1.2.1.0"
diff --git a/include/qhy/chatty.h b/include/qhy/chatty.h new file mode 100644 index 0000000..56f4f4a --- /dev/null +++ b/include/qhy/chatty.h @@ -0,0 +1,75 @@ +// chatty.h
+// enable/disable printing debug information from individual files
+// written by Jan Soldan
+
+
+#ifndef _CHATTY_H_
+#define _CHATTY_H_
+
+//#define QHY_LOGGER
+
+#ifdef QHY_LOGGER
+
+#define CHATTY_CMOSDLL
+//#define CHATTY_CYUSB
+//#define CHATTY_UNLOCK_IMAGE_QUEUE
+//#define CHATTY_DOWNLOAD_FX3
+
+#define CHATTY_X2CAMERA
+#define CHATTY_QHYCCD
+#define CHATTY_QHYCAM
+#define CHATTY_QHYBASE
+
+#define CHATTY_QHY5IIBASE
+#define CHATTY_QHY5LIIBASE
+#define CHATTY_QHY5LIIM
+#define CHATTY_QHY5LIIC
+#define CHATTY_QHY5TIIC
+#define CHATTY_QHY5PIIC
+
+#define CHATTY_QHY10
+
+#define CHATTY_QHY5IIIBASE
+#define CHATTY_QHY5IIICOOLBASE
+#define CHATTY_QHY5IIIDDRCOOLBASE
+
+#define CHATTY_QHY5III128BASE
+#define CHATTY_QHY128C
+
+#define CHATTY_QHY5III163BASE
+#define CHATTY_QHY5III165BASE
+#define CHATTY_QHY5III168BASE
+
+#define CHATTY_QHY5III174BASE
+#define CHATTY_QHY5III174C
+#define CHATTY_QHY5III174M
+
+#define CHATTY_QHY5III178BASE
+#define CHATTY_QHY5III178COOLBASE
+#define CHATTY_QHY5III178C
+
+#define CHATTY_QHY5III183BASE
+#define CHATTY_QHY183
+#define CHATTY_QHY183C
+
+#define CHATTY_QHY5III185BASE
+#define CHATTY_QHY5III185C
+
+#define CHATTY_QHY5III224BASE
+#define CHATTY_QHY5III224COOLBASE
+#define CHATTY_QHY5III224C
+
+#define CHATTY_QHY5III247BASE
+
+#define CHATTY_QHY5III290BASE
+#define CHATTY_QHY5III290COOLBASE
+#define CHATTY_QHY5III290C
+#define CHATTY_QHY5III290M
+
+#define CHATTY_QHY5III367BASE
+
+#endif // QHY_LOGGER
+
+#endif // _CHATTY_H_
+
+
diff --git a/include/qhy/cjson.h b/include/qhy/cjson.h new file mode 100644 index 0000000..b94cb14 --- /dev/null +++ b/include/qhy/cjson.h @@ -0,0 +1,156 @@ +/* + Copyright (c) 2009 Dave Gamble + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +#include "qhyccdstruct.h" + +#ifdef WIN32 + +#else +#include "stddef.h" +#endif + +#ifndef cJSON__h +#define cJSON__h + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* cJSON Types: */ +#define cJSON_False 0 +#define cJSON_True 1 +#define cJSON_NULL 2 +#define cJSON_Number 3 +#define cJSON_String 4 +#define cJSON_Array 5 +#define cJSON_Object 6 + +#define cJSON_IsReference 256 +#define cJSON_StringIsConst 512 + +/* The cJSON structure: */ +typedef struct cJSON { + struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + + int type; /* The type of the item, as above. */ + + char *valuestring; /* The item's string, if type==cJSON_String */ + int valueint; /* The item's number, if type==cJSON_Number */ + double valuedouble; /* The item's number, if type==cJSON_Number */ + + char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ +} cJSON; + +typedef struct cJSON_Hooks { + void *(*malloc_fn)(size_t sz); + void (*free_fn)(void *ptr); +} cJSON_Hooks; + +/* Supply malloc, realloc and free functions to cJSON */ +extern void cJSON_InitHooks(cJSON_Hooks* hooks); + + +/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ +extern cJSON *cJSON_Parse(const char *value); +/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ +extern char *cJSON_Print(cJSON *item); +/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ +extern char *cJSON_PrintUnformatted(cJSON *item); +/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ +extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt); +/* Delete a cJSON entity and all subentities. */ +extern void cJSON_Delete(cJSON *c); + +/* Returns the number of items in an array (or object). */ +extern int cJSON_GetArraySize(cJSON *array); +/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ +extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); +/* Get item "string" from object. Case insensitive. */ +extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); + +/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ +extern const char *cJSON_GetErrorPtr(void); + +/* These calls create a cJSON item of the appropriate type. */ +extern cJSON *cJSON_CreateNull(void); +extern cJSON *cJSON_CreateTrue(void); +extern cJSON *cJSON_CreateFalse(void); +extern cJSON *cJSON_CreateBool(int b); +extern cJSON *cJSON_CreateNumber(double num); +extern cJSON *cJSON_CreateString(const char *string); +extern cJSON *cJSON_CreateArray(void); +extern cJSON *cJSON_CreateObject(void); + +/* These utilities create an Array of count items. */ +extern cJSON *cJSON_CreateIntArray(const int *numbers,int count); +extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count); +extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count); +extern cJSON *cJSON_CreateStringArray(const char **strings,int count); + +/* Append item to the specified array/object. */ +extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); +extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); +extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */ +/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ +extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); + +/* Remove/Detatch items from Arrays/Objects. */ +extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); +extern void cJSON_DeleteItemFromArray(cJSON *array,int which); +extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); +extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); + +/* Update array items. */ +extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */ +extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); +extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); + +/* Duplicate a cJSON item */ +extern cJSON *cJSON_Duplicate(cJSON *item,int recurse); +/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will +need to be released. With recurse!=0, it will duplicate any children connected to the item. +The item->next and ->prev pointers are always zero on return from Duplicate. */ + +/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ +extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated); + +extern void cJSON_Minify(char *json); + +/* Macros for creating things quickly. */ +#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) +#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) +#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) +#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) +#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) +#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) + +/* When assigning an integer value, it needs to be propagated to valuedouble too. */ +#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) +#define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/qhy/cmosdll.h b/include/qhy/cmosdll.h new file mode 100644 index 0000000..8ace907 --- /dev/null +++ b/include/qhy/cmosdll.h @@ -0,0 +1,69 @@ +// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the CMOSDLL_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// CMOSDLL_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+
+
+#include "qhyccdstruct.h"
+
+#ifdef WIN32
+
+#include "stdint.h"
+#include "CyAPI.h"
+#include <process.h>
+
+// live interface
+int32_t InitAsyQCamLive(CCyUSBDevice *Camera, uint32_t x, uint32_t y, uint32_t depth, uint32_t frameSize);
+void StopAsyQCamLive(CCyUSBDevice *Camera);
+void BeginAsyQCamLive(CCyUSBDevice *Camera);
+uint32_t ReadAsyQCamLiveFrame(CCyUSBDevice *Camera, uint8_t *pBuffer, int32_t *pFrameFlag);
+
+// other functions
+void SetTransferSize(int length);
+void InitAsyTransfer(CCyUSBDevice *Camera, int framesize);
+void StartSingleExposure(CCyUSBDevice *Camera);
+void StartLiveExposure(CCyUSBDevice *Camera);
+void StopCapturing(CCyUSBDevice *Camera);
+DWORD IsExposing();
+DWORD ReadAsySingleFrame(PUCHAR pBuffer , DWORD size, int *pFrameFlag);
+
+#else // Linux & Mac
+
+#include <stdint.h>
+
+// live interface
+int32_t InitAsyQCamLive(qhyccd_handle *pDevHandle, uint32_t x, uint32_t y, uint32_t depth, uint32_t frameSize);
+bool BeginAsyQCamLive(qhyccd_handle *pDevHandle);
+void StopAsyQCamLive(qhyccd_handle *pDevHandle);
+uint32_t ReadAsyQCamLiveFrame(qhyccd_handle *pDevHandle, uint8_t *pBuffer, int32_t *pFrameFlag);
+uint32_t ReadAsyQCamLiveFrame(qhyccd_handle *pDevHandle, uint8_t *pBuffer, int32_t *pFrameFlag, UnlockImageQueue *pImageQueue);
+uint32_t ClearEndpoint(qhyccd_handle *pDevHandle);
+uint32_t ProcessAllPendingTransfers(qhyccd_handle *pDevHandle);
+uint32_t CancelAllPendingTransfers(qhyccd_handle *pDevHandle);
+void asyImageDataCallBack(struct libusb_transfer *transfer);
+
+// other functions
+void SetTransferSize(int length);
+void InitAsyTransfer(qhyccd_handle *pDevHandle, uint32_t frameSize);
+void ReleaseAsyTransfer(qhyccd_handle *pDevHandle);
+void StartSingleExposure(qhyccd_handle *pDevHandle);
+void StartLiveExposure(qhyccd_handle *pDevHandle);
+void StopCapturing(qhyccd_handle *pDevHandle);
+uint32_t IsExposing();
+uint32_t ReadAsySingleFrame(uint8_t *pBuffer, uint32_t size, int *pFrameFlag);
+
+void SetThreadExitFlag(int idx, bool val);
+bool IsThreadExitFlag(int idx);
+
+void IncrementEventCount(int idx);
+void DecrementEventCount(int idx);
+void ClearEventCount(int idx);
+int GetEventCount(int idx);
+
+void SetFirstExposureFlag(int idx, bool value);
+bool IsFirstExpousureFlag(int idx);
+
+#endif // WIN32
+
diff --git a/include/qhy/cyioctl.h b/include/qhy/cyioctl.h new file mode 100644 index 0000000..ee6ba72 --- /dev/null +++ b/include/qhy/cyioctl.h @@ -0,0 +1,213 @@ +/*
+ ## Cypress CyAPI C++ library IOCTL defination header file (cyioctl.h)
+ ## =======================================================
+ ##
+ ## Copyright Cypress Semiconductor Corporation, 2009-2012,
+ ## All Rights Reserved
+ ## UNPUBLISHED, LICENSED SOFTWARE.
+ ##
+ ## CONFIDENTIAL AND PROPRIETARY INFORMATION
+ ## WHICH IS THE PROPERTY OF CYPRESS.
+ ##
+ ## Use of this file is governed
+ ## by the license agreement included in the file
+ ##
+ ## <install>/license/license.rtf
+ ##
+ ## where <install> is the Cypress software
+ ## install root directory path.
+ ##
+ ## =======================================================
+*/
+#ifndef __IOCTL_H__
+#define __IOCTL_H__
+
+
+#ifndef DRIVER
+
+#ifndef CTL_CODE
+#include <devioctl.h>
+#endif
+
+#ifndef BM_REQUEST_TYPE
+#include "usb200.h"
+#endif
+
+#include <PSHPACK1.H>
+
+#define DIR_HOST_TO_DEVICE 0
+#define DIR_DEVICE_TO_HOST 1
+
+#define DEVICE_SPEED_UNKNOWN 0x00000000
+#define DEVICE_SPEED_LOW_FULL 0x00000001
+#define DEVICE_SPEED_HIGH 0x00000002
+#define DEVICE_SPEED_SUPER 0x00000004
+
+typedef struct _WORD_SPLIT {
+ UCHAR lowByte;
+ UCHAR hiByte;
+} WORD_SPLIT, *PWORD_SPLIT;
+
+typedef struct _BM_REQ_TYPE {
+ UCHAR Recipient:2;
+ UCHAR Reserved:3;
+ UCHAR Type:2;
+ UCHAR Direction:1;
+} BM_REQ_TYPE, *PBM_REQ_TYPE;
+
+typedef struct _SETUP_PACKET {
+
+ union {
+ BM_REQ_TYPE bmReqType;
+ UCHAR bmRequest;
+ };
+
+ UCHAR bRequest;
+
+ union {
+ WORD_SPLIT wVal;
+ USHORT wValue;
+ };
+
+ union {
+ WORD_SPLIT wIndx;
+ USHORT wIndex;
+ };
+
+ union {
+ WORD_SPLIT wLen;
+ USHORT wLength;
+ };
+
+ ULONG ulTimeOut;
+
+} SETUP_PACKET, *PSETUP_PACKET;
+
+#define USB_ISO_ID 0x4945
+#define USB_ISO_CMD_ASAP 0x8000
+#define USB_ISO_CMD_CURRENT_FRAME 0x8001
+#define USB_ISO_CMD_SET_FRAME 0x8002
+
+typedef struct _ISO_ADV_PARAMS {
+
+ USHORT isoId;
+ USHORT isoCmd;
+
+ ULONG ulParam1;
+ ULONG ulParam2;
+
+} ISO_ADV_PARAMS, *PISO_ADV_PARAMS;
+
+typedef struct _ISO_PACKET_INFO {
+ ULONG Status;
+ ULONG Length;
+} ISO_PACKET_INFO, *PISO_PACKET_INFO;
+
+
+typedef struct _SINGLE_TRANSFER {
+ union {
+ SETUP_PACKET SetupPacket;
+ ISO_ADV_PARAMS IsoParams;
+ };
+
+ UCHAR reserved;
+
+ UCHAR ucEndpointAddress;
+ ULONG NtStatus;
+ ULONG UsbdStatus;
+ ULONG IsoPacketOffset;
+ ULONG IsoPacketLength;
+ ULONG BufferOffset;
+ ULONG BufferLength;
+} SINGLE_TRANSFER, *PSINGLE_TRANSFER;
+
+#endif // #ifndef DRIVER
+
+typedef struct _SET_TRANSFER_SIZE_INFO {
+ UCHAR EndpointAddress;
+ ULONG TransferSize;
+} SET_TRANSFER_SIZE_INFO, *PSET_TRANSFER_SIZE_INFO;
+
+
+//
+// Macro to extract function out of the device io control code
+//
+#ifdef WIN_98_DDK
+#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0xffff0000)) >> 16)
+#endif
+#define FUNCTION_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0x00003FFC)) >> 2)
+#define ACCESS_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0x000C0000)) >> 14)
+//#define METHOD_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0x00000003)))
+
+
+#define IOCTL_ADAPT_INDEX 0x0000
+
+// Get the driver version
+#define IOCTL_ADAPT_GET_DRIVER_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get the current USBDI version
+#define IOCTL_ADAPT_GET_USBDI_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+1, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get the current device alt interface settings from driver
+#define IOCTL_ADAPT_GET_ALT_INTERFACE_SETTING CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+2, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Set the device interface and alt interface setting
+#define IOCTL_ADAPT_SELECT_INTERFACE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+3, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get device address from driver
+#define IOCTL_ADAPT_GET_ADDRESS CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+4, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get number of endpoints for current interface and alt interface setting from driver
+#define IOCTL_ADAPT_GET_NUMBER_ENDPOINTS CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+5, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get the current device power state
+#define IOCTL_ADAPT_GET_DEVICE_POWER_STATE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+6, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Set the device power state
+#define IOCTL_ADAPT_SET_DEVICE_POWER_STATE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+7, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Send a raw packet to endpoint 0
+#define IOCTL_ADAPT_SEND_EP0_CONTROL_TRANSFER CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+8, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Send/receive data to/from nonep0
+#define IOCTL_ADAPT_SEND_NON_EP0_TRANSFER CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+9, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Simulate a disconnect/reconnect
+#define IOCTL_ADAPT_CYCLE_PORT CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+10, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Reset the pipe
+#define IOCTL_ADAPT_RESET_PIPE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+11, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Reset the device
+#define IOCTL_ADAPT_RESET_PARENT_PORT CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+12, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get the current transfer size of an endpoint (in number of bytes)
+#define IOCTL_ADAPT_GET_TRANSFER_SIZE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+13, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Set the transfer size of an endpoint (in number of bytes)
+#define IOCTL_ADAPT_SET_TRANSFER_SIZE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+14, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Return the name of the device
+#define IOCTL_ADAPT_GET_DEVICE_NAME CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+15, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Return the "Friendly Name" of the device
+#define IOCTL_ADAPT_GET_FRIENDLY_NAME CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+16, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Abort all outstanding transfers on the pipe
+#define IOCTL_ADAPT_ABORT_PIPE CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+17, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Send/receive data to/from nonep0 w/ direct buffer acccess (no buffering)
+#define IOCTL_ADAPT_SEND_NON_EP0_DIRECT CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+18, METHOD_NEITHER, FILE_ANY_ACCESS)
+
+// Return device speed
+#define IOCTL_ADAPT_GET_DEVICE_SPEED CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+19, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+// Get the current USB frame number
+#define IOCTL_ADAPT_GET_CURRENT_FRAME CTL_CODE(FILE_DEVICE_UNKNOWN, IOCTL_ADAPT_INDEX+20, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define NUMBER_OF_ADAPT_IOCTLS 21 // Last IOCTL_ADAPT_INDEX + 1
+
+
+#include <POPPACK.H>
+
+#endif // __IOCTL_H__
diff --git a/include/qhy/d5100.h b/include/qhy/d5100.h new file mode 100644 index 0000000..321e189 --- /dev/null +++ b/include/qhy/d5100.h @@ -0,0 +1,38 @@ +/// @source Client.h
+/// @description Public interface for class Client.
+// See licensing information in the file README.TXT.
+
+// -----------------------------------------------------------------------------
+#ifndef __CLIENT_H__
+#define __CLIENT_H__
+// -----------------------------------------------------------------------------
+
+// includes
+
+#include <stdlib.h> // getenv (client_setLogDir)
+
+// -----------------------------------------------------------------------------
+#ifdef __cplusplus
+extern "C" {
+#endif
+// -----------------------------------------------------------------------------
+
+extern __declspec(dllexport) void SetIPAddress(char *address);
+extern __declspec(dllexport) int init_Cam(void *information);
+extern __declspec(dllexport) int set_Cam(int sc1,int sc2,int sc3);
+extern __declspec(dllexport) int start_Cap();
+extern __declspec(dllexport) int get_Img(unsigned char *ImageData);
+extern __declspec(dllexport) int reset_Cam();
+extern __declspec(dllexport) int cam_PowerOff();
+extern __declspec(dllexport) int get_PackegeNum(unsigned int *num);
+extern __declspec(dllexport) int getOnePackege(unsigned char *onePackege);
+extern __declspec(dllexport) int free_Cam();
+
+
+// -----------------------------------------------------------------------------
+#ifdef __cplusplus
+} // #ifdef __cplusplus
+#endif
+// -----------------------------------------------------------------------------
+#endif // __CLIENT_H__
+// -----------------------------------------------------------------------------
diff --git a/include/qhy/debugview.h b/include/qhy/debugview.h new file mode 100644 index 0000000..dd07bc4 --- /dev/null +++ b/include/qhy/debugview.h @@ -0,0 +1,3 @@ +
+
+void OutputDebugPrintf(const char * strOutputString,...);
\ No newline at end of file diff --git a/include/qhy/dithercontrol.h b/include/qhy/dithercontrol.h new file mode 100644 index 0000000..5661d82 --- /dev/null +++ b/include/qhy/dithercontrol.h @@ -0,0 +1,42 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file dithercontrol.h
+ * @brief QHYCCD SDK control PHD2 dither
+ */
+
+#include "qhyccdstruct.h"
+
+
+#ifndef __QHYCCDDITHERDEF_H__
+#define __QHYCCDDITHERDEF_H__
+
+EXPORTC uint32_t STDCALL CheckPHD2Status(char *retstr);
+EXPORTC uint32_t STDCALL Connect2PHD2();
+EXPORTC uint32_t STDCALL DisConnect2PHD2();
+EXPORTC uint32_t STDCALL ControlPHD2Dither(uint32_t level,double settle);
+EXPORTC uint32_t STDCALL PausePHD2Dither();
+
+#endif
\ No newline at end of file diff --git a/include/qhy/download_fx2.h b/include/qhy/download_fx2.h new file mode 100644 index 0000000..f3e4097 --- /dev/null +++ b/include/qhy/download_fx2.h @@ -0,0 +1,6 @@ +#ifndef _DOWNLOAD_FX2_ +#define _DOWNLOAD_FX2_ + +int fx2_ram_download(libusb_device_handle *handle, char *filename, unsigned char vendor_command); + +#endif diff --git a/include/qhy/download_fx3.h b/include/qhy/download_fx3.h new file mode 100644 index 0000000..28e634d --- /dev/null +++ b/include/qhy/download_fx3.h @@ -0,0 +1,6 @@ +#ifndef _DOWNLOAD_FX3_ +#define _DOWNLOAD_FX3_ + +int fx3_usbboot_download(libusb_device_handle *handle, char *filename); + +#endif diff --git a/include/qhy/i2c-dev.h b/include/qhy/i2c-dev.h new file mode 100644 index 0000000..c90556c --- /dev/null +++ b/include/qhy/i2c-dev.h @@ -0,0 +1,341 @@ +/* + i2c-dev.h - i2c-bus driver, char device interface + + Copyright (C) 1995-97 Simon G. Vogl + Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* $Id: i2c-dev.h 5361 2008-10-19 09:47:02Z khali $ */ + +#ifndef LIB_I2CDEV_H +#define LIB_I2CDEV_H + +#include <linux/types.h> +#include <sys/ioctl.h> + + +/* -- i2c.h -- */ + + +/* + * I2C Message - used for pure i2c transaction, also from /dev interface + */ +struct i2c_msg +{ + __u16 addr; /* slave address */ + unsigned short flags; +#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ +#define I2C_M_RD 0x01 +#define I2C_M_NOSTART 0x4000 +#define I2C_M_REV_DIR_ADDR 0x2000 +#define I2C_M_IGNORE_NAK 0x1000 +#define I2C_M_NO_RD_ACK 0x0800 + short len; /* msg length */ + char *buf; /* pointer to msg data */ +}; + +/* To determine what functionality is present */ + +#define I2C_FUNC_I2C 0x00000001 +#define I2C_FUNC_10BIT_ADDR 0x00000002 +#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ +#define I2C_FUNC_SMBUS_PEC 0x00000008 +#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ +#define I2C_FUNC_SMBUS_QUICK 0x00010000 +#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 +#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 +#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 +#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 +#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 +#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 +#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 +#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 +#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 +#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ +#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ + +#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ + I2C_FUNC_SMBUS_WRITE_BYTE) +#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \ + I2C_FUNC_SMBUS_WRITE_BYTE_DATA) +#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \ + I2C_FUNC_SMBUS_WRITE_WORD_DATA) +#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \ + I2C_FUNC_SMBUS_WRITE_BLOCK_DATA) +#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \ + I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) + +/* Old name, for compatibility */ +#define I2C_FUNC_SMBUS_HWPEC_CALC I2C_FUNC_SMBUS_PEC + +/* + * Data for SMBus Messages + */ +#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ +#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */ +union i2c_smbus_data +{ + __u8 byte; + __u16 word; + __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ + /* and one more for PEC */ +}; + +/* smbus_access read or write markers */ +#define I2C_SMBUS_READ 1 +#define I2C_SMBUS_WRITE 0 + +/* SMBus transaction types (size parameter in the above functions) + Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ +#define I2C_SMBUS_QUICK 0 +#define I2C_SMBUS_BYTE 1 +#define I2C_SMBUS_BYTE_DATA 2 +#define I2C_SMBUS_WORD_DATA 3 +#define I2C_SMBUS_PROC_CALL 4 +#define I2C_SMBUS_BLOCK_DATA 5 +#define I2C_SMBUS_I2C_BLOCK_BROKEN 6 +#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ +#define I2C_SMBUS_I2C_BLOCK_DATA 8 + + +/* ----- commands for the ioctl like i2c_command call: + * note that additional calls are defined in the algorithm and hw + * dependent layers - these can be listed here, or see the + * corresponding header files. + */ +/* -> bit-adapter specific ioctls */ +#define I2C_RETRIES 0x0701 /* number of times a device address */ +/* should be polled when not */ +/* acknowledging */ +#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ + + +/* this is for i2c-dev.c */ +#define I2C_SLAVE 0x0703 /* Change slave address */ +/* Attn.: Slave address is 7 or 10 bits */ +#define I2C_SLAVE_FORCE 0x0706 /* Change slave address */ +/* Attn.: Slave address is 7 or 10 bits */ +/* This changes the address, even if it */ +/* is already taken! */ +#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ + +#define I2C_FUNCS 0x0705 /* Get the adapter functionality */ +#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ +#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ + +#define I2C_SMBUS 0x0720 /* SMBus-level access */ + +/* -- i2c.h -- */ + + +/* Note: 10-bit addresses are NOT supported! */ + +/* This is the structure as used in the I2C_SMBUS ioctl call */ +struct i2c_smbus_ioctl_data +{ + char read_write; + __u8 command; + int size; + union i2c_smbus_data *data; +}; + +/* This is the structure as used in the I2C_RDWR ioctl call */ +struct i2c_rdwr_ioctl_data +{ + struct i2c_msg *msgs; /* pointers to i2c_msgs */ + int nmsgs; /* number of i2c_msgs */ +}; + + +static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command, + int size, union i2c_smbus_data *data) +{ + struct i2c_smbus_ioctl_data args; + + args.read_write = read_write; + args.command = command; + args.size = size; + args.data = data; + return ioctl(file, I2C_SMBUS, &args); +} + + +static inline __s32 i2c_smbus_write_quick(int file, __u8 value) +{ + return i2c_smbus_access(file, value, 0, I2C_SMBUS_QUICK, NULL); +} + +static inline __s32 i2c_smbus_read_byte(int file) +{ + union i2c_smbus_data data; + if (i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data)) + return -1; + else + return 0x0FF & data.byte; +} + +static inline __s32 i2c_smbus_write_byte(int file, __u8 value) +{ + return i2c_smbus_access(file, I2C_SMBUS_WRITE, value, + I2C_SMBUS_BYTE, NULL); +} + +static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command) +{ + union i2c_smbus_data data; + if (i2c_smbus_access(file, I2C_SMBUS_READ, command, + I2C_SMBUS_BYTE_DATA, &data)) + return -1; + else + return 0x0FF & data.byte; +} + +static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command, + __u8 value) +{ + union i2c_smbus_data data; + data.byte = value; + return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, + I2C_SMBUS_BYTE_DATA, &data); +} + +static inline __s32 i2c_smbus_read_word_data(int file, __u8 command) +{ + union i2c_smbus_data data; + if (i2c_smbus_access(file, I2C_SMBUS_READ, command, + I2C_SMBUS_WORD_DATA, &data)) + return -1; + else + return 0x0FFFF & data.word; +} + +static inline __s32 i2c_smbus_write_word_data(int file, __u8 command, + __u16 value) +{ + union i2c_smbus_data data; + data.word = value; + return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, + I2C_SMBUS_WORD_DATA, &data); +} + +static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value) +{ + union i2c_smbus_data data; + data.word = value; + if (i2c_smbus_access(file, I2C_SMBUS_WRITE, command, + I2C_SMBUS_PROC_CALL, &data)) + return -1; + else + return 0x0FFFF & data.word; +} + + +/* Returns the number of read bytes */ +static inline __s32 i2c_smbus_read_block_data(int file, __u8 command, + __u8 *values) +{ + union i2c_smbus_data data; + int i; + if (i2c_smbus_access(file, I2C_SMBUS_READ, command, + I2C_SMBUS_BLOCK_DATA, &data)) + return -1; + else + { + for (i = 1; i <= data.block[0]; i++) + values[i-1] = data.block[i]; + return data.block[0]; + } +} + +static inline __s32 i2c_smbus_write_block_data(int file, __u8 command, + __u8 length, __u8 *values) +{ + union i2c_smbus_data data; + int i; + if (length > 32) + length = 32; + for (i = 1; i <= length; i++) + data.block[i] = values[i-1]; + data.block[0] = length; + return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, + I2C_SMBUS_BLOCK_DATA, &data); +} + +/* Returns the number of read bytes */ +/* Until kernel 2.6.22, the length is hardcoded to 32 bytes. If you + ask for less than 32 bytes, your code will only work with kernels + 2.6.23 and later. */ +static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command, + __u8 length, __u8 *values) +{ + union i2c_smbus_data data; + int i; + + if (length > 32) + length = 32; + data.block[0] = length; + if (i2c_smbus_access(file, I2C_SMBUS_READ, command, + length == 32 ? I2C_SMBUS_I2C_BLOCK_BROKEN : + I2C_SMBUS_I2C_BLOCK_DATA, &data)) + return -1; + else + { + for (i = 1; i <= data.block[0]; i++) + values[i-1] = data.block[i]; + return data.block[0]; + } +} + +static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command, + __u8 length, __u8 *values) +{ + union i2c_smbus_data data; + int i; + if (length > 32) + length = 32; + for (i = 1; i <= length; i++) + data.block[i] = values[i-1]; + data.block[0] = length; + return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, + I2C_SMBUS_I2C_BLOCK_BROKEN, &data); +} + +/* Returns the number of read bytes */ +static inline __s32 i2c_smbus_block_process_call(int file, __u8 command, + __u8 length, __u8 *values) +{ + union i2c_smbus_data data; + int i; + if (length > 32) + length = 32; + for (i = 1; i <= length; i++) + data.block[i] = values[i-1]; + data.block[0] = length; + if (i2c_smbus_access(file, I2C_SMBUS_WRITE, command, + I2C_SMBUS_BLOCK_PROC_CALL, &data)) + return -1; + else + { + for (i = 1; i <= data.block[0]; i++) + values[i-1] = data.block[i]; + return data.block[0]; + } +} + + +#endif /* LIB_I2CDEV_H */ diff --git a/include/qhy/i2c.h b/include/qhy/i2c.h new file mode 100644 index 0000000..0861239 --- /dev/null +++ b/include/qhy/i2c.h @@ -0,0 +1,60 @@ +/*___________________________________________________ + | _____ _____ _ _ _ | + | | __ \ | __ (_) | | | | + | | |__) |__ _ __ __ _ _ _| |__) || | ___ | |_ | + | | ___/ _ \ '_ \ / _` | | | | ___/ | |/ _ \| __| | + | | | | __/ | | | (_| | |_| | | | | | (_) | |_ | + | |_| \___|_| |_|\__, |\__,_|_| |_|_|\___/ \__| | + | __/ | | + | GNU/Linux based |___/ Multi-Rotor UAV Autopilot | + |___________________________________________________| + + Threadsafe Linux I2C Interface + + Copyright (C) 2013 Tobias Simon, Ilmenau University of Technology + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. */ + + +#ifndef __I2C_H__ +#define __I2C_H__ + + +#include <stdint.h> +#include <stddef.h> + + +/* bus type definition: */ +typedef int i2c_bus_t; + + +/* device type definition: */ +typedef struct +{ + i2c_bus_t *bus; + uint8_t addr; +} +i2c_dev_t; + + +int i2c_bus_open(i2c_bus_t *bus, char *path); +int i2c_bus_close(i2c_bus_t *bus); +void i2c_dev_init(i2c_dev_t *dev, i2c_bus_t *bus, uint8_t addr); +int i2c_xfer(i2c_dev_t *dev, uint8_t len_wr, uint8_t *wr_data, uint8_t len_rd, uint8_t *rd_data); +int i2c_write(i2c_dev_t *dev, uint8_t val); +int i2c_write_reg(i2c_dev_t *dev, uint8_t reg, uint8_t val); +int i2c_read(i2c_dev_t *dev); +int i2c_read_reg(i2c_dev_t *dev, uint8_t reg); +int i2c_read_block_reg(i2c_dev_t *dev, uint8_t reg, uint8_t *buf, size_t len); + + +#endif /* __I2C_H__ */ + diff --git a/include/qhy/ic16803.h b/include/qhy/ic16803.h new file mode 100644 index 0000000..0d4ae42 --- /dev/null +++ b/include/qhy/ic16803.h @@ -0,0 +1,509 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file ic16803.h
+ * @brief IC16803 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __IC16803DEF_H__
+#define __IC16803DEF_H__
+
+/**
+ * @brief IC16803 class define
+ *
+ * include all functions for IC16803
+ */
+class IC16803:public QHYBASE
+{
+public:
+ IC16803();
+ ~IC16803();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin33 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+ /** @fn virtual uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt)
+ @brief Set InterCam serial2 params
+ @param h camera control handle
+ @param opt the param
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt);
+
+ /** @fn virtual uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length)
+ @brief Send data to InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @param length the length to send
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length);
+
+
+ /** @fn virtual uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf)
+ @brief Get data from InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @return
+ on success,return the data number \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf);
+
+ /** @fn virtual uint32_t Send2OledFast(qhyccd_handle *h,char *buffer)
+ @brief send data to show on InterCam's OLED
+ @param h camera control handle
+ @param buffer buffer for data
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2OledFast(qhyccd_handle *h,uint8_t *buffer);
+
+ /** @fn uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff)
+ @brief turn off or turn on the InterCam's Oled
+ @param handle camera control handle
+ @param onoff on or off the oled \n
+ 1:on \n
+ 0:off \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff);
+
+ /** @fn uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness)
+ @brief send data to show on InterCam's OLED
+ @param handle camera control handle
+ @param brightness the oled's brightness
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness);
+
+ uint32_t SendFourLine2InterCamOled(qhyccd_handle *handle,char *messagetemp,char *messageinfo,char *messagetime,char *messagemode);
+
+ /** @fn uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom)
+ @brief spilit the message to two line,send to camera
+ @param handle camera control handle
+ @param messageTop message for the oled's 1st line
+ @param messageBottom message for the oled's 2nd line
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom);
+
+ /**
+ @fn uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop)
+ @brief spilit the message to two line,send to camera
+ @param handle camera control handle
+ @param messageTop message for all the oled
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop);
+
+ /**
+ @fn uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf)
+ @brief Get camera status
+ @param h camera control handle
+ @param buf camera's status save space
+ @return
+ on success,return the camera statu \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status)
+ @brief control camera's shutter
+ @param handle camera control handle
+ @param status the shutter status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status);
+
+ /**
+ @fn uint32_t GetShutterStatus(qhyccd_handle *handle)
+ @brief get the camera's shutter status
+ @param handle camera control handle
+ @return
+ on success,return status \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetShutterStatus(qhyccd_handle *handle);
+
+ uint32_t GetHumidity(qhyccd_handle *handle,double *hd);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+};
+#endif
+
diff --git a/include/qhy/ic8300.h b/include/qhy/ic8300.h new file mode 100644 index 0000000..ce4043b --- /dev/null +++ b/include/qhy/ic8300.h @@ -0,0 +1,75 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file ic8300.h
+ * @brief IC8300 class define
+ */
+
+#include "qhyabase.h"
+
+#ifndef __IC8300DEF_H__
+#define __IC8300DEF_H__
+
+/**
+ * @brief IC8300 class define
+ *
+ * include all functions for ic8300
+ */
+class IC8300:public QHYABASE
+{
+public:
+ IC8300();
+ ~IC8300();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+
+ uint32_t SetFocusSetting(qhyccd_handle *h, uint32_t focusCenterX, uint32_t focusCenterY);
+
+};
+#endif
+
diff --git a/include/qhy/img0h.h b/include/qhy/img0h.h new file mode 100644 index 0000000..42d1fb9 --- /dev/null +++ b/include/qhy/img0h.h @@ -0,0 +1,284 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file img0h.h
+ * @brief IMG0H class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __IMG0HDEF_H__
+#define __IMG0HDEF_H__
+
+#define GUIDE_EAST 0x00010010 /* 0 RA+ */
+#define GUIDE_NORTH 0x00020020 /* 1 DEC+ */
+#define GUIDE_SOUTH 0x00020040 /* 2 DEC- */
+#define GUIDE_WEST 0x00010080 /* 3 RA- */
+
+/**
+ * @brief IMG0H class define
+ *
+ * include all functions for qhy7
+ */
+class IMG0H:public QHYBASE
+{
+public:
+ IMG0H();
+ ~IMG0H();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime)
+ @brief send the command to camera's guide port
+ @param h camera control handle
+ @param Direction RA DEC
+ @param PulseTime the time last for command
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime);
+
+ uint32_t ImgX;
+ uint32_t ImgY;
+ uint32_t ShowImgX;
+ uint32_t ShowImgY;
+ uint32_t ShowImgX_Start;
+ uint32_t ShowImgY_Start;
+};
+#endif
+
diff --git a/include/qhy/img132e.h b/include/qhy/img132e.h new file mode 100644 index 0000000..0e95864 --- /dev/null +++ b/include/qhy/img132e.h @@ -0,0 +1,257 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file img132e.h
+ * @brief IMG132E class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __IMG132EDEF_H__
+#define __IMG132EDEF_H__
+
+#define GUIDE_EAST 0x00010010 /* 0 RA+ */
+#define GUIDE_NORTH 0x00020020 /* 1 DEC+ */
+#define GUIDE_SOUTH 0x00020040 /* 2 DEC- */
+#define GUIDE_WEST 0x00010080 /* 3 RA- */
+
+/**
+ * @brief IMG132E class define
+ *
+ * include all functions for img132e
+ */
+class IMG132E:public QHYBASE
+{
+public:
+ IMG132E();
+ ~IMG132E();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double red);
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double red);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+
+ void w_i2c_imx035(qhyccd_handle *h,unsigned char addr,unsigned char dat);
+
+ uint32_t ReservedFunction(uint32_t width,uint32_t height,uint32_t bpp,uint32_t channels,uint8_t *ImgData);
+
+ uint32_t ImgX;
+ uint32_t ImgY;
+ uint32_t ShowImgX;
+ uint32_t ShowImgY;
+ uint32_t ShowImgX_Start;
+ uint32_t ShowImgY_Start;
+};
+#endif
+
diff --git a/include/qhy/img2p.h b/include/qhy/img2p.h new file mode 100644 index 0000000..dddb970 --- /dev/null +++ b/include/qhy/img2p.h @@ -0,0 +1,335 @@ +/* + QHYCCD SDK + + Copyright (c) 2014 QHYCCD. + All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + The full GNU General Public License is included in this distribution in the + file called LICENSE. + */ + +/*! + * @file img2p.h + * @brief ING2P class define + */ + +#include "qhybase.h" + +#ifndef __IMG2PDEF_H__ +#define __IMG2PDEF_H__ + +/** + * @brief IC8300 class define + * + * include all functions for ic8300 + */ +class IMG2P:public QHYBASE +{ +public: + IMG2P(); + ~IMG2P(); + + /** + @fn uint32_t InitChipRegs(qhyccd_handle *h) + @brief Init the registers and some other things + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitChipRegs(qhyccd_handle *h); + + /** + @fn uint32_t IsChipHasFunction(CONTROL_ID id) + @brief check the camera has the function or not + @param id function id + @return + HAVE return QHYCCD_HAVE \n + NOT HAVE return QHYCCD_NOTHAVE + */ + uint32_t IsChipHasFunction(CONTROL_ID id); + + /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength(); + + /** + @fn uint32_t SetChipGain(qhyccd_handle *h,double gain) + @brief set the gain to camera + @param h camera control handle + @param gain gain value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipGain(qhyccd_handle *h,double gain); + + /** + @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i) + @brief set the expose time to camera + @param h camera control handle + @param i expose time value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipExposeTime(qhyccd_handle *h,double i); + + /** + @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i) + @brief set the transfer speed to camera + @param h camera control handle + @param i speed level + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i); + + /** + @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset) + @brief set the camera offset + @param h camera control handle + @param offset offset value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipOffset(qhyccd_handle *h,double offset); + + /** + @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin) + @brief set the camera offset + @param h camera control handle + @param wbin width bin + @param hbin height bin + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin); + + /** + @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length) + @brief send the command to camera's color filter wheel port + @param handle camera control handle + @param order the color filter position + @param length the order string length. + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length); + + /** + @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step) + @brief get the min,max and step value for function + @param controlId the control id + @param min the min value for function + @param max the max value for function + @param step single step value for function + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step); + + /** + @fn double GetChipCoolTemp(qhyccd_handle *h) + @brief get the current ccd/cmos temprature + @param h camera control handle + @return + success return the current cool temprature \n + another QHYCCD_ERROR code on other failures + */ + double GetChipCoolTemp(qhyccd_handle *h); + + /** + @fn double GetChipCoolPWM() + @brief get the current ccd/cmos temprature + @return + success return the current cool temprature \n + another QHYCCD_ERROR code on other failures + */ + double GetChipCoolPWM(); + + /** + @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h) + @brief correct width and height if the setting width or height is not correct + @param w set width + @param h set height + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t CorrectWH(uint32_t *w,uint32_t *h); + + /** + @fn double InitBIN11Mode() + @brief init the bin11 mode setting + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN11Mode(); + + /** + @fn double InitBIN22Mode() + @brief init the bin22 mode setting + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN22Mode(); + + /** + @fn double InitBIN44Mode() + @brief init the bin44 mode setting + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN44Mode(); + + /** + @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize) + @brief set camera ouput resolution + @param handle camera control handle + @param x the top left position x + @param y the top left position y + @param xsize the image width + @param ysize the image height + @return + on success,return QHYCCD_SUCCESS\n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize); + + /** + @fn uint32_t BeginSingleExposure(qhyccd_handle *h) + @brief begin single exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t BeginSingleExposure(qhyccd_handle *h); + + /** + @fn uint32_t StopSingleExposure(qhyccd_handle *h) + @brief stop single exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t StopSingleExposure(qhyccd_handle *h); + + /** + @fn uint32_t BeginLiveExposure(qhyccd_handle *h) + @brief begin live exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t BeginLiveExposure(qhyccd_handle *h); + + /** + @fn uint32_t StopLiveExposure(qhyccd_handle *h) + @brief stop live exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t StopLiveExposure(qhyccd_handle *h); + + /** + @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData) + @brief get live frame image data + @param h camera control handle + @param pW real width + @param pH real height + @param pBpp real depth bits + @param pChannels real channels + @param ImgData image data buffer + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData); + + /** + @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp) + @brief auto temprature control + @param h camera control handle + @param ttemp target temprature(degree Celsius) + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t AutoTempControl(qhyccd_handle *h,double ttemp); + + /** + @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM) + @brief set cool power + @param h camera control handle + @param PWM power(0-255) + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM); + + /** + @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift) + @brief move the pixel raw data to correction position,and bin if need + @param Data raw image data + @param x image width + @param y image height + @param PixShift this is a way to fix the bad pixel data by the usb transfer + */ + void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift); + + /** + @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift) + @brief move the pixel raw data to correction position,and bin if need + @param Data raw image data + @param x image width + @param y image height + @param PixShift this is a way to fix the bad pixel data by the usb transfer + */ + void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift); + + /** + @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift) + @brief move the pixel raw data to correction position,and bin if need + @param Data raw image data + @param x image width + @param y image height + @param PixShift this is a way to fix the bad pixel data by the usb transfer + */ + void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift); +}; +#endif + diff --git a/include/qhy/log4z.h b/include/qhy/log4z.h new file mode 100644 index 0000000..a1995f1 --- /dev/null +++ b/include/qhy/log4z.h @@ -0,0 +1,630 @@ +/*
+ * Log4z License
+ * -----------
+ *
+ * Log4z is licensed under the terms of the MIT license reproduced below.
+ * This means that Log4z is free software and can be used for both academic
+ * and commercial purposes at absolutely no cost.
+ *
+ *
+ * ===============================================================================
+ *
+ * Copyright (C) 2010-2014 YaweiZhang <yawei_zhang@foxmail.com>.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * ===============================================================================
+ *
+ * (end of COPYRIGHT)
+ */
+
+
+/*
+ * AUTHORS: YaweiZhang <yawei_zhang@foxmail.com>
+ * VERSION: 3.0.0
+ * PURPOSE: A lightweight library for error reporting and logging to file and screen .
+ * CREATION: 2010.10.4
+ * LCHANGE: 2014.12.19
+ * LICENSE: Expat/MIT License, See Copyright Notice at the begin of this file.
+ */
+
+
+/*
+ * contact me:
+ * tencent qq group: 19811947
+ * mail: yawei_zhang@foxmail.com
+ */
+
+
+/*
+ * UPDATES LOG
+ *
+ * VERSION 0.1.0 <DATE: 2010.10.4>
+ * create the first project.
+ * It support put log to screen and files,
+ * support log level, support one day one log file.
+ * support multi-thread, cross-platform.
+ *
+ * VERSION .... <DATE: ...>
+ * ...
+ *
+ * VERSION 0.9.0 <DATE: 2012.12.24>
+ * support config files.
+ * support color text in screen.
+ * support multiple output to different files.
+ *
+ * VERSION 1.0.0 <DATE: 2012.12.29>
+ * support comments in the config file.
+ * add a advanced demo in the ./project
+ * fix some details.
+ *
+ * VERSION 1.0.1 <DATE: 2013.01.01>
+ * change and add some Comments in the log4z
+ * simplify the 'fast_test' demo projects.
+ *
+ * VERSION 1.1.0 <DATE: 2013.01.24>
+ * the method Start will wait for the logger thread started.
+ * config and add method change.
+ * namespace change.
+ *
+ * VERSION 1.1.1 <DATE: 2013.02.23>
+ * add status info method.
+ * optimize.
+ *
+ * VERSION 1.2.0 <DATE: 2013.04.05>
+ * add stress test demo
+ * rewrite Stream module,better performance.
+ *
+ * VERSION 1.2.1 <DATE: 2013.04.13>
+ * fixed type name 'long' stream format on 64/32 operation system.
+ * logger will not loss any log on process normal exit.
+ *
+ * VERSION 2.0.0 <DATE: 2013.04.25>
+ * new interface:
+ * merge some Main interface and Dynamic interface
+ * add Change Logger Attribute method by thread-safe
+ * new config design.
+ * log file name append process id.
+ *
+ * VERSION 2.1 <DATE: 2013.05.22>
+ * support binary text output
+ * rewrite write file module, support vs2005 open Chinese characters path
+ *
+ * VERSION 2.2 <DATE: 2013.07.08>
+ * optimized binary stream output view
+ * support wchar * string.
+ *
+ * VERSION 2.3 <DATE: 2013.08.29>
+ * adjust output file named.
+ * support different month different directory.
+ * adjust some detail.
+ *
+ * VERSION 2.4 <DATE: 2013.10.07>
+ * support rolling log file.
+ * support hot update configure
+ * used precision time in log.
+ * micro set default logger attribute
+ * fix tls bug in windows xp dll
+ *
+ * VERSION 2.5 <DATE: 2014.03.25>
+ * screen output can choice synchronous or not
+ * fix sometimes color will disorder on windows.
+ * eliminate some compiler warning
+ * fix sem_timewait in linux
+ * add format-style method at input log, cannot support vs2003 and VC6.
+ * fix WCHAR String cannot output
+ * optimize std::string, binary log input, and support std::wstring.
+ * clean code, better readability
+ *
+ * VERSION 2.6 <DATE: 2014.08.19>
+ * add PrePushLog
+ * better performance when log is filter out.
+ * interface replace std::string because it's in shared library is unsafe.
+ * add log level 'trace'
+ *
+ * VERSION 2.6.1 <DATE: 2014.08.22>
+ * fix bug from defined _MSC_VER
+ *
+ * VERSION 2.7 <DATE: 2014.09.21>
+ * compatible mac machine, now log4z can working in linux/windows/mac.
+ *
+ * VERSION 2.8 <DATE: 2014.09.27>
+ * support synchronous written to file and thread-safe
+ * fix compatibility on MinGW. a constant value suffix.
+ * ignore utf-8 file BOM when load configure file
+ * use macro WIN32_LEAN_AND_MEAN replace head file winsock2.h
+ * new naming notations
+ *
+ * VERSION 3.0 <DATE: 2014.12.19>
+ * new naming notations
+ * support for reading config from a string.
+ * remove all TLS code, used dispatch_semaphore in apple OS.
+ * support system: windows, linux, mac, iOS
+ *
+ */
+
+
+#pragma once
+#ifndef _ZSUMMER_LOG4Z_H_
+#define _ZSUMMER_LOG4Z_H_
+
+#include <string>
+#include <sstream>
+#include <errno.h>
+#include <stdio.h>
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+#endif
+
+//! logger ID type. DO NOT TOUCH
+typedef int LoggerId;
+
+//! the invalid logger id. DO NOT TOUCH
+const int LOG4Z_INVALID_LOGGER_ID = -1;
+
+//! the main logger id. DO NOT TOUCH
+//! can use this id to set the main logger's attribute.
+//! example:
+//! ILog4zManager::getPtr()->setLoggerLevel(LOG4Z_MAIN_LOGGER_ID, LOG_LEVEL_WARN);
+//! ILog4zManager::getPtr()->setLoggerDisplay(LOG4Z_MAIN_LOGGER_ID, false);
+const int LOG4Z_MAIN_LOGGER_ID = 0;
+
+//! the main logger name. DO NOT TOUCH
+const char*const LOG4Z_MAIN_LOGGER_KEY = "Main";
+
+//! check VC VERSION. DO NOT TOUCH
+//! format micro cannot support VC6 or VS2003, please use stream input log, like LOGI, LOGD, LOG_DEBUG, LOG_STREAM ...
+#if _MSC_VER >= 1400 //MSVC >= VS2005
+#define LOG4Z_FORMAT_INPUT_ENABLE
+#endif
+
+#ifndef WIN32
+#define LOG4Z_FORMAT_INPUT_ENABLE
+#endif
+
+//! LOG Level
+enum ENUM_LOG_LEVEL
+{
+ LOG_LEVEL_TRACE = 0,
+ LOG_LEVEL_DEBUG,
+ LOG_LEVEL_INFO,
+ LOG_LEVEL_WARN,
+ LOG_LEVEL_ERROR,
+ LOG_LEVEL_ALARM,
+ LOG_LEVEL_FATAL,
+};
+
+//////////////////////////////////////////////////////////////////////////
+//! -----------------default logger config, can change on this.-----------
+//////////////////////////////////////////////////////////////////////////
+//! the max logger count.
+const int LOG4Z_LOGGER_MAX = 10;
+//! the max log content length.
+const int LOG4Z_LOG_BUF_SIZE = 2048;
+
+//! all logger synchronous output or not
+const bool LOG4Z_ALL_SYNCHRONOUS_OUTPUT = false;
+//! all logger synchronous display to the windows debug output
+const bool LOG4Z_ALL_DEBUGOUTPUT_DISPLAY = false;
+
+//! default logger output file.
+const char* const LOG4Z_DEFAULT_PATH = "./log/";
+//! default log filter level
+const int LOG4Z_DEFAULT_LEVEL = LOG_LEVEL_DEBUG;
+//! default logger display
+const bool LOG4Z_DEFAULT_DISPLAY = true;
+//! default logger output to file
+const bool LOG4Z_DEFAULT_OUTFILE = true;
+//! default logger month dir used status
+const bool LOG4Z_DEFAULT_MONTHDIR = false;
+//! default logger output file limit size, unit M byte.
+const int LOG4Z_DEFAULT_LIMITSIZE = 100;
+//! default logger show suffix (file name and line number)
+const bool LOG4Z_DEFAULT_SHOWSUFFIX = true;
+
+///////////////////////////////////////////////////////////////////////////
+//! -----------------------------------------------------------------------
+//////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+#ifndef _ZSUMMER_BEGIN
+#define _ZSUMMER_BEGIN namespace zsummer {
+#endif
+#ifndef _ZSUMMER_LOG4Z_BEGIN
+#define _ZSUMMER_LOG4Z_BEGIN namespace log4z {
+#endif
+_ZSUMMER_BEGIN
+_ZSUMMER_LOG4Z_BEGIN
+
+
+
+
+//! log4z class
+class ILog4zManager
+{
+public:
+ ILog4zManager(){};
+ virtual ~ILog4zManager(){};
+
+ //! Log4z Singleton
+
+ static ILog4zManager * getInstance();
+ inline static ILog4zManager & getRef(){return *getInstance();}
+ inline static ILog4zManager * getPtr(){return getInstance();}
+
+ //! Config or overwrite configure
+ //! Needs to be called before ILog4zManager::Start,, OR Do not call.
+ virtual bool config(const char * configPath) = 0;
+ virtual bool configFromString(const char * configContent) = 0;
+
+ //! Create or overwrite logger.
+ //! Needs to be called before ILog4zManager::Start, OR Do not call.
+ virtual LoggerId createLogger(const char* key) = 0;
+
+ //! Start Log Thread. This method can only be called once by one process.
+ virtual bool start() = 0;
+
+ //! Default the method will be calling at process exit auto.
+ //! Default no need to call and no recommended.
+ virtual bool stop() = 0;
+
+ //! Find logger. thread safe.
+ virtual LoggerId findLogger(const char* key) =0;
+
+ //pre-check the log filter. if filter out return false.
+ virtual bool prePushLog(LoggerId id, int level) = 0;
+ //! Push log, thread safe.
+ virtual bool pushLog(LoggerId id, int level, const char * log, const char * file = NULL, int line = 0) = 0;
+
+ //! set logger's attribute, thread safe.
+ virtual bool enableLogger(LoggerId id, bool enable) = 0;
+ virtual bool setLoggerName(LoggerId id, const char * name) = 0;
+ virtual bool setLoggerPath(LoggerId id, const char * path) = 0;
+ virtual bool setLoggerLevel(LoggerId id, int nLevel) = 0;
+ virtual bool setLoggerFileLine(LoggerId id, bool enable) = 0;
+ virtual bool setLoggerDisplay(LoggerId id, bool enable) = 0;
+ virtual bool setLoggerOutFile(LoggerId id, bool enable) = 0;
+ virtual bool setLoggerLimitsize(LoggerId id, unsigned int limitsize) = 0;
+ virtual bool setLoggerMonthdir(LoggerId id, bool enable) = 0;
+
+
+ //! Update logger's attribute from config file, thread safe.
+ virtual bool setAutoUpdate(int interval/*per second, 0 is disable auto update*/) = 0;
+ virtual bool updateConfig() = 0;
+
+ //! Log4z status statistics, thread safe.
+ virtual bool isLoggerEnable(LoggerId id) = 0;
+ virtual unsigned long long getStatusTotalWriteCount() = 0;
+ virtual unsigned long long getStatusTotalWriteBytes() = 0;
+ virtual unsigned long long getStatusWaitingCount() = 0;
+ virtual unsigned int getStatusActiveLoggers() = 0;
+};
+
+class Log4zStream;
+class Log4zBinary;
+
+#ifndef _ZSUMMER_END
+#define _ZSUMMER_END }
+#endif
+#ifndef _ZSUMMER_LOG4Z_END
+#define _ZSUMMER_LOG4Z_END }
+#endif
+
+_ZSUMMER_LOG4Z_END
+_ZSUMMER_END
+
+
+
+//! base micro.
+#define LOG_STREAM(id, level, log)\
+{\
+ if (zsummer::log4z::ILog4zManager::getPtr()->prePushLog(id,level)) \
+ {\
+ char logBuf[LOG4Z_LOG_BUF_SIZE];\
+ zsummer::log4z::Log4zStream ss(logBuf, LOG4Z_LOG_BUF_SIZE);\
+ ss << log;\
+ zsummer::log4z::ILog4zManager::getPtr()->pushLog(id, level, logBuf, __FILE__, __LINE__);\
+ }\
+}
+
+
+//! fast micro
+#define LOG_TRACE(id, log) LOG_STREAM(id, LOG_LEVEL_TRACE, log)
+#define LOG_DEBUG(id, log) LOG_STREAM(id, LOG_LEVEL_DEBUG, log)
+#define LOG_INFO(id, log) LOG_STREAM(id, LOG_LEVEL_INFO, log)
+#define LOG_WARN(id, log) LOG_STREAM(id, LOG_LEVEL_WARN, log)
+#define LOG_ERROR(id, log) LOG_STREAM(id, LOG_LEVEL_ERROR, log)
+#define LOG_ALARM(id, log) LOG_STREAM(id, LOG_LEVEL_ALARM, log)
+#define LOG_FATAL(id, log) LOG_STREAM(id, LOG_LEVEL_FATAL, log)
+
+//! super micro.
+#define LOGT( log ) LOG_TRACE(LOG4Z_MAIN_LOGGER_ID, log )
+#define LOGD( log ) LOG_DEBUG(LOG4Z_MAIN_LOGGER_ID, log )
+#define LOGI( log ) LOG_INFO(LOG4Z_MAIN_LOGGER_ID, log )
+#define LOGW( log ) LOG_WARN(LOG4Z_MAIN_LOGGER_ID, log )
+#define LOGE( log ) LOG_ERROR(LOG4Z_MAIN_LOGGER_ID, log )
+#define LOGA( log ) LOG_ALARM(LOG4Z_MAIN_LOGGER_ID, log )
+#define LOGF( log ) LOG_FATAL(LOG4Z_MAIN_LOGGER_ID, log )
+
+
+//! format input log.
+#ifdef LOG4Z_FORMAT_INPUT_ENABLE
+#ifdef WIN32
+#define LOG_FORMAT(id, level, logformat, ...) \
+{ \
+ if (zsummer::log4z::ILog4zManager::getPtr()->prePushLog(id,level)) \
+ {\
+ char logbuf[LOG4Z_LOG_BUF_SIZE]; \
+ _snprintf_s(logbuf, LOG4Z_LOG_BUF_SIZE, _TRUNCATE, logformat, ##__VA_ARGS__); \
+ zsummer::log4z::ILog4zManager::getPtr()->pushLog(id, level, logbuf, __FILE__, __LINE__); \
+ }\
+ }
+#else
+#define LOG_FORMAT(id, level, logformat, ...) \
+{ \
+ if (zsummer::log4z::ILog4zManager::getPtr()->prePushLog(id,level)) \
+ {\
+ char logbuf[LOG4Z_LOG_BUF_SIZE]; \
+ snprintf(logbuf, LOG4Z_LOG_BUF_SIZE,logformat, ##__VA_ARGS__); \
+ zsummer::log4z::ILog4zManager::getPtr()->pushLog(id, level, logbuf, __FILE__, __LINE__); \
+ } \
+}
+#endif
+//!format string
+#define LOGFMT_TRACE(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_TRACE, fmt, ##__VA_ARGS__)
+#define LOGFMT_DEBUG(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
+#define LOGFMT_INFO(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_INFO, fmt, ##__VA_ARGS__)
+#define LOGFMT_WARN(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_WARN, fmt, ##__VA_ARGS__)
+#define LOGFMT_ERROR(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_ERROR, fmt, ##__VA_ARGS__)
+#define LOGFMT_ALARM(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_ALARM, fmt, ##__VA_ARGS__)
+#define LOGFMT_FATAL(id, fmt, ...) LOG_FORMAT(id, LOG_LEVEL_FATAL, fmt, ##__VA_ARGS__)
+#define LOGFMTT( fmt, ...) LOGFMT_TRACE(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#define LOGFMTD( fmt, ...) LOGFMT_DEBUG(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#define LOGFMTI( fmt, ...) LOGFMT_INFO(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#define LOGFMTW( fmt, ...) LOGFMT_WARN(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#define LOGFMTE( fmt, ...) LOGFMT_ERROR(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#define LOGFMTA( fmt, ...) LOGFMT_ALARM(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#define LOGFMTF( fmt, ...) LOGFMT_FATAL(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__)
+#else
+inline void empty_log_format_function1(LoggerId id, const char*, ...){}
+inline void empty_log_format_function2(const char*, ...){}
+#define LOGFMT_TRACE empty_log_format_function1
+#define LOGFMT_DEBUG LOGFMT_TRACE
+#define LOGFMT_INFO LOGFMT_TRACE
+#define LOGFMT_WARN LOGFMT_TRACE
+#define LOGFMT_ERROR LOGFMT_TRACE
+#define LOGFMT_ALARM LOGFMT_TRACE
+#define LOGFMT_FATAL LOGFMT_TRACE
+#define LOGFMTT empty_log_format_function2
+#define LOGFMTD LOGFMTT
+#define LOGFMTI LOGFMTT
+#define LOGFMTW LOGFMTT
+#define LOGFMTE LOGFMTT
+#define LOGFMTA LOGFMTT
+#define LOGFMTF LOGFMTT
+#endif
+
+
+_ZSUMMER_BEGIN
+_ZSUMMER_LOG4Z_BEGIN
+
+//! optimze from std::stringstream to Log4zStream
+#ifdef WIN32
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
+class Log4zBinary
+{
+public:
+ Log4zBinary(const char * buf, int len)
+ {
+ _buf = buf;
+ _len = len;
+ }
+ const char * _buf;
+ int _len;
+};
+class Log4zStream
+{
+public:
+ inline Log4zStream(char * buf, int len);
+ inline int getCurrentLen(){return (int)(_cur - _begin);}
+private:
+ template<class T>
+ inline Log4zStream & writeData(const char * ft, T t);
+ inline Log4zStream & writeLongLong(long long t);
+ inline Log4zStream & writeULongLong(unsigned long long t);
+ inline Log4zStream & writePointer(const void * t);
+ inline Log4zStream & writeString(const wchar_t* t){ return writeData("%s", t); }
+ inline Log4zStream & writeWString(const wchar_t* t);
+ inline Log4zStream & writeBinary(const Log4zBinary & t);
+public:
+ inline Log4zStream & operator <<(const void * t){ return writePointer(t); }
+
+ inline Log4zStream & operator <<(const char * t){return writeData("%s", t);}
+#ifdef WIN32
+ inline Log4zStream & operator <<(const wchar_t * t){ return writeWString(t);}
+#endif
+ inline Log4zStream & operator <<(bool t){ return (t ? writeData("%s", "true") : writeData("%s", "false"));}
+
+ inline Log4zStream & operator <<(char t){return writeData("%c", t);}
+
+ inline Log4zStream & operator <<(unsigned char t){return writeData("%u",(unsigned int)t);}
+
+ inline Log4zStream & operator <<(short t){ return writeData("%d", (int)t); }
+
+ inline Log4zStream & operator <<(unsigned short t){ return writeData("%u", (unsigned int)t); }
+
+ inline Log4zStream & operator <<(int t){return writeData("%d", t);}
+
+ inline Log4zStream & operator <<(unsigned int t){return writeData("%u", t);}
+
+ inline Log4zStream & operator <<(long t) { return writeLongLong(t); }
+
+ inline Log4zStream & operator <<(unsigned long t){ return writeULongLong(t); }
+
+ inline Log4zStream & operator <<(long long t) { return writeLongLong(t); }
+
+ inline Log4zStream & operator <<(unsigned long long t){ return writeULongLong(t); }
+
+ inline Log4zStream & operator <<(float t){return writeData("%.4f", t);}
+
+ inline Log4zStream & operator <<(double t){return writeData("%.4lf", t);}
+
+ template<class _Elem,class _Traits,class _Alloc> //support std::string, std::wstring
+ inline Log4zStream & operator <<(const std::basic_string<_Elem, _Traits, _Alloc> & t){ return *this << t.c_str(); }
+
+ inline Log4zStream & operator << (const zsummer::log4z::Log4zBinary & binary){ return writeBinary(binary); }
+
+private:
+ Log4zStream(){}
+ Log4zStream(Log4zStream &){}
+ char * _begin;
+ char * _end;
+ char * _cur;
+};
+
+inline Log4zStream::Log4zStream(char * buf, int len)
+{
+ _begin = buf;
+ _end = buf + len;
+ _cur = _begin;
+}
+
+template<class T>
+inline Log4zStream& Log4zStream::writeData(const char * ft, T t)
+{
+ if (_cur < _end)
+ {
+ int len = 0;
+ int count = (int)(_end - _cur);
+#ifdef WIN32
+ len = _snprintf(_cur, count, ft, t);
+ if (len == count || (len == -1 && errno == ERANGE))
+ {
+ len = count;
+ *(_end - 1) = '\0';
+ }
+ else if (len < 0)
+ {
+ *_cur = '\0';
+ len = 0;
+ }
+#else
+ len = snprintf(_cur, count, ft, t);
+ if (len < 0)
+ {
+ *_cur = '\0';
+ len = 0;
+ }
+ else if (len >= count)
+ {
+ len = count;
+ *(_end - 1) = '\0';
+ }
+#endif
+ _cur += len;
+ }
+ return *this;
+}
+
+inline Log4zStream & Log4zStream::writeLongLong(long long t)
+{
+#ifdef WIN32
+ writeData("%I64d", t);
+#else
+ writeData("%lld", t);
+#endif
+ return *this;
+}
+
+inline Log4zStream & Log4zStream::writeULongLong(unsigned long long t)
+{
+#ifdef WIN32
+ writeData("%I64u", t);
+#else
+ writeData("%llu", t);
+#endif
+ return *this;
+}
+
+inline Log4zStream & Log4zStream::writePointer(const void * t)
+{
+#ifdef WIN32
+ sizeof(t) == 8 ? writeData("%016I64x", (unsigned long long)t) : writeData("%08I64x", (unsigned long long)t);
+#else
+ sizeof(t) == 8 ? writeData("%016llx", (unsigned long long)t) : writeData("%08llx", (unsigned long long)t);
+#endif
+ return *this;
+}
+
+inline Log4zStream & Log4zStream::writeBinary(const Log4zBinary & t)
+{
+ writeData("%s", "\r\n\t[");
+ for (int i = 0; i < t._len; i++)
+ {
+ if (i % 16 == 0)
+ {
+ writeData("%s", "\r\n\t");
+ *this << (void*)(t._buf + i);
+ writeData("%s", ": ");
+ }
+ writeData("%02x ", (unsigned char)t._buf[i]);
+ }
+ writeData("%s", "\r\n\t]\r\n\t");
+ return *this;
+}
+
+inline zsummer::log4z::Log4zStream & zsummer::log4z::Log4zStream::writeWString(const wchar_t* t)
+{
+#ifdef WIN32
+ DWORD dwLen = WideCharToMultiByte(CP_ACP, 0, t, -1, NULL, 0, NULL, NULL);
+ if (dwLen < LOG4Z_LOG_BUF_SIZE)
+ {
+ std::string str;
+ str.resize(dwLen, '\0');
+ dwLen = WideCharToMultiByte(CP_ACP, 0, t, -1, &str[0], dwLen, NULL, NULL);
+ if (dwLen > 0)
+ {
+ writeData("%s", str.c_str());
+ }
+ }
+#else
+ //not support
+#endif
+ return *this;
+}
+
+
+#ifdef WIN32
+#pragma warning(pop)
+#endif
+
+_ZSUMMER_LOG4Z_END
+_ZSUMMER_END
+
+#endif
+
+
+
+
diff --git a/include/qhy/minicam5base.h b/include/qhy/minicam5base.h new file mode 100644 index 0000000..874b606 --- /dev/null +++ b/include/qhy/minicam5base.h @@ -0,0 +1,137 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file minicam5f_m.h
+ * @brief MINICAM5S_M class define
+ */
+
+#include "qhy5liibase.h"
+
+#ifndef MINICAM5BASE_DEF
+#define MINICAM5BASE_DEF
+
+
+/**
+ * @brief MINICAM5S_M class define
+ *
+ * include all functions for miniCam5s-m
+ */
+class MINICAM5BASE:public QHY5LIIBASE
+{
+public:
+ MINICAM5BASE();
+ ~MINICAM5BASE();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+
+ /**
+ @fn void SetAnalogGain(double gain)
+ @brief set gain to camera,here it is the bottom
+ @param gain gain value
+ */
+ void SetAnalogGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+private:
+ //uint32_t expmode; //!< expose time mode
+ //double pllratio; //!< inter pll ratio
+ //uint32_t longtimeflag;
+
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
diff --git a/include/qhy/minicam5f_m.h b/include/qhy/minicam5f_m.h new file mode 100644 index 0000000..2209013 --- /dev/null +++ b/include/qhy/minicam5f_m.h @@ -0,0 +1,82 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file minicam5f_m.h
+ * @brief MINICAM5S_M class define
+ */
+
+#include "minicam5base.h"
+
+#ifndef MINICAM5F_M_DEF
+#define MINICAM5F_M_DEF
+
+
+/**
+ * @brief MINICAM5S_M class define
+ *
+ * include all functions for miniCam5s-m
+ */
+class MINICAM5F_M:public MINICAM5BASE
+{
+public:
+ MINICAM5F_M();
+ ~MINICAM5F_M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ uint32_t IsCFWPlugged(qhyccd_handle *handle);
+
+private:
+};
+#endif
diff --git a/include/qhy/minicam5s_c.h b/include/qhy/minicam5s_c.h new file mode 100644 index 0000000..154ae9e --- /dev/null +++ b/include/qhy/minicam5s_c.h @@ -0,0 +1,91 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file minicam5s_c.h
+ * @brief MINICAM5S_C class define
+ */
+
+#include "minicam5base.h"
+
+#ifndef MINICAM5S_C_DEF
+#define MINICAM5S_C_DEF
+
+
+/**
+ * @brief MINICAM5S_C class define
+ *
+ * include all functions for miniCam5s-c
+ */
+class MINICAM5S_C:public MINICAM5BASE
+{
+public:
+ MINICAM5S_C();
+ ~MINICAM5S_C();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+};
+#endif
diff --git a/include/qhy/minicam5s_m.h b/include/qhy/minicam5s_m.h new file mode 100644 index 0000000..e7daf03 --- /dev/null +++ b/include/qhy/minicam5s_m.h @@ -0,0 +1,84 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file minicam5s_m.h
+ * @brief MINICAM5S_M class define
+ */
+
+#include "minicam5base.h"
+
+
+#ifndef MINICAM5S_M_DEF
+#define MINICAM5S_M_DEF
+
+
+/**
+ * @brief MINICAM5S_M class define
+ *
+ * include all functions for miniCam5s-m
+ */
+class MINICAM5S_M:public MINICAM5BASE
+{
+public:
+ MINICAM5S_M();
+ ~MINICAM5S_M();
+
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+private:
+
+
+};
+#endif
diff --git a/include/qhy/minicam6f.h b/include/qhy/minicam6f.h new file mode 100644 index 0000000..a6c4294 --- /dev/null +++ b/include/qhy/minicam6f.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file minicam6f.h
+ * @brief MINICAM6F class define
+ */
+
+#include "qhy5iii178coolbase.h"
+
+#ifndef MINICAM6F_DEF
+#define MINICAM6F_DEF
+
+
+/**
+ * @brief MINICAM6F class define
+ *
+ * include all functions for MINICAM6F
+ */
+class MINICAM6F:public QHY5III178COOLBASE
+{
+public:
+ MINICAM6F();
+ ~MINICAM6F();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/plugins.h b/include/qhy/plugins.h new file mode 100644 index 0000000..642d6e0 --- /dev/null +++ b/include/qhy/plugins.h @@ -0,0 +1,165 @@ +#ifndef f_PLUGINS_H
+#define f_PLUGINS_H
+
+#include <vd2/system/vdtypes.h>
+#include <vd2/system/VDString.h>
+#include <vd2/plugin/vdvideofilt.h>
+#include <vector>
+#include <map>
+
+class VDExternalModule;
+struct VDXPluginInfo;
+typedef VDXPluginInfo VDPluginInfo;
+
+struct VDPluginDescription {
+ VDStringW mName;
+ VDStringW mAuthor;
+ VDStringW mDescription;
+ uint32 mVersion;
+ uint32 mType;
+ VDExternalModule *mpModule;
+ const VDPluginInfo *mpInfo;
+ const VDPluginInfo *mpShadowedInfo;
+ bool mbHasStaticAbout;
+ bool mbHasStaticConfigure;
+};
+
+struct VDXFilterModule { // formerly FilterModule
+ struct VDXFilterModule *next, *prev;
+ VDXHINSTANCE hInstModule;
+ VDXFilterModuleInitProc initProc;
+ VDXFilterModuleDeinitProc deinitProc;
+};
+
+class VDExternalModule {
+public:
+ VDExternalModule(const VDStringW& filename);
+ ~VDExternalModule();
+
+ bool Lock();
+ void Unlock();
+
+ bool IsConfigureSupported() const;
+ bool IsAboutSupported() const;
+
+ int GetVideoFilterAPIVersion() const { return mVFHighVersion; }
+
+ const VDStringW& GetFilename() const { return mFilename; }
+ VDXFilterModule& GetFilterModuleInfo() { return mModuleInfo; }
+
+protected:
+ void DisconnectOldPlugins();
+ void ReconnectOldPlugins();
+ bool ReconnectPlugins();
+
+ VDStringW mFilename;
+ HMODULE mhModule;
+ int mModuleRefCount;
+ int mVFHighVersion; // video filter high version (from module init)
+ VDXFilterModule mModuleInfo;
+};
+
+void VDDeinitPluginSystem();
+
+bool VDAddPluginModule(const wchar_t *pFilename);
+void VDAddInternalPlugins(const VDPluginInfo *const *ppInfo);
+
+VDExternalModule * VDGetExternalModuleByFilterModule(const VDXFilterModule *);
+
+VDPluginDescription * VDGetPluginDescription(const wchar_t *pName, uint32 mType);
+void VDEnumeratePluginDescriptions(std::vector<VDPluginDescription *>& plugins, uint32 type);
+
+void VDLoadPlugins(const VDStringW& path, int& succeeded, int& failed);
+const VDPluginInfo * VDLockPlugin(VDPluginDescription *pDesc);
+void VDUnlockPlugin(VDPluginDescription *pDesc);
+
+void VDConnectPluginDescription(const VDPluginInfo *pInfo, VDExternalModule *pModule);
+
+class VDPluginPtr {
+public:
+ VDPluginPtr() : mpDesc(NULL) {}
+ VDPluginPtr(VDPluginDescription *pDesc);
+ VDPluginPtr(const VDPluginPtr& src);
+ ~VDPluginPtr();
+
+ VDPluginPtr& operator=(const VDPluginPtr& src);
+ VDPluginPtr& operator=(VDPluginDescription *pDesc);
+
+ bool operator!() const { return !mpDesc; }
+ VDPluginDescription *operator->() const { return mpDesc; }
+ VDPluginDescription& operator*() const { return *mpDesc; }
+
+protected:
+ VDPluginDescription *mpDesc;
+};
+
+union VDPluginConfigVariantData {
+ uint32 vu32;
+ sint32 vs32;
+ uint64 vu64;
+ sint64 vs64;
+ double vfd;
+ struct NarrowString {
+ char *s;
+ } vsa;
+ struct WideString {
+ wchar_t *s;
+ } vsw;
+ struct Block {
+ uint32 len;
+ char *s;
+ } vb;
+};
+
+class VDPluginConfigVariant {
+public:
+ enum {
+ kTypeInvalid = 0,
+ kTypeU32 = 1,
+ kTypeS32,
+ kTypeU64,
+ kTypeS64,
+ kTypeDouble,
+ kTypeAStr,
+ kTypeWStr,
+ kTypeBlock
+ };
+
+ VDPluginConfigVariant() : mType(kTypeInvalid) {}
+ VDPluginConfigVariant(const VDPluginConfigVariant&);
+ ~VDPluginConfigVariant();
+
+ VDPluginConfigVariant& operator=(const VDPluginConfigVariant&);
+
+ unsigned GetType() const { return mType; }
+
+ void Clear();
+
+ void SetU32(uint32 v) { Clear(); mType = kTypeU32; mData.vu32 = v; }
+ void SetS32(sint32 v) { Clear(); mType = kTypeS32; mData.vs32 = v; }
+ void SetU64(uint64 v) { Clear(); mType = kTypeU64; mData.vu64 = v; }
+ void SetS64(sint64 v) { Clear(); mType = kTypeS64; mData.vs64 = v; }
+ void SetDouble(double v) { Clear(); mType = kTypeDouble; mData.vfd = v; }
+ void SetAStr(const char *s);
+ void SetWStr(const wchar_t *s);
+ void SetBlock(const void *s, unsigned b);
+
+ const uint32& GetU32() const { return mData.vu32; }
+ const sint32& GetS32() const { return mData.vs32; }
+ const uint64& GetU64() const { return mData.vu64; }
+ const sint64& GetS64() const { return mData.vs64; }
+ const double& GetDouble() const { return mData.vfd; }
+ const char *GetAStr() const { return mData.vsa.s; }
+ const wchar_t *GetWStr() const { return mData.vsw.s; }
+ const void *GetBlockPtr() const { return mData.vb.s; }
+ const unsigned GetBlockLen() const { return mData.vb.len; }
+
+protected:
+ unsigned mType;
+
+ VDPluginConfigVariantData mData;
+};
+
+typedef std::map<unsigned, VDPluginConfigVariant> VDPluginConfig;
+
+#endif
diff --git a/include/qhy/polemaster.h b/include/qhy/polemaster.h new file mode 100644 index 0000000..09d2058 --- /dev/null +++ b/include/qhy/polemaster.h @@ -0,0 +1,114 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file polemaster.h
+ * @brief POLEMASTER class define
+ */
+
+#include "qhy5liibase.h"
+
+#ifndef POLEMASTER_DEF
+#define POLEMASTER_DEF
+
+/**
+ * @brief POLEMASTER class define
+ *
+ * include all functions for polemaster
+ */
+class POLEMASTER:public QHY5LIIBASE
+{
+public:
+ POLEMASTER();
+ ~POLEMASTER();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+//private:
+// double pllratio; //!< inter pll ratio
+// uint32_t longtimeflag;
+};
+#endif
diff --git a/include/qhy/qhy08050g.h b/include/qhy/qhy08050g.h new file mode 100644 index 0000000..7e93c4d --- /dev/null +++ b/include/qhy/qhy08050g.h @@ -0,0 +1,367 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy08050g.h
+ * @brief QHY08050G class define
+ */
+
+#include "qhybase.h"
+
+
+#ifndef __QHY08050GDEF_H__
+#define __QHY08050GDEF_H__
+
+/**
+ * @brief QHY08050G class define
+ *
+ * include all functions for QHY08050G
+ */
+class QHY08050G:public QHYBASE
+{
+public:
+ QHY08050G();
+ ~QHY08050G();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+
+ */
+ uint32_t SetChipDepth(qhyccd_handle *h,uint32_t depth);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t GetChipMemoryLength()
+ @brief get the min cost memory for the image
+ @return
+ success return the total memory space(unit:byte) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn double GetChipExposeTime()
+ @brief get the current exposetime
+ @return
+ success return the current expose time (unit:us) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipExposeTime();
+
+ /**
+ @fn double GetChipGain()
+ @brief get the current gain
+ @return
+ success return the current expose gain\n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipGain();
+
+ /**
+ @fn double GetChipSpeed()
+ @brief get the current transfer speed
+ @return
+ success return the current speed level \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipSpeed();
+
+
+ /**
+ @fn double GetChipBitsMode()
+ @brief get the current camera depth bits
+ @return
+ success return the current camera depth bits \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipBitsMode();
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode();
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode();
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+};
+#endif
+
diff --git a/include/qhy/qhy10.h b/include/qhy/qhy10.h new file mode 100644 index 0000000..2623904 --- /dev/null +++ b/include/qhy/qhy10.h @@ -0,0 +1,362 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy10.h
+ * @brief QHY10 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY10DEF_H__
+#define __QHY10DEF_H__
+
+/**
+ * @brief QHY10 class define
+ *
+ * include all functions for QHY10
+ */
+class QHY10 : public QHYBASE {
+public:
+ QHY10();
+ ~QHY10();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ void ConvertQHY10DataFocus(uint8_t *Data,uint32_t PixShift);
+};
+#endif
+
diff --git a/include/qhy/qhy11.h b/include/qhy/qhy11.h new file mode 100644 index 0000000..738fa50 --- /dev/null +++ b/include/qhy/qhy11.h @@ -0,0 +1,337 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy11.h
+ * @brief QHY11 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY11DEF_H__
+#define __QHY11DEF_H__
+
+/**
+ * @brief QHY11 class define
+ *
+ * include all functions for QHY11
+ */
+class QHY11:public QHYBASE
+{
+public:
+ QHY11();
+ ~QHY11();
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin33 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy12.h b/include/qhy/qhy12.h new file mode 100644 index 0000000..02de395 --- /dev/null +++ b/include/qhy/qhy12.h @@ -0,0 +1,328 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy12.h
+ * @brief QHY12 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY12DEF_H__
+#define __QHY12DEF_H__
+
+/**
+ * @brief QHY12 class define
+ *
+ * include all functions for QHY12
+ */
+class QHY12:public QHYBASE
+{
+public:
+ QHY12();
+ ~QHY12();
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ void ConvertQHY12DataFocus(uint8_t *Data,uint32_t PixShift);
+
+
+};
+#endif
+
diff --git a/include/qhy/qhy128c.h b/include/qhy/qhy128c.h new file mode 100644 index 0000000..9a84534 --- /dev/null +++ b/include/qhy/qhy128c.h @@ -0,0 +1,37 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii128base.h"
+
+#ifndef _QHY128C_
+#define _QHY128C_
+
+class QHY128C:public QHY5III128BASE {
+public:
+ QHY128C();
+ ~QHY128C();
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy15.h b/include/qhy/qhy15.h new file mode 100644 index 0000000..4c50621 --- /dev/null +++ b/include/qhy/qhy15.h @@ -0,0 +1,333 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy15.h
+ * @brief QHY15 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY15DEF_H__
+#define __QHY15DEF_H__
+
+/**
+ * @brief QHY15 class define
+ *
+ * include all functions for QHY11
+ */
+class QHY15:public QHYBASE
+{
+public:
+ QHY15();
+ ~QHY15();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin33 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy16.h b/include/qhy/qhy16.h new file mode 100644 index 0000000..b01a274 --- /dev/null +++ b/include/qhy/qhy16.h @@ -0,0 +1,335 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy16.h
+ * @brief QHY16 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY16DEF_H__
+#define __QHY16DEF_H__
+
+/**
+ * @brief QHY16 class define
+ *
+ * include all functions for QHY11
+ */
+class QHY16:public QHYBASE
+{
+public:
+ QHY16();
+ ~QHY16();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin33 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+};
+#endif
+
diff --git a/include/qhy/qhy16000.h b/include/qhy/qhy16000.h new file mode 100644 index 0000000..a270399 --- /dev/null +++ b/include/qhy/qhy16000.h @@ -0,0 +1,232 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy16000.h
+ * @brief QHY16000 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY16000DEF_H__
+#define __QHY16000DEF_H__
+
+/**
+ * @brief QHY16000 class define
+ *
+ * include all functions for QHY16000
+ */
+class QHY16000:public QHYBASE
+{
+public:
+ QHY16000();
+ ~QHY16000();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double InitBIN11Mode(qhyccd_handle *h)
+ @brief init the bin11 mode setting
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(qhyccd_handle *h);
+
+ /**
+ @fn double InitBIN44Mode(qhyccd_handle *h)
+ @brief init the bin44 mode setting
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopSingleExposure(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ uint32_t I2CWriteByte(qhyccd_handle *h,uint8_t index, uint8_t value);
+
+ uint32_t I2CWriteWord(qhyccd_handle *h,uint8_t index, uint16_t value);
+
+ bool flagbin44;
+ uint8_t *rawarray2;
+};
+#endif
+
diff --git a/include/qhy/qhy160002ad.h b/include/qhy/qhy160002ad.h new file mode 100644 index 0000000..0df0d72 --- /dev/null +++ b/include/qhy/qhy160002ad.h @@ -0,0 +1,266 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy160002ad.h
+ * @brief QHY160002AD class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY160002ADDEF_H__
+#define __QHY160002ADDEF_H__
+
+/**
+ * @brief QHY160002AD class define
+ *
+ * include all functions for QHY160002AD
+ */
+class QHY160002AD:public QHYBASE
+{
+public:
+ QHY160002AD();
+ ~QHY160002AD();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double InitBIN11Mode(qhyccd_handle *h)
+ @brief init the bin11 mode setting
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(qhyccd_handle *h);
+
+ /**
+ @fn double InitBIN44Mode(qhyccd_handle *h)
+ @brief init the bin44 mode setting
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ uint32_t I2CWriteByte(qhyccd_handle *h,uint8_t index, uint8_t value);
+
+ uint32_t I2CWriteWord(qhyccd_handle *h,uint8_t index, uint16_t value);
+
+
+ uint32_t SetFineTone(qhyccd_handle *h,uint8_t setshporshd,uint8_t shdloc,uint8_t shploc,uint8_t shwidth);
+};
+#endif
+
diff --git a/include/qhy/qhy16000g.h b/include/qhy/qhy16000g.h new file mode 100644 index 0000000..1e855db --- /dev/null +++ b/include/qhy/qhy16000g.h @@ -0,0 +1,292 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy08050g.h
+ * @brief QHY08050G class define
+ */
+
+#include "qhybase.h"
+
+
+#ifndef __QHY16000GDEF_H__
+#define __QHY16000GDEF_H__
+
+/**
+ * @brief QHY16000G class define
+ *
+ * include all functions for QHY16000G
+ */
+class QHY16000G:public QHYBASE
+{
+public:
+ QHY16000G();
+ ~QHY16000G();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+
+ */
+ uint32_t SetChipDepth(qhyccd_handle *h,uint32_t depth);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode();
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode();
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode();
+
+ uint32_t InitBIN88Mode();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+};
+#endif
+
diff --git a/include/qhy/qhy16200a.h b/include/qhy/qhy16200a.h new file mode 100644 index 0000000..1ada74b --- /dev/null +++ b/include/qhy/qhy16200a.h @@ -0,0 +1,83 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy16200a.h
+ * @brief QHY16200A class define
+ */
+
+#ifndef __QHY16200ADEF_H__
+#define __QHY16200ADEF_H__
+
+#include "qhyabase.h"
+
+/**
+ * @brief QHY16200A class define
+ *
+ * include all functions for QHY16200A
+ */
+class QHY16200A:public QHYABASE
+{
+public:
+ QHY16200A();
+ ~QHY16200A();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy163c.h b/include/qhy/qhy163c.h new file mode 100644 index 0000000..a1fd7cc --- /dev/null +++ b/include/qhy/qhy163c.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy163c.h
+ * @brief QHY163C class define
+ */
+
+#include "qhy5iii163base.h"
+
+#ifndef QHY163_C_DEF
+#define QHY163_C_DEF
+
+
+/**
+ * @brief QHY163C class define
+ *
+ * include all functions for qhy163c
+ */
+class QHY163C:public QHY5III163BASE
+{
+public:
+ QHY163C();
+ virtual ~QHY163C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy163m.h b/include/qhy/qhy163m.h new file mode 100644 index 0000000..ce32937 --- /dev/null +++ b/include/qhy/qhy163m.h @@ -0,0 +1,64 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy163m.h
+ * @brief QHY163M class define
+ */
+
+#include "qhy5iii163base.h"
+
+#ifndef QHY163_M_DEF
+#define QHY163_M_DEF
+
+
+/**
+ * @brief QHY163M class define
+ *
+ * include all functions for qhy163m
+ */
+class QHY163M : public QHY5III163BASE {
+public:
+ QHY163M();
+ virtual ~QHY163M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy165c.h b/include/qhy/qhy165c.h new file mode 100644 index 0000000..8b47477 --- /dev/null +++ b/include/qhy/qhy165c.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy163c.h
+ * @brief QHY163C class define
+ */
+
+#include "qhy5iii165base.h"
+
+#ifndef QHY165_C_DEF
+#define QHY165_C_DEF
+
+
+/**
+ * @brief QHY165C class define
+ *
+ * include all functions for qhy165c
+ */
+class QHY165C:public QHY5III165BASE
+{
+public:
+ QHY165C();
+ ~QHY165C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy16803a.h b/include/qhy/qhy16803a.h new file mode 100644 index 0000000..bca6244 --- /dev/null +++ b/include/qhy/qhy16803a.h @@ -0,0 +1,83 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy16803a.h
+ * @brief QHY16803A class define
+ */
+
+#ifndef __QHY16803ADEF_H__
+#define __QHY16803ADEF_H__
+
+#include "qhyabase.h"
+
+/**
+ * @brief QHY16803A class define
+ *
+ * include all functions for QHY16803A
+ */
+class QHY16803A:public QHYABASE
+{
+public:
+ QHY16803A();
+ ~QHY16803A();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy168c.h b/include/qhy/qhy168c.h new file mode 100644 index 0000000..6a9d911 --- /dev/null +++ b/include/qhy/qhy168c.h @@ -0,0 +1,58 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy168c.h
+ * @brief QHY168C class define
+ */
+
+#include "qhy5iii168base.h"
+
+#ifndef QHY168_C_DEF
+#define QHY168_C_DEF
+
+
+/**
+ * @brief QHY168C class define
+ *
+ * include all functions for qhy168c
+ */
+class QHY168C:public QHY5III168BASE
+{
+public:
+ QHY168C();
+ ~QHY168C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy174c.h b/include/qhy/qhy174c.h new file mode 100644 index 0000000..e0f144d --- /dev/null +++ b/include/qhy/qhy174c.h @@ -0,0 +1,61 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii174base.h"
+
+#ifndef QHY174_C_DEF
+#define QHY174_C_DEF
+
+
+/**
+ * @brief QHY224C class define
+ *
+ * include all functions for qhy174c
+ */
+class QHY174C:public QHY5III174BASE
+{
+public:
+ QHY174C();
+ ~QHY174C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy174m.h b/include/qhy/qhy174m.h new file mode 100644 index 0000000..e242f6a --- /dev/null +++ b/include/qhy/qhy174m.h @@ -0,0 +1,60 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii174base.h"
+
+#ifndef QHY174_M_DEF
+#define QHY174_M_DEF
+
+
+/**
+ * @brief QHY174M class define
+ *
+ * include all functions for qhy174m
+ */
+class QHY174M:public QHY5III174BASE {
+public:
+ QHY174M();
+ ~QHY174M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy178c.h b/include/qhy/qhy178c.h new file mode 100644 index 0000000..6cbe1ed --- /dev/null +++ b/include/qhy/qhy178c.h @@ -0,0 +1,54 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii178coolbase.h"
+
+#ifndef QHY178_C_DEF
+#define QHY178_C_DEF
+
+class QHY178C:public QHY5III178COOLBASE {
+public:
+ QHY178C();
+ ~QHY178C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy178m.h b/include/qhy/qhy178m.h new file mode 100644 index 0000000..045470d --- /dev/null +++ b/include/qhy/qhy178m.h @@ -0,0 +1,54 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii178coolbase.h"
+
+#ifndef QHY178_M_DEF
+#define QHY178_M_DEF
+
+class QHY178M:public QHY5III178COOLBASE {
+public:
+ QHY178M();
+ ~QHY178M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy183.h b/include/qhy/qhy183.h new file mode 100644 index 0000000..bedce48 --- /dev/null +++ b/include/qhy/qhy183.h @@ -0,0 +1,73 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii183base.h"
+
+#ifndef _QHY183_
+#define _QHY183_
+
+#define SINGLE_FRAME_USB_PACKET_SIZE (2048 * 20)
+
+class QHY183:public QHY5III183BASE {
+
+public:
+ QHY183();
+ ~QHY183();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+
+// uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+// uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetLiveFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+ uint32_t GetChipMemoryLength();
+
+private:
+ double pllratio,oldpllratio;
+ double oldtotalcamred2green,totalcamred2green,oldtotalcamgreen,totalcamgreen,oldtotalcamblue2green,totalcamblue2green,oldcamgain;
+
+ uint8_t oldcamddr;
+ uint8_t oldreg08,reg08,oldreg01,reg01;
+ uint8_t oldlockframe,lockframe;
+ uint8_t oldampv_onff,ampv_onff;
+ uint8_t forcestop;
+
+ uint16_t vwinpos,oldvwinpos,vwidcut,oldvwidcut;
+ uint16_t chiproiy,oldchiproiy,chiproiysize,oldchiproiysize;
+
+ uint32_t hmax_ref,vmax_ref;
+ uint32_t vmax,hmax,oldvmax,oldhmax;
+ uint32_t framelength,oldframelength;
+ uint32_t oldchipoutputsizex,oldchipoutputsizey,oldchipoutputbits;
+ uint32_t patchvnumber,oldpatchvnumber;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint32_t oldampv_min,ampv_min,oldampv_max,ampv_max;
+ uint32_t ApproxDDR, ApproxDDR_Target;
+
+ int32_t shr,svr,spl,oldshr,oldsvr,oldspl;
+};
+#endif
diff --git a/include/qhy/qhy183c.h b/include/qhy/qhy183c.h new file mode 100644 index 0000000..dce2d27 --- /dev/null +++ b/include/qhy/qhy183c.h @@ -0,0 +1,45 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii183base.h"
+
+#ifndef _QHY183C_
+#define _QHY183C_
+
+class QHY183C:public QHY5III183BASE {
+public:
+ QHY183C();
+ ~QHY183C();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+
+// uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+// uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+// uint32_t GetLiveFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy21.h b/include/qhy/qhy21.h new file mode 100644 index 0000000..91ad202 --- /dev/null +++ b/include/qhy/qhy21.h @@ -0,0 +1,349 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy21.h
+ * @brief QHY21 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY21DEF_H__
+#define __QHY21DEF_H__
+
+/**
+ * @brief QHY21 class define
+ *
+ * include all functions for QHY21
+ */
+class QHY21:public QHYBASE
+{
+public:
+ QHY21();
+ ~QHY21();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy22.h b/include/qhy/qhy22.h new file mode 100644 index 0000000..e8130bf --- /dev/null +++ b/include/qhy/qhy22.h @@ -0,0 +1,349 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy22.h
+ * @brief QHY22 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY22DEF_H__
+#define __QHY22DEF_H__
+
+/**
+ * @brief QHY22 class define
+ *
+ * include all functions for QHY22
+ */
+class QHY22:public QHYBASE
+{
+public:
+ QHY22();
+ ~QHY22();
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+};
+#endif
+
diff --git a/include/qhy/qhy224c.h b/include/qhy/qhy224c.h new file mode 100644 index 0000000..efc0281 --- /dev/null +++ b/include/qhy/qhy224c.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy224c.h
+ * @brief QHY224C class define
+ */
+
+#include "qhy5iii224coolbase.h"
+
+#ifndef QHY224_C_DEF
+#define QHY224_C_DEF
+
+
+/**
+ * @brief QHY224C class define
+ *
+ * include all functions for qhy224c
+ */
+class QHY224C:public QHY5III224COOLBASE
+{
+public:
+ QHY224C();
+ ~QHY224C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy23.h b/include/qhy/qhy23.h new file mode 100644 index 0000000..08e4d57 --- /dev/null +++ b/include/qhy/qhy23.h @@ -0,0 +1,371 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy23.h
+ * @brief QHY23 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY23DEF_H__
+#define __QHY23DEF_H__
+
+/**
+ * @brief QHY23 class define
+ *
+ * include all functions for QHY23
+ */
+class QHY23:public QHYBASE
+{
+public:
+ QHY23();
+ ~QHY23();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh)
+ @brief get the camera's ccd/cmos chip info
+ @param h camera control handle
+ @param chipw chip size width
+ @param chiph chip size height
+ @param imagew chip output image width
+ @param imageh chip output image height
+ @param pixelw chip pixel size width
+ @param pixelh chip pixel size height
+ @param bpp chip pixel depth
+ */
+ uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh,uint32_t *bpp);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn double GetReadingProgress(qhyccd_handle *handle)
+ @brief get reading data from camera progress
+ @param handle camera control handle
+ @return current progress
+ */
+ double GetReadingProgress(qhyccd_handle *handle);
+
+};
+#endif
+
diff --git a/include/qhy/qhy247c.h b/include/qhy/qhy247c.h new file mode 100644 index 0000000..3e5fb38 --- /dev/null +++ b/include/qhy/qhy247c.h @@ -0,0 +1,58 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy163c.h
+ * @brief QHY163C class define
+ */
+
+#include "qhy5iii247base.h"
+
+#ifndef QHY247_C_DEF
+#define QHY247_C_DEF
+
+
+/**
+ * @brief QHY247C class define
+ *
+ * include all functions for qhy247c
+ */
+class QHY247C:public QHY5III247BASE
+{
+public:
+ QHY247C();
+ ~QHY247C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy27.h b/include/qhy/qhy27.h new file mode 100644 index 0000000..14b9abe --- /dev/null +++ b/include/qhy/qhy27.h @@ -0,0 +1,95 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy27.h
+ * @brief QHY27 class define
+ */
+
+#include "qhyabase.h"
+
+#ifndef __QHY27DEF_H__
+#define __QHY27DEF_H__
+
+/**
+ * @brief QHY27 class define
+ *
+ * include all functions for QHY27
+ */
+class QHY27:public QHYABASE
+{
+public:
+ QHY27();
+ ~QHY27();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy28.h b/include/qhy/qhy28.h new file mode 100644 index 0000000..07c300f --- /dev/null +++ b/include/qhy/qhy28.h @@ -0,0 +1,74 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy28.h
+ * @brief QHY28 class define
+ */
+
+#include "qhyabase.h"
+
+#ifndef __QHY28DEF_H__
+#define __QHY28DEF_H__
+
+/**
+ * @brief QHY28 class define
+ *
+ * include all functions for QHY27
+ */
+class QHY28:public QHYABASE
+{
+public:
+ QHY28();
+ ~QHY28();
+
+ uint32_t SetChipResolution(qhyccd_handle *h,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ uint32_t SetFocusSetting(qhyccd_handle *h, uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy29.h b/include/qhy/qhy29.h new file mode 100644 index 0000000..b1355cb --- /dev/null +++ b/include/qhy/qhy29.h @@ -0,0 +1,95 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy29.h
+ * @brief QHY29 class define
+ */
+
+#include "qhyabase.h"
+
+#ifndef __QHY29DEF_H__
+#define __QHY29DEF_H__
+
+/**
+ * @brief QHY29 class define
+ *
+ * include all functions for QHY29
+ */
+class QHY29:public QHYABASE
+{
+public:
+ QHY29();
+ ~QHY29();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy290c.h b/include/qhy/qhy290c.h new file mode 100644 index 0000000..0fb631e --- /dev/null +++ b/include/qhy/qhy290c.h @@ -0,0 +1,54 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii290coolbase.h"
+
+#ifndef QHY290_C_DEF
+#define QHY290_C_DEF
+
+class QHY290C:public QHY5III290COOLBASE {
+public:
+ QHY290C();
+ ~QHY290C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy290m.h b/include/qhy/qhy290m.h new file mode 100644 index 0000000..1f673e2 --- /dev/null +++ b/include/qhy/qhy290m.h @@ -0,0 +1,53 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii290coolbase.h"
+
+#ifndef QHY290_M_DEF
+#define QHY290_M_DEF
+class QHY290M:public QHY5III290COOLBASE {
+public:
+ QHY290M();
+ ~QHY290M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy2pro.h b/include/qhy/qhy2pro.h new file mode 100644 index 0000000..41cb193 --- /dev/null +++ b/include/qhy/qhy2pro.h @@ -0,0 +1,328 @@ +/* + QHYCCD SDK + + Copyright (c) 2014 QHYCCD. + All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + The full GNU General Public License is included in this distribution in the + file called LICENSE. + */ + +/*! + * @file qhy2pro.h + * @brief QHY2PRO class define + */ + +#include "qhybase.h" + +#ifndef __QHY2PRODEF_H__ +#define __QHY2PRODEF_H__ + +/** + * @brief QHY2PRO class define + * + * include all functions for QHY2PRO + */ +class QHY2PRO:public QHYBASE +{ +public: + QHY2PRO(); + ~QHY2PRO(); + + /** + @fn uint32_t InitChipRegs(qhyccd_handle *h) + @brief Init the registers and some other things + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitChipRegs(qhyccd_handle *h); + + /** + @fn uint32_t IsChipHasFunction(CONTROL_ID id) + @brief check the camera has the function or not + @param id function id + @return + HAVE return QHYCCD_HAVE \n + NOT HAVE return QHYCCD_NOTHAVE + */ + uint32_t IsChipHasFunction(CONTROL_ID id); + + /** + @fn uint32_t SetChipGain(qhyccd_handle *h,double gain) + @brief set the gain to camera + @param h camera control handle + @param gain gain value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipGain(qhyccd_handle *h,double gain); + + /** + @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i) + @brief set the expose time to camera + @param h camera control handle + @param i expose time value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipExposeTime(qhyccd_handle *h,double i); + + /** + @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i) + @brief set the transfer speed to camera + @param h camera control handle + @param i speed level + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i); + + /** + @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset) + @brief set the camera offset + @param h camera control handle + @param offset offset value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipOffset(qhyccd_handle *h,double offset); + + /** + @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin) + @brief set the camera offset + @param h camera control handle + @param wbin width bin + @param hbin height bin + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin); + + /** + @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step) + @brief get the min,max and step value for function + @param controlId the control id + @param min the min value for function + @param max the max value for function + @param step single step value for function + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step); + + /** + @fn double GetChipCoolTemp(qhyccd_handle *h) + @brief get the current ccd/cmos temprature + @param h camera control handle + @return + success return the current cool temprature \n + another QHYCCD_ERROR code on other failures + */ + double GetChipCoolTemp(qhyccd_handle *h); + + /** + @fn double GetChipCoolPWM() + @brief get the current ccd/cmos temprature + @return + success return the current cool temprature \n + another QHYCCD_ERROR code on other failures + */ + double GetChipCoolPWM(); + + + /** + @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h) + @brief correct width and height if the setting width or height is not correct + @param w set width + @param h set height + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t CorrectWH(uint32_t *w,uint32_t *h); + + /** + @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize) + @brief init the bin11 mode setting + @param x the top left x + @param y the top left y + @param xsize x size + @param ysize y size + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize); + + /** + @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize) + @brief init the bin22 mode setting + @param x the top left x + @param y the top left y + @param xsize x size + @param ysize y size + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize); + + /** + @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize) + @brief init the bin44 mode setting + @param x the top left x + @param y the top left y + @param xsize x size + @param ysize y size + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize); + + /** + @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize) + @brief set camera ouput resolution + @param handle camera control handle + @param x the top left position x + @param y the top left position y + @param xsize the image width + @param ysize the image height + @return + on success,return QHYCCD_SUCCESS\n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize); + + /** + @fn uint32_t BeginSingleExposure(qhyccd_handle *h) + @brief begin single exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t BeginSingleExposure(qhyccd_handle *h); + + /** + @fn uint32_t CancelExposing(qhyccd_handle *handle) + @param handle camera control handle + @return + on success,return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t CancelExposing(qhyccd_handle *handle); + + /** + @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h) + @brief stop single exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t CancelExposingAndReadout(qhyccd_handle *h); + + /** + @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData) + @brief get single frame image data + @param h camera control handle + @param pW real width + @param pH real height + @param pBpp real depth bits + @param pChannels real channels + @param ImgData image data buffer + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData); + + /** + @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp) + @brief auto temprature control + @param h camera control handle + @param ttemp target temprature(degree Celsius) + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t AutoTempControl(qhyccd_handle *h,double ttemp); + + /** + @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM) + @brief set cool power + @param h camera control handle + @param PWM power(0-255) + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM); + + /** + @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift) + @brief move the pixel raw data to correction position,and bin if need + @param Data raw image data + @param x image width + @param y image height + @param PixShift this is a way to fix the bad pixel data by the usb transfer + */ + void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift); + + /** + @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift) + @brief move the pixel raw data to correction position,and bin if need + @param Data raw image data + @param x image width + @param y image height + @param PixShift this is a way to fix the bad pixel data by the usb transfer + */ + void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift); + + /** + @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift) + @brief move the pixel raw data to correction position,and bin if need + @param Data raw image data + @param x image width + @param y image height + @param PixShift this is a way to fix the bad pixel data by the usb transfer + */ + void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift); + + /** + @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY) + @brief Set the camera on focus mode + @param h camera control handle + @param focusCenterX + @param focusCenterY + @return + on success,return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY); +}; +#endif + diff --git a/include/qhy/qhy367c.h b/include/qhy/qhy367c.h new file mode 100644 index 0000000..75f53df --- /dev/null +++ b/include/qhy/qhy367c.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy367c.h
+ * @brief QHY367C class define
+ */
+
+#include "qhy5iii367base.h"
+
+#ifndef QHY367_C_DEF
+#define QHY367_C_DEF
+
+
+/**
+ * @brief QHY367C class define
+ *
+ * include all functions for qhy367c
+ */
+class QHY367C:public QHY5III367BASE
+{
+public:
+ QHY367C();
+ ~QHY367C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy45gx.h b/include/qhy/qhy45gx.h new file mode 100644 index 0000000..34f8a5c --- /dev/null +++ b/include/qhy/qhy45gx.h @@ -0,0 +1,311 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy45gx.h
+ * @brief QHY45GX class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY45GXDEF_H__
+#define __QHY45GXDEF_H__
+
+/**
+ * @brief QHY16000G class define
+ *
+ * include all functions for QHY45GX
+ */
+class QHY45GX:public QHYBASE
+{
+public:
+ QHY45GX();
+ ~QHY45GX();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+
+ */
+ uint32_t SetChipDepth(qhyccd_handle *h,uint32_t depth);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode();
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode();
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+};
+#endif
+
diff --git a/include/qhy/qhy5.h b/include/qhy/qhy5.h new file mode 100644 index 0000000..277ce45 --- /dev/null +++ b/include/qhy/qhy5.h @@ -0,0 +1,229 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5.h
+ * @brief QHY5 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef QHY5_DEF
+#define QHY5_DEF
+
+#define GUIDE_EAST 0x00010010 /* 0 RA+ */
+#define GUIDE_NORTH 0x00020020 /* 1 DEC+ */
+#define GUIDE_SOUTH 0x00020040 /* 2 DEC- */
+#define GUIDE_WEST 0x00010080 /* 3 RA- */
+
+#define STORE_WORD_BE(var, val) *(var) = ((val) >> 8) & 0xff; *((var) + 1) = (val) & 0xff
+static const uint32_t qhy5_gain_map[] = { 0x000, 0x004, 0x005, 0x006, 0x007, 0x008, 0x009, 0x00A, 0x00B, 0x00C, 0x00D, 0x00E, 0x00F, 0x010, 0x011, 0x012, 0x013, 0x014, 0x015, 0x016, 0x017, 0x018, 0x019, 0x01A, 0x01B, 0x01C, 0x01D, 0x01E, 0x01F, 0x051, 0x052, 0x053, 0x054, 0x055, 0x056, 0x057, 0x058, 0x059, 0x05A, 0x05B, 0x05C, 0x05D, 0x05E, 0x05F, 0x6CE, 0x6CF, 0x6D0, 0x6D1, 0x6D2, 0x6D3, 0x6D4, 0x6D5, 0x6D6, 0x6D7, 0x6D8, 0x6D9, 0x6DA, 0x6DB, 0x6DC, 0x6DD, 0x6DE, 0x6DF, 0x6E0, 0x6E1, 0x6E2, 0x6E3, 0x6E4, 0x6E5, 0x6E6, 0x6E7, 0x6FC, 0x6FD, 0x6FE, 0x6FF };
+static const uint32_t qhy5_gain_map_size = (sizeof(qhy5_gain_map) / sizeof(uint32_t));
+
+/**
+ * @brief QHY5 class define
+ *
+ * include all functions for miniCam5s-m
+ */
+class QHY5:public QHYBASE
+{
+public:
+ QHY5();
+ ~QHY5();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera image bin mode
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopSingleExposure(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime)
+ @brief send the command to camera's guide port
+ @param h camera control handle
+ @param Direction RA DEC
+ @param PulseTime the time last for command
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime);
+
+ /**
+ @fn void SetGainMonoQHY5LII(double gain)
+ @brief set gain to camera,here it is the bottom
+ @param gain gain value
+ */
+ void SetGainMonoQHY5LII(qhyccd_handle *h,double gain);
+
+ /** @fn uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh)
+ @brief get the camera's ccd/cmos chip info
+ @param h camera control handle
+ @param chipw chip size width
+ @param chiph chip size height
+ @param imagew chip output image width
+ @param imageh chip output image height
+ @param pixelw chip pixel size width
+ @param pixelh chip pixel size height
+ @param bpp chip pixel depth
+ */
+ uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh,uint32_t *bpp);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ bool setParameters(qhyccd_handle *h,unsigned left, unsigned top, unsigned width, unsigned height, unsigned gain);
+private:
+ uint32_t bufferSize;
+ uint32_t flagquit,ryread;
+};
+#endif
diff --git a/include/qhy/qhy5hii.h b/include/qhy/qhy5hii.h new file mode 100644 index 0000000..f429f04 --- /dev/null +++ b/include/qhy/qhy5hii.h @@ -0,0 +1,177 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5hii.h
+ * @brief QHY5HII class define
+ */
+
+#include "qhy5iibase.h"
+
+
+#ifndef QHY5HII_DEF
+#define QHY5HII_DEF
+
+/**
+ * @brief QHY5HII class define
+ *
+ * include all functions for QHY5HII-m
+ */
+class QHY5HII:public QHY5IIBASE
+{
+public:
+ QHY5HII();
+ ~QHY5HII();
+ /**
+ @fn void InitCmos(qhyccd_handle *h)
+ @brief Init the registers
+ @param h camera control handle
+ */
+ void InitCmos(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetPll(qhyccd_handle *h,uint8_t clk);
+
+private:
+ uint32_t expmode; //!< expose time mode
+ uint32_t pllratio; //!< inter pll ratio
+ uint32_t longtimeflag;
+
+};
+#endif
diff --git a/include/qhy/qhy5ii.h b/include/qhy/qhy5ii.h new file mode 100644 index 0000000..73dc7ef --- /dev/null +++ b/include/qhy/qhy5ii.h @@ -0,0 +1,169 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5ii.h
+ * @brief QHY5II class define
+ */
+
+#include "qhy5iibase.h"
+
+#ifndef QHY5II_DEF
+#define QHY5II_DEF
+
+/**
+ * @brief QHY5II class define
+ *
+ * include all functions for qhy5ii
+ */
+class QHY5II:public QHY5IIBASE
+{
+public:
+ QHY5II();
+ virtual ~QHY5II();
+
+ uint32_t IsChipHasFunction(CONTROL_ID controlId);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetPll(qhyccd_handle *h,uint8_t clk);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ uint32_t DeChipRowNoise(qhyccd_handle *h,uint32_t value);
+
+private:
+
+private:
+ //uint32_t pllratio; //!< inter pll ratio
+ //uint32_t longtimeflag;
+ bool lastDelRoiNoise;
+};
+#endif
diff --git a/include/qhy/qhy5iibase.h b/include/qhy/qhy5iibase.h new file mode 100644 index 0000000..0e19efb --- /dev/null +++ b/include/qhy/qhy5iibase.h @@ -0,0 +1,172 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iibase.h
+ * @brief QHY5IIBASE class define
+ */
+
+#include "qhybase.h"
+
+#ifndef QHY5IIBASE_DEF
+#define QHY5IIBASE_DEF
+
+
+/**
+ * @brief QHY5RII_M class define
+ *
+ * include all functions for miniCam5s-m
+ */
+class QHY5IIBASE:public QHYBASE {
+public:
+ QHY5IIBASE();
+ virtual ~QHY5IIBASE();
+
+ static void ThreadCountExposureTime(void *p);
+ static void ThreadCancelExposingAndReadout(void *p);
+
+ virtual uint32_t BeginSingleExposure(qhyccd_handle *h);
+ virtual uint32_t CancelExposing(qhyccd_handle *handle);
+ virtual uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ virtual uint32_t BeginLiveExposure(qhyccd_handle *h);
+ virtual uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ virtual uint32_t GetSingleFrame(qhyccd_handle *h, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ virtual uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ void ThreadCountExposureTimeStart(void *p);
+ void ThreadCancelExposingAndReadoutStart(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera image bin mode
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime)
+ @brief send the command to camera's guide port
+ @param h camera control handle
+ @param Direction RA DEC
+ @param PulseTime the time last for command
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime);
+
+
+ /** @fn uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh)
+ @brief get the camera's ccd/cmos chip info
+ @param h camera control handle
+ @param chipw chip size width
+ @param chiph chip size height
+ @param imagew chip output image width
+ @param imageh chip output image height
+ @param pixelw chip pixel size width
+ @param pixelh chip pixel size height
+ @param bpp chip pixel depth
+ */
+ uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh,uint32_t *bpp);
+
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+ uint32_t SetGuideModeOnOff(qhyccd_handle *h,double mode);
+
+public:
+#ifdef WIN32
+ HANDLE hCountExpTimeThread;
+ HANDLE hCancelExposingAndReadoutThread;
+#endif
+ //uint32_t pllratio; //!< inter pll ratio
+ //uint32_t longtimeflag;
+ //uint32_t reg300c;
+ //uint32_t rgbgainb,rgbgainc;
+ //uint32_t rgbgainbluea,rgbgainreda;
+ //double wbred,wbblue,wbgreen;
+ //uint8_t islive;
+ uint8_t specialdropbychip;
+ uint8_t useGuideIn16bitMode;
+};
+#endif
diff --git a/include/qhy/qhy5iii128base.h b/include/qhy/qhy5iii128base.h new file mode 100644 index 0000000..6e65941 --- /dev/null +++ b/include/qhy/qhy5iii128base.h @@ -0,0 +1,129 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy367m.h
+ * @brief QHY367M class define
+ */
+
+
+#ifndef _QHY5III128BASE_
+#define _QHY5III128BASE_
+
+#include "qhy5iiicoolbase.h"
+
+class QHY5III128BASE:public QHY5IIICOOLBASE {
+
+public:
+ QHY5III128BASE();
+ ~QHY5III128BASE();
+
+#ifdef WIN32
+ static void ExposureThreadRoutine(void *pDevHandle);
+#else
+ static void *ExposureThreadRoutine(void *pDevHandle);
+#endif
+ void StartExposureThread(qhyccd_handle *pDevHandle);
+
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ uint32_t DisConnectCamera(qhyccd_handle *pHandle);
+
+ void CMOS_TakePhoto(qhyccd_handle *h);
+ uint32_t InitChipRegs(qhyccd_handle *h);
+ void SpiPath(qhyccd_handle *handle,uint8_t val);
+ void CMOSReset(qhyccd_handle *handle);
+ void FX3SPIMode(qhyccd_handle *handle);
+ void FPGASPIMode(qhyccd_handle *handle);
+ void SetFreqDiv(qhyccd_handle *handle,uint8_t val);
+ void IMX193_TakePhoto(qhyccd_handle *handle);
+ void SetFPGACrop(qhyccd_handle *handle,uint32_t x,uint32_t y);
+ void SetFPGAOutputBits(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSOffset(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSGain(qhyccd_handle *handle,uint32_t val);
+ void WriteFPGADigitalGain(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSAnalogGainRed(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSAnalogGainBlue(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSAnalogGainGreen(qhyccd_handle *handle,uint32_t val);
+ void AMPVControl(qhyccd_handle *handle,uint8_t val);
+ void InitSPISleep(qhyccd_handle *handle);
+ void WriteCMOS(qhyccd_handle *handle,uint16_t index,uint16_t val);
+ void WriteCMOSSHS(qhyccd_handle *handle,uint32_t val);
+ void SetCMOSCrop(qhyccd_handle *handle,uint32_t ystart,uint32_t ysize);
+ void SetSleepStart(qhyccd_handle *handle,uint16_t val);
+ void SetSleepEnd(qhyccd_handle *handle,uint16_t val);
+ void SetSleepFrames(qhyccd_handle *handle,uint16_t val);
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+ uint32_t SetChipBinMode(qhyccd_handle *h, uint32_t wbin, uint32_t hbin) ;
+
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+ void Sensor14bit_V_1_3(qhyccd_handle *h);
+ void Sensor10bit_V_1_3_h_3bin(qhyccd_handle *h);
+ void ResetParameters();
+ void UpdateParameters(qhyccd_handle *h);
+ uint32_t GeDDRBufferThreshold();
+ uint32_t GetUsedDdr(qhyccd_handle *pDevHandle, uint32_t *pDdr);
+private:
+#ifdef WIN32
+ HANDLE hCountExpTimeThread;
+#endif
+
+#ifdef LINUX
+ pthread_t m_expThreadHandle;
+#endif
+
+ double pllratio,oldpllratio; //!< inter pll ratio
+ uint32_t hmax_ref,vmax_ref;
+ uint32_t vmax,hmax,oldvmax,oldhmax;
+ uint32_t framelength,oldframelength;
+ uint32_t oldchipoutputsizex,oldchipoutputsizey,oldchipoutputbits;
+ uint32_t patchvnumber,oldpatchvnumber;
+ uint32_t shr,svr,spl,oldshr,oldsvr,oldspl;
+ double oldcamgain;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint8_t oldreg08,reg08,oldreg01,reg01;
+ uint8_t oldlockframe,lockframe;
+ uint8_t oldcamviewmode;
+ uint8_t oldcamampv;
+ uint16_t oldcamddr;
+ uint8_t forceupdate;
+ uint8_t locknum,oldlocknum;
+ double oldcamred2green,oldcamgreen,oldcamblue2green;
+ uint32_t sleepframes,oldsleepframes,initsingleframe;
+ uint32_t cutleftsize,cutrightsize,cuttopsize,cutbottomsize;
+ uint32_t ApproxDDR, ApproxDDR_Target;
+};
+#endif
diff --git a/include/qhy/qhy5iii163base.h b/include/qhy/qhy5iii163base.h new file mode 100644 index 0000000..8562b52 --- /dev/null +++ b/include/qhy/qhy5iii163base.h @@ -0,0 +1,95 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iiiddrcoolbase.h"
+
+#ifndef _QHY5III163BASE_
+#define _QHY5III163BASE_
+
+class QHY5III163BASE : public QHY5IIIDDRCOOLBASE {
+public:
+ QHY5III163BASE();
+ virtual ~QHY5III163BASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposing(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+ static void ExposureThreadRoutine(void *pDevHandle);
+ void StartExposureThread(qhyccd_handle *pDevHandle);
+
+ void writeCMOS(qhyccd_handle *pDevHandle, int addr, int value);
+ uint32_t GetUsedDdr(qhyccd_handle *pDevHandle, uint32_t *pDdr);
+ uint32_t SetChipGain(qhyccd_handle *pDevHandle, double gain);
+ uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+ uint32_t SetChipWBRed(qhyccd_handle *pDevHandle, double red);
+ uint32_t SetChipWBBlue(qhyccd_handle *pDevHandle, double blue);
+ uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle, double i);
+ void SetChipExposeTime_Internal(qhyccd_handle *pDevHandle,double i);
+
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId, double *min, double *max, double *step);
+ uint32_t SetChipOffset(qhyccd_handle *pDevHandle, double offset);
+ uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle, uint32_t bits);
+ uint32_t SetChipResolution(qhyccd_handle *pDevHandle, uint32_t x, uint32_t y, uint32_t xsize, uint32_t ysize);
+ uint32_t SetFocusSetting(qhyccd_handle *pDevHandle, uint32_t focusCenterX, uint32_t focusCenterY);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *pDevHandle,uint32_t i);
+ uint32_t GeDDRBufferThreshold();
+ void initcmos(qhyccd_handle *pDevHandle);
+ void UpdateParameters(qhyccd_handle *pDevHandle);
+ void ResetParameters();
+ void WriteCMOS(qhyccd_handle *pDevHandle,uint16_t index,uint16_t val);
+ void WriteCMOSSHS(qhyccd_handle *pDevHandle,uint32_t val);
+
+private:
+ uint8_t oldcamddr;
+ uint8_t oldlockframe, lockframe;
+ uint8_t oldampv_onff, ampv_onff;
+
+ uint16_t digital_gain, analog_gain;
+
+ uint32_t hmax_ref, vmax_ref;
+ uint32_t vmax, hmax, oldvmax, oldhmax;
+ uint32_t framelength, oldframelength;
+ uint32_t oldchipoutputsizex, oldchipoutputsizey, oldchipoutputbits;
+ uint32_t patchvnumber, oldpatchvnumber;
+ uint32_t oldeleshutter, eleshutter;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint32_t oldampv_min, ampv_min, oldampv_max, ampv_max;
+ uint32_t ApproxDDR;
+ uint32_t ApproxDDR_Target;
+ uint32_t shr,svr,spl; //,oldshr,oldsvr,oldspl; // not used
+ uint32_t sleepframes; //,oldsleepframes,sleepmode,initsingleframe; // not used
+ int imageY;
+ double pllratio, oldpllratio; //!< inter pll ratio
+ double m_oldcamgain;
+
+//#ifdef LINUX
+// pthread_t m_expThreadHandle;
+//#endif
+
+};
+#endif
diff --git a/include/qhy/qhy5iii165base.h b/include/qhy/qhy5iii165base.h new file mode 100644 index 0000000..d98637d --- /dev/null +++ b/include/qhy/qhy5iii165base.h @@ -0,0 +1,171 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#ifndef _QHY5III165BASE_
+#define _QHY5III165BASE_
+
+#include "qhy5iiicoolbase.h"
+
+class QHY5III165BASE : public QHY5IIICOOLBASE {
+public:
+ QHY5III165BASE();
+ ~QHY5III165BASE();
+
+#ifdef WIN32
+ static void ExposureThreadRoutine(void *pDevHandle);
+#else
+ static void *ExposureThreadRoutine(void *pDevHandle);
+#endif
+ void StartExposureThread(qhyccd_handle *pDevHandle);
+
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+
+ uint32_t GetUsedDdr(qhyccd_handle *pDevHandle, uint32_t *pDdr);
+ uint32_t InitChipRegs(qhyccd_handle *pDevHandle);
+ void InitRegs(qhyccd_handle *pDevHandle);
+ void UpdateParameters(qhyccd_handle *pDevHandle);
+ void ResetParameters();
+ void InitSPISleep(qhyccd_handle *pDevHandle);
+ void WriteCMOSSHS(qhyccd_handle *pDevHandle, int32_t val);
+ void SetCMOSCrop(qhyccd_handle *pDevHandle, uint32_t ystart, uint32_t ysize);
+ uint32_t SetDDR(qhyccd_handle *pDevHandle, double value);
+ void SetFreqDiv(qhyccd_handle *pDevHandle, uint8_t val);
+ void CalcFreqDiv(qhyccd_handle *pDevHandle);
+ void WriteCMOSAnalogGainRed(qhyccd_handle *pDevHandle, uint16_t val);
+ void WriteCMOSAnalogGainGreen(qhyccd_handle *pDevHandle, uint16_t val);
+ void WriteCMOSAnalogGainBlue(qhyccd_handle *pDevHandle, uint16_t val);
+ void WriteCMOSOffset(qhyccd_handle *pDevHandle, uint16_t val);
+ void WriteFPGADigitalGain(qhyccd_handle *pDevHandle, uint16_t val);
+
+ uint32_t GeDDRBufferThreshold();
+ void FX3SPIMode(qhyccd_handle *pDevHandle);
+ void FPGASPIMode(qhyccd_handle *pDevHandle);
+ void WriteCMOS(qhyccd_handle *pDevHandle, uint16_t index, uint16_t val);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *pDevHandle, double gain);
+ uint32_t SetChipWBRed(qhyccd_handle *pDevHandle, double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *pDevHandle, double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *pDevHandle, double blue);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle, double i);
+
+ void SetChipExposeTime_Internal(qhyccd_handle *pDevHandle, double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+ uint32_t SetChipOffset(qhyccd_handle *pDevHandle, double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle, uint32_t bits);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *pDevHandle, uint32_t i);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *pDevHandle, uint32_t x, uint32_t y, uint32_t xsize, uint32_t ysize);
+
+private:
+//#ifdef WIN32
+// HANDLE hCountExpTimeThread;
+//#endif
+
+#ifdef LINUX
+ pthread_t m_expThreadHandle;
+#endif
+
+ double pllratio,oldpllratio;
+ double oldcamred2green,oldcamgreen,oldcamblue2green,oldcamgain;
+ double oldcamampv;
+ // double oldframetime,frametime;
+ // double oldcamtime;
+
+ uint32_t hmax_ref,vmax_ref;
+ uint32_t vmax,hmax,oldvmax,oldhmax;
+ uint32_t framelength,oldframelength;
+ uint32_t oldchipoutputsizex,oldchipoutputsizey,oldchipoutputbits;
+ uint32_t patchvnumber,oldpatchvnumber;
+ uint32_t oldcamoffset;
+ //uint32_t oldusbtraffic;
+ uint32_t initsingleframe;
+ uint32_t cutleftsize,cutrightsize,cuttopsize,cutbottomsize;
+
+ uint32_t shr,svr,spl,oldshr,oldsvr,oldspl;
+
+ uint16_t oldsleepframes, sleepframes, oldcamddr;
+
+ uint8_t oldreg08,reg08,oldreg01,reg01;
+ uint8_t oldlockframe,lockframe;
+ //uint32_t ApproxDDR, ApproxDDR_Target;
+};
+#endif
diff --git a/include/qhy/qhy5iii168base.h b/include/qhy/qhy5iii168base.h new file mode 100644 index 0000000..e05012d --- /dev/null +++ b/include/qhy/qhy5iii168base.h @@ -0,0 +1,157 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#ifndef _QHY5III168BASE_
+#define _QHY5III168BASE_
+
+#include "qhy5iiicoolbase.h"
+
+class QHY5III168BASE:public QHY5IIICOOLBASE {
+public:
+ QHY5III168BASE();
+ ~QHY5III168BASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+
+ static void ThreadCountExposureTime(void *pDevHandle);
+ void ThreadCountExposureTimeStart(qhyccd_handle *pDevHandle);
+
+ uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+ void UpdateParameters(qhyccd_handle *pDevHandle);
+ void ResetParameters();
+ uint32_t GeDDRBufferThreshold() ;
+ uint32_t GetUsedDdr(qhyccd_handle *pDevHandle, uint32_t *pDdr);
+ uint32_t InitChipRegs(qhyccd_handle *pDevHandle);
+ void SetFreqDiv(qhyccd_handle *pDevHandle,uint8_t val);
+ void IMX071_TakePhoto(qhyccd_handle *pDevHandle);
+ void WriteCMOSOffset(qhyccd_handle *pDevHandle,uint32_t val);
+ void WriteCMOSAnalogGainRed(qhyccd_handle *pDevHandle,uint32_t val);
+ void WriteCMOSAnalogGainBlue(qhyccd_handle *pDevHandle,uint32_t val);
+ void WriteCMOSAnalogGainGreen(qhyccd_handle *pDevHandle,uint32_t val);
+ void InitSPISleep(qhyccd_handle *pDevHandle);
+ void FX3SPIMode(qhyccd_handle *pDevHandle);
+ void FPGASPIMode(qhyccd_handle *pDevHandle);
+ void WriteCMOS(qhyccd_handle *pDevHandle,uint16_t index,uint16_t val);
+ void WriteCMOSSHS(qhyccd_handle *pDevHandle,uint32_t val);
+ void SetCMOSCrop(qhyccd_handle *pDevHandle,uint32_t ystart,uint32_t ysize);
+ uint32_t SetDDR(qhyccd_handle *pDevHandle, double value);
+ void CalcFreqDiv(qhyccd_handle *pDevHandle);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *pDevHandle,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *pDevHandle,double gain);
+ uint32_t SetChipWBRed(qhyccd_handle *pDevHandle,double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *pDevHandle,double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *pDevHandle,double blue);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle,double i);
+ void SetChipExposeTime_Internal(qhyccd_handle *pDevHandle,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId, double *min,double *max,double *step);
+ uint32_t SetChipOffset(qhyccd_handle *pDevHandle,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle,uint32_t bits);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *pDevHandle,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *pDevHandle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *pDevHandle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+private:
+ uint8_t oldlockframe,lockframe;
+ uint8_t digitalgain,olddigitalgain;
+ uint8_t oldcamviewmode;
+
+ uint32_t hmax_ref,vmax_ref;
+ uint32_t vmax,hmax,oldvmax,oldhmax;
+ uint32_t vmax_valid,oldvmax_valid,hmax_valid,oldhmax_valid;
+ uint32_t framelength,oldframelength;
+ uint32_t oldchipoutputsizex,oldchipoutputsizey,oldchipoutputbits;
+ uint32_t patchvnumber,oldpatchvnumber;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint32_t sleepframes,initsingleframe; //,oldsleepframes,sleepmode
+ uint32_t cutleftsize,cutrightsize1,cutrightsize2,cuttopsize1,cuttopsize2,cutbottomsize; //,cutbuttomsize;
+
+ uint32_t shr,svr,spl,oldshr,oldsvr,oldspl;
+ uint16_t oldcamddr;
+ uint32_t ApproxDDR;
+ uint32_t ApproxDDR_Target;
+ int flag_after_roi_change;
+
+ double oldcamgain; // oldcamblue2green,oldcamred2green,oldcamgreen,
+ double pllratio,oldpllratio; //!< inter pll ratio
+};
+
+#endif
diff --git a/include/qhy/qhy5iii174base.h b/include/qhy/qhy5iii174base.h new file mode 100644 index 0000000..3326836 --- /dev/null +++ b/include/qhy/qhy5iii174base.h @@ -0,0 +1,114 @@ + /*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iiicoolbase.h"
+
+#ifndef QHY5III174BASE_DEF
+#define QHY5III174BASE_DEF
+
+class QHY5III174BASE : public QHY5IIICOOLBASE {
+public:
+ QHY5III174BASE();
+ ~QHY5III174BASE();
+
+ //uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ double pllratio;
+ uint32_t hmax_ref, vmax_ref;
+};
+#endif
diff --git a/include/qhy/qhy5iii174c.h b/include/qhy/qhy5iii174c.h new file mode 100644 index 0000000..946ae29 --- /dev/null +++ b/include/qhy/qhy5iii174c.h @@ -0,0 +1,54 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii174base.h"
+
+#ifndef QHY5III174_C_DEF
+#define QHY5III174_C_DEF
+
+class QHY5III174C : public QHY5III174BASE {
+public:
+ QHY5III174C();
+ ~QHY5III174C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy5iii174m.h b/include/qhy/qhy5iii174m.h new file mode 100644 index 0000000..267ef5a --- /dev/null +++ b/include/qhy/qhy5iii174m.h @@ -0,0 +1,54 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii174base.h"
+
+#ifndef QHY5III174_M_DEF
+#define QHY5III174_M_DEF
+
+class QHY5III174M : public QHY5III174BASE {
+public:
+ QHY5III174M();
+ ~QHY5III174M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy5iii178base.h b/include/qhy/qhy5iii178base.h new file mode 100644 index 0000000..3cb14d0 --- /dev/null +++ b/include/qhy/qhy5iii178base.h @@ -0,0 +1,116 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iiicoolbase.h"
+
+#ifndef QHY5III178BASE_DEF
+#define QHY5III178BASE_DEF
+
+class QHY5III178BASE:public QHY5IIICOOLBASE {
+public:
+ QHY5III178BASE();
+ ~QHY5III178BASE();
+
+ //uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+private:
+ double pllratio;
+ uint32_t hmax_ref, vmax_ref;
+};
+#endif
diff --git a/include/qhy/qhy5iii178c.h b/include/qhy/qhy5iii178c.h new file mode 100644 index 0000000..107e3c9 --- /dev/null +++ b/include/qhy/qhy5iii178c.h @@ -0,0 +1,47 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii178base.h"
+
+#ifndef QHY5III178C_DEF
+#define QHY5III178C_DEF
+
+class QHY5III178C:public QHY5III178BASE {
+public:
+ QHY5III178C();
+ ~QHY5III178C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy5iii178coolbase.h b/include/qhy/qhy5iii178coolbase.h new file mode 100644 index 0000000..48a85d3 --- /dev/null +++ b/include/qhy/qhy5iii178coolbase.h @@ -0,0 +1,73 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iii178coolbase.h
+ * @brief QHY5III178COOLBASE_DEF class define
+ */
+
+#ifndef _QHY5III178COOLBASE_
+#define _QHY5III178COOLBASE_
+
+#include "qhy5iiiddrcoolbase.h"
+
+/**
+ * @brief QHY5III178COOLBASE_DEF class define
+ *
+ * include all functions for qhy5iii178base
+ */
+class QHY5III178COOLBASE:public QHY5IIIDDRCOOLBASE {
+public:
+ QHY5III178COOLBASE();
+ ~QHY5III178COOLBASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+ uint32_t CancelExposing(qhyccd_handle *h);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ uint32_t GetSingleFrame(qhyccd_handle *h, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ void WriteCMOS(qhyccd_handle *handle,uint16_t index,uint16_t val);
+ void WriteCMOSSHS(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSOffset(qhyccd_handle *handle,uint32_t val);
+ void WriteCMOSGain(qhyccd_handle *handle,uint32_t val);
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+ static void ThreadCountExposureTime(void *p);
+ void ThreadCountExposureTimeStart(qhyccd_handle *h);
+ uint32_t GeDDRBufferThreshold();
+
+private:
+ unsigned int ApproxDDR;
+ unsigned int ApproxDDR_Target;
+};
+
+#endif
diff --git a/include/qhy/qhy5iii178m.h b/include/qhy/qhy5iii178m.h new file mode 100644 index 0000000..4fb28cb --- /dev/null +++ b/include/qhy/qhy5iii178m.h @@ -0,0 +1,47 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii178base.h"
+
+#ifndef QHY5III178M_DEF
+#define QHY5III178M_DEF
+
+class QHY5III178M:public QHY5III178BASE {
+public:
+ QHY5III178M();
+ ~QHY5III178M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy5iii183base.h b/include/qhy/qhy5iii183base.h new file mode 100644 index 0000000..c37b4c6 --- /dev/null +++ b/include/qhy/qhy5iii183base.h @@ -0,0 +1,99 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#ifndef _QHY5III183BASE_
+#define _QHY5III183BASE_
+
+#include "qhy5iiicoolbase.h"
+
+#define TOTAL_PIXELS_WIDTH 5640
+#define TOTAL_PIXELS_HEIGHT 3710
+
+class QHY5III183BASE:public QHY5IIICOOLBASE {
+public:
+ QHY5III183BASE();
+ ~QHY5III183BASE();
+/*
+ #ifdef WIN32
+ static void ExposureThreadRoutine(void *pDevHandle);
+ #else
+ static void *ExposureThreadRoutine(void *pDevHandle);
+ #endif
+ void StartExposureThread(qhyccd_handle *pDevHandle);
+*/
+// uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposing(qhyccd_handle *pDevHandle);
+
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+
+// uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+ uint32_t GetLiveFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t *pBpp, uint32_t *pChannels, uint8_t *pImgData);
+
+ uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+
+ uint32_t InitChipRegs(qhyccd_handle *pDevHandle);
+ uint32_t SetChipGain(qhyccd_handle *pDevHandle,double gain);
+ uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle, double i);
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min, double *max, double *step);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *pDevHandle,uint32_t i);
+ uint32_t SetChipOffset(qhyccd_handle *pDevHandle,double offset);
+ uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle,uint32_t bits);
+ uint32_t SetChipResolution(qhyccd_handle *pDevHandle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+ uint32_t SetFocusSetting(qhyccd_handle *pDevHandle,uint32_t focusCenterX, uint32_t focusCenterY);
+ uint32_t SetStreamMode(qhyccd_handle *pDevHandle,uint8_t mode);
+ uint32_t GetUsedDdr(qhyccd_handle *pDevHandle, uint32_t *pDdr);
+ void UpdateParameters(qhyccd_handle *pDevHandle);
+ void ResetParameters();
+ void WriteCMOS(qhyccd_handle *pDevHandle,uint16_t index,uint16_t val);
+
+protected:
+
+#ifdef LINUX
+ pthread_t m_expThreadHandle;
+#endif
+
+ double oldcamgain;
+ double pllratio, oldpllratio;
+
+ uint8_t oldcamddr;
+ uint8_t oldlockframe, lockframe;
+ uint8_t oldampv_onff, ampv_onff;
+ uint8_t forcestop;
+
+ uint16_t vwinpos, oldvwinpos, vwidcut, oldvwidcut;
+
+ uint32_t hmax_ref, vmax_ref;
+ uint32_t vmax,hmax, oldvmax, oldhmax;
+ uint32_t framelength, oldframelength;
+ uint32_t oldchipoutputsizex, oldchipoutputsizey, oldchipoutputbits;
+ uint32_t patchvnumber, oldpatchvnumber;
+ uint32_t shr, svr, spl, oldshr, oldsvr, oldspl;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint32_t oldampv_min, ampv_min, oldampv_max, ampv_max;
+ uint32_t ApproxDDR, ApproxDDR_Target;
+};
+#endif
diff --git a/include/qhy/qhy5iii185base.h b/include/qhy/qhy5iii185base.h new file mode 100644 index 0000000..754b146 --- /dev/null +++ b/include/qhy/qhy5iii185base.h @@ -0,0 +1,124 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iii185c.h
+ * @brief QHY5III185C class define
+ */
+
+#include "qhy5iiicoolbase.h"
+
+#ifndef QHY5III185BASE_DEF
+#define QHY5III185BASE_DEF
+
+
+/**
+ * @brief QHY5III185C class define
+ *
+ * include all functions for qhy5iii185c
+ */
+class QHY5III185BASE:public QHY5IIICOOLBASE
+{
+public:
+ QHY5III185BASE();
+ ~QHY5III185BASE();
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ double pllratio; //!< inter pll ratio
+ uint32_t longtimeflag;
+ uint32_t hmax_ref,vmax_ref;
+};
+#endif
diff --git a/include/qhy/qhy5iii185c.h b/include/qhy/qhy5iii185c.h new file mode 100644 index 0000000..f1c9090 --- /dev/null +++ b/include/qhy/qhy5iii185c.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iii185c.h
+ * @brief QHY5III185C class define
+ */
+
+#include "qhy5iii185base.h"
+
+#ifndef QHY5III185_C_DEF
+#define QHY5III185_C_DEF
+
+
+/**
+ * @brief QHY5III185C class define
+ *
+ * include all functions for qhy5iii185c
+ */
+class QHY5III185C:public QHY5III185BASE
+{
+public:
+ QHY5III185C();
+ ~QHY5III185C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy5iii224base.h b/include/qhy/qhy5iii224base.h new file mode 100644 index 0000000..963924d --- /dev/null +++ b/include/qhy/qhy5iii224base.h @@ -0,0 +1,126 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy224c.h
+ * @brief QHY224C class define
+ */
+
+#include "qhy5iiicoolbase.h"
+
+#ifndef QHY5III224BASE_DEF
+#define QHY5III224BASE_DEF
+
+
+/**
+ * @brief QHY224C class define
+ *
+ * include all functions for qhy224c
+ */
+class QHY5III224BASE:public QHY5IIICOOLBASE
+{
+public:
+ QHY5III224BASE();
+ ~QHY5III224BASE();
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ double pllratio; //!< inter pll ratio
+ uint32_t longtimeflag;
+
+ uint32_t hmax_ref,vmax_ref;
+};
+#endif
diff --git a/include/qhy/qhy5iii224c.h b/include/qhy/qhy5iii224c.h new file mode 100644 index 0000000..6bca143 --- /dev/null +++ b/include/qhy/qhy5iii224c.h @@ -0,0 +1,66 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iii224c.h
+ * @brief QHY5III224C class define
+ */
+
+#include "qhy5iii224base.h"
+
+#ifndef QHY5III224_C_DEF
+#define QHY5III224_C_DEF
+
+
+/**
+ * @brief QHY5III224C class define
+ *
+ * include all functions for qhy5iii174m
+ */
+class QHY5III224C:public QHY5III224BASE
+{
+public:
+ QHY5III224C();
+ ~QHY5III224C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+};
+#endif
diff --git a/include/qhy/qhy5iii224coolbase.h b/include/qhy/qhy5iii224coolbase.h new file mode 100644 index 0000000..9c4e3e8 --- /dev/null +++ b/include/qhy/qhy5iii224coolbase.h @@ -0,0 +1,121 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy224c.h
+ * @brief QHY224C class define
+ */
+
+#include "qhy5iiiddrcoolbase.h"
+
+#ifndef QHY5III224COOLBASE_DEF
+#define QHY5III224COOLBASE_DEF
+
+
+/**
+ * @brief QHY224C class define
+ *
+ * include all functions for qhy224c
+ */
+class QHY5III224COOLBASE:public QHY5IIIDDRCOOLBASE
+{
+public:
+ QHY5III224COOLBASE();
+ ~QHY5III224COOLBASE();
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+};
+#endif
diff --git a/include/qhy/qhy5iii236c.h b/include/qhy/qhy5iii236c.h new file mode 100644 index 0000000..12ecb1e --- /dev/null +++ b/include/qhy/qhy5iii236c.h @@ -0,0 +1,131 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iii236c.h
+ * @brief QHY5III236C class define
+ */
+
+#include "qhybase.h"
+
+#ifndef QHY5III236C_DEF
+#define QHY5III236C_DEF
+
+
+/**
+ * @brief QHY5III236C class define
+ *
+ * include all functions for qhy5iii236c
+ */
+class QHY5III236C:public QHYBASE
+{
+public:
+ QHY5III236C();
+ ~QHY5III236C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+};
+#endif
diff --git a/include/qhy/qhy5iii247base.h b/include/qhy/qhy5iii247base.h new file mode 100644 index 0000000..f0644d1 --- /dev/null +++ b/include/qhy/qhy5iii247base.h @@ -0,0 +1,149 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#ifndef _QHY5III247BASE_
+#define _QHY5III247BASE_
+
+#include "qhy5iiicoolbase.h"
+
+class QHY5III247BASE:public QHY5IIICOOLBASE {
+public:
+ QHY5III247BASE();
+ ~QHY5III247BASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDeviceHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDeviceHandle);
+ uint32_t GetSingleFrame(qhyccd_handle *pDeviceHandle, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+
+ static void ThreadCountExposureTime(void *p);
+ void ThreadCountExposureTimeStart(qhyccd_handle *pDeviceHandle);
+ uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+
+ uint32_t InitChipRegs(qhyccd_handle *pDeviceHandle);
+ void UpdateParameters(qhyccd_handle *pDeviceHandle);
+ void ResetParameters();
+ void FX3SPIMode(qhyccd_handle *pDeviceHandle);
+ void FPGASPIMode(qhyccd_handle *pDeviceHandle);
+ void SetFreqDiv(qhyccd_handle *pDeviceHandle, uint8_t val);
+ void IMX193_TakePhoto(qhyccd_handle *pDeviceHandle);
+ void SetFPGACrop(qhyccd_handle *pDeviceHandle, uint32_t x, uint32_t y);
+ void WriteCMOSOffset(qhyccd_handle *pDeviceHandle, uint32_t val);
+ void WriteCMOSGain(qhyccd_handle *pDeviceHandle, uint32_t val);
+ void InitSPISleep(qhyccd_handle *pDeviceHandle);
+ void WriteCMOS(qhyccd_handle *pDeviceHandle, uint16_t index, uint16_t val);
+ void WriteCMOSSHS(qhyccd_handle *pDeviceHandle, uint32_t val);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *pDeviceHandle, double gain);
+ uint32_t SetChipWBRed(qhyccd_handle *pDeviceHandle, double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *pDeviceHandle, double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *pDeviceHandle, double blue);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *pDeviceHandle,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ void SetChipExposeTime_Internal(qhyccd_handle *pDeviceHandle, double i);
+ uint32_t SetChipExposeTime(qhyccd_handle *pDeviceHandle, double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min, double *max, double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *pDeviceHandle, double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *pDeviceHandle,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *pDeviceHandle, uint32_t bits);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *pDeviceHandle, uint32_t i);
+ void SetCMOSCrop(qhyccd_handle *pDeviceHandle, uint32_t ystart, uint32_t ysize);
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *pDeviceHandle, uint32_t x, uint32_t y, uint32_t xsize, uint32_t ysize);
+
+private:
+ double pllratio,oldpllratio;
+ double /*oldcamblue2green,oldcamred2green,oldcamgreen,*/ oldcamgain;
+ uint32_t hmax_ref,vmax_ref;
+ uint32_t vmax,hmax,oldvmax,oldhmax;
+ uint32_t vmax_valid,oldvmax_valid,hmax_valid,oldhmax_valid;
+ uint32_t framelength,oldframelength;
+ uint32_t oldchipoutputsizex,oldchipoutputsizey,oldchipoutputbits;
+ uint32_t patchvnumber,oldpatchvnumber;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint32_t sleepframes,oldsleepframes,initsingleframe;
+ uint32_t cutleftsize,cutrightsize,cuttopsize,cutbottomsize;
+ uint32_t shr,svr,spl,oldshr,oldsvr,oldspl;
+ uint16_t oldcamddr;
+ uint8_t oldlockframe,lockframe;
+ uint8_t digitalgain,olddigitalgain;
+ uint8_t oldcamviewmode;
+ uint32_t ApproxDDR;
+ uint32_t ApproxDDR_Target;
+ int flag_after_roi_change;
+};
+
+#endif
diff --git a/include/qhy/qhy5iii290base.h b/include/qhy/qhy5iii290base.h new file mode 100644 index 0000000..5914065 --- /dev/null +++ b/include/qhy/qhy5iii290base.h @@ -0,0 +1,151 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#define JS
+
+#include "qhy5iiicoolbase.h"
+
+#ifndef QHY5III290BASE_DEF
+#define QHY5III290BASE_DEF
+
+class QHY5III290BASE:public QHY5IIICOOLBASE {
+public:
+ QHY5III290BASE();
+ ~QHY5III290BASE();
+
+#ifndef JS
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposing(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+#endif
+
+ //uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+ void ResetParameters();
+ void UpdateParameters(qhyccd_handle *pDevHandle);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *pDevHandle, double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle, double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId, double *min, double *max, double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *pDevHandle, double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle, uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *pDevHandle, uint32_t x, uint32_t y, uint32_t xsize, uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *pDevHandle, uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ double pllratio;
+ uint32_t hmax_ref, vmax_ref;
+
+
+ double oldpllratio;
+ //double oldtotalcamred2green, totalcamred2green, oldtotalcamgreen, totalcamgreen;
+ double /*oldtotalcamblue2green, totalcamblue2green,*/ oldcamgain;
+ double oldcamampv;
+
+ int32_t shs, oldshs; //svr, spl, oldsvr, oldspl not used
+
+ uint32_t vmax, hmax, oldvmax, oldhmax;
+ //uint32_t vmax_valid, hmax_valid, oldvmax_valid, oldhmax_valid;
+ //uint32_t framelength, oldframelength;
+ uint32_t oldchipoutputsizex, oldchipoutputsizey, oldchipoutputbits;
+ //uint32_t patchvnumber, oldpatchvnumber;
+ uint32_t oldcamoffset;
+ //uint32_t oldusbtraffic;
+ uint32_t ampv_min, oldampv_min, ampv_max, oldampv_max;
+
+ //uint16_t chiproiy, oldchiproiy, chiproiysize, oldchiproiysize;
+ uint16_t winph, oldwinph, winwh, oldwinwh, winpv, oldwinpv, winwv, oldwinwv;
+
+ //uint8_t oldreg08, reg08, oldreg01, reg01;
+ //uint8_t oldlockframe, lockframe;
+ //uint8_t oldcamviewmode;
+
+};
+#endif
diff --git a/include/qhy/qhy5iii290c.h b/include/qhy/qhy5iii290c.h new file mode 100644 index 0000000..03e1398 --- /dev/null +++ b/include/qhy/qhy5iii290c.h @@ -0,0 +1,47 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii290base.h"
+
+#ifndef QHY5III290C_DEF
+#define QHY5III290C_DEF
+
+class QHY5III290C:public QHY5III290BASE {
+public:
+ QHY5III290C();
+ ~QHY5III290C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t GetChipMemoryLength();
+};
+#endif
diff --git a/include/qhy/qhy5iii290coolbase.h b/include/qhy/qhy5iii290coolbase.h new file mode 100644 index 0000000..edd779e --- /dev/null +++ b/include/qhy/qhy5iii290coolbase.h @@ -0,0 +1,110 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iiiddrcoolbase.h"
+
+#ifndef QHY5III290COOLBASE_DEF
+#define QHY5III290COOLBASE_DEF
+
+class QHY5III290COOLBASE:public QHY5IIIDDRCOOLBASE {
+public:
+ QHY5III290COOLBASE();
+ ~QHY5III290COOLBASE();
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+ void writeCMOS(qhyccd_handle *h,unsigned short index,unsigned char value);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
diff --git a/include/qhy/qhy5iii290m.h b/include/qhy/qhy5iii290m.h new file mode 100644 index 0000000..1cf9457 --- /dev/null +++ b/include/qhy/qhy5iii290m.h @@ -0,0 +1,48 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iii290base.h"
+
+#ifndef QHY5III290M_DEF
+#define QHY5III290M_DEF
+
+class QHY5III290M:public QHY5III290BASE {
+public:
+ QHY5III290M();
+ ~QHY5III290M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ uint32_t GetChipMemoryLength();
+
+};
+#endif
diff --git a/include/qhy/qhy5iii367base.h b/include/qhy/qhy5iii367base.h new file mode 100644 index 0000000..5b619d9 --- /dev/null +++ b/include/qhy/qhy5iii367base.h @@ -0,0 +1,189 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#ifndef _QHY5III367BASE_
+#define _QHY5III367BASE_
+
+#include "qhy5iiicoolbase.h"
+
+class QHY5III367BASE:public QHY5IIICOOLBASE {
+public:
+ QHY5III367BASE();
+ ~QHY5III367BASE();
+
+#ifdef WIN32
+ static void ExposureThreadRoutine(void *pDevHandle);
+#else
+ static void *ExposureThreadRoutine(void *pDevHandle);
+#endif
+ void StartExposureThread(qhyccd_handle *pDevHandle);
+
+ uint32_t GetSingleFrame(qhyccd_handle *pDevHandle, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ uint32_t BeginSingleExposure(qhyccd_handle *pDevHandle);
+ uint32_t BeginLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t StopLiveExposure(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+ uint32_t DisConnectCamera(qhyccd_handle *pDevHandle);
+
+ void CMOS_TakePhoto(qhyccd_handle *pDevHandle);
+ uint32_t InitChipRegs(qhyccd_handle *pDevHandle);
+ void SpiPath(qhyccd_handle *pDevHandle, uint8_t val);
+ void CMOSReset(qhyccd_handle *pDevHandle);
+ void FX3SPIMode(qhyccd_handle *pDevHandle);
+ void FPGASPIMode(qhyccd_handle *pDevHandle);
+ void SetFreqDiv(qhyccd_handle *pDevHandle, uint8_t val);
+ void IMX193_TakePhoto(qhyccd_handle *pDevHandle);
+ void SetFPGACrop(qhyccd_handle *pDevHandle, uint32_t x, uint32_t y);
+ void SetFPGAOutputBits(qhyccd_handle *pDevHandle, uint32_t val);
+ void WriteCMOSOffset(qhyccd_handle *pDevHandle, uint32_t val);
+ void WriteCMOSGain(qhyccd_handle *pDevHandle, uint32_t val);
+ void WriteFPGADigitalGain(qhyccd_handle *pDevHandle, uint32_t val);
+ void WriteCMOSAnalogGainRed(qhyccd_handle *pDevHandle, uint32_t val);
+ void WriteCMOSAnalogGainBlue(qhyccd_handle *pDevHandle, uint32_t val);
+ void WriteCMOSAnalogGainGreen(qhyccd_handle *pDevHandle, uint32_t val);
+ void AMPVControl(qhyccd_handle *pDevHandle, uint8_t val);
+ void InitSPISleep(qhyccd_handle *pDevHandle);
+ void WriteCMOS(qhyccd_handle *pDevHandle, uint16_t index, uint16_t val);
+ void WriteCMOSSHS(qhyccd_handle *pDevHandle, uint32_t val);
+ void SetCMOSCrop(qhyccd_handle *pDevHandle, uint32_t ystart, uint32_t ysize);
+ void SetSleepStart(qhyccd_handle *pDevHandle, uint16_t val);
+ void SetSleepEnd(qhyccd_handle *pDevHandle, uint16_t val);
+ void SetSleepFrames(qhyccd_handle *pDevHandle, uint16_t val);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *pDevHandle, double gain);
+ uint32_t SetChipWBRed(qhyccd_handle *pDevHandle, double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *pDevHandle, double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *pDevHandle, double blue);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *pDevHandle, uint32_t i);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *pDevHandle, double i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId, double *min, double *max, double *step);
+ uint32_t SetChipOffset(qhyccd_handle *pDevHandle, double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *pDevHandle, uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *pDevHandle, uint32_t x, uint32_t y, uint32_t xsize, uint32_t ysize);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *pDevHandle, uint32_t focusCenterX, uint32_t focusCenterY);
+ void Sensor14bit_V_1_3(qhyccd_handle *pDevHandle);
+ void Sensor10bit_V_1_3_h_3bin(qhyccd_handle *pDevHandle);
+ void ResetParameters();
+ void UpdateParameters(qhyccd_handle *pDevHandle);
+ uint32_t GeDDRBufferThreshold();
+
+private:
+#ifdef WIN32
+ HANDLE hCountExpTimeThread;
+#endif
+
+#ifdef LINUX
+ pthread_t m_expThreadHandle;
+#endif
+
+ double pllratio, oldpllratio;
+ double oldcamgain;
+ double oldcamred2green, oldcamgreen, oldcamblue2green;
+
+ uint32_t hmax_ref, vmax_ref;
+ uint32_t vmax,hmax, oldvmax, oldhmax;
+ uint32_t framelength, oldframelength;
+ uint32_t oldchipoutputsizex, oldchipoutputsizey, oldchipoutputbits;
+ uint32_t patchvnumber, oldpatchvnumber;
+ uint32_t oldcamoffset;
+ uint32_t oldusbtraffic;
+ uint32_t sleepframes, oldsleepframes, initsingleframe;
+ uint32_t cutleftsize, cutrightsize, cuttopsize, cutbottomsize;
+
+ uint32_t shr, svr, spl, oldshr, oldsvr, oldspl;
+
+ uint16_t oldcamddr;
+
+ uint8_t oldreg08, reg08, oldreg01, reg01;
+ uint8_t oldlockframe, lockframe;
+ uint8_t oldcamviewmode;
+ uint8_t oldcamampv;
+ uint8_t forceupdate;
+ uint8_t locknum, oldlocknum;
+};
+#endif
diff --git a/include/qhy/qhy5iiibase.h b/include/qhy/qhy5iiibase.h new file mode 100644 index 0000000..acfd912 --- /dev/null +++ b/include/qhy/qhy5iiibase.h @@ -0,0 +1,116 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy5iiibase.h
+ * @brief QHYCCD QHY5IIIBASE class define
+ */
+
+#include "qhycam.h"
+#include "qhyccdcamdef.h"
+#include "qhyccderr.h"
+#include "log4z.h"
+#include "cmosdll.h"
+#include "stdint.h"
+#include "qhybase.h"
+
+#ifdef LINUX
+#include <pthread.h>
+#endif
+
+#ifndef __QHY5IIIBASEDEF_H__
+#define __QHY5IIIBASEDEF_H__
+
+/**
+ * the QHY5IIIBASE class description
+ */
+class QHY5IIIBASE : public QHYBASE {
+public:
+ QHY5IIIBASE();
+ virtual ~QHY5IIIBASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+ uint32_t CancelExposing(qhyccd_handle *handle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+ uint32_t InitChipRegs(qhyccd_handle *h);
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+ static void ThreadCancelExposingAndReadout(void *p);
+ void ThreadCancelExposingAndReadoutStart(qhyccd_handle *h);
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+ uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime);
+ void DDRResetControl(qhyccd_handle *handle,uint8_t val);
+ void ClearDDRPulse(qhyccd_handle *handle);
+ void SetDDRFullSize(qhyccd_handle *handle,uint32_t val);
+ void WriteFPGA(qhyccd_handle *handle,uint16_t index,uint16_t val);
+ void SetSleepStart(qhyccd_handle *handle,uint16_t val);
+ void SetSleepEnd(qhyccd_handle *handle,uint16_t val);
+ void SetSleepFrames(qhyccd_handle *handle,uint16_t val);
+ void SpiPath(qhyccd_handle *handle,uint8_t val);
+ void SetIDLE(qhyccd_handle *handle);
+ void ReleaseIDLE(qhyccd_handle *handle);
+ void CMOSReset(qhyccd_handle *handle);
+ void EnableLock(qhyccd_handle *handle);
+ void DisableLock(qhyccd_handle *handle);
+ void SetLockFrames(qhyccd_handle *handle,uint16_t val);
+ void IgnoreFrames(qhyccd_handle *handle,uint8_t val);
+ void SetPatchVPosition(qhyccd_handle *handle,uint32_t val);
+ void SetPatchFramePosition(qhyccd_handle *handle,uint8_t val);
+ void EnableDDR(qhyccd_handle *handle);
+ void DisableDDR(qhyccd_handle *handle);
+ void EnableReadFromDDR(qhyccd_handle *handle);
+ void DisableReadFromDDR(qhyccd_handle *handle);
+ unsigned int readDDRNum(qhyccd_handle *handle);
+ void SetHMAX(qhyccd_handle *handle,uint32_t val);
+ void SetVMAX(qhyccd_handle *handle,uint32_t val);
+ void AMPVControl(qhyccd_handle *handle,uint8_t val);
+ void SetAMPVStartPosition(qhyccd_handle *handle,uint32_t val);
+ void SetAMPVEndPosition(qhyccd_handle *handle,uint32_t val);
+ void SetFPGAOutputBits(qhyccd_handle *handle,uint32_t val);
+ void SetFPGACrop(qhyccd_handle *handle,uint32_t x,uint32_t y);
+ void WriteFPGADigitalGain(qhyccd_handle *handle,uint32_t val);
+ void ManualAMPON(qhyccd_handle *handle);
+ void ManualAMPOFF(qhyccd_handle *handle);
+
+public:
+#ifdef WIN32
+ HANDLE hCancelExposingAndReadoutThread;
+#endif
+ uint8_t specialdropbychip;
+ uint8_t readnum;
+ bool qhy367sleepthread;
+};
+
+#endif
diff --git a/include/qhy/qhy5iiicommon.h b/include/qhy/qhy5iiicommon.h new file mode 100644 index 0000000..e837545 --- /dev/null +++ b/include/qhy/qhy5iiicommon.h @@ -0,0 +1,61 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy367m.h
+ * @brief QHY367M class define
+ */
+
+#include "qhy5iiibase.h"
+
+#ifndef QHY5IIICOMMONBASE_DEF
+#define QHY5IIICOMMONBASE_DEF
+
+/**
+ * @brief QHY367M class define
+ *
+ * include all functions for qhy367m
+ */
+class QHY5IIICOMMON:public QHY5IIIBASE {
+public:
+ QHY5IIICOMMON();
+ virtual ~QHY5IIICOMMON();
+
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ uint32_t InitChipRegs(qhyccd_handle *h);
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+ uint32_t GetChipMemoryLength();
+ uint32_t IsChipHasFunction(CONTROL_ID controlId);
+};
+#endif
diff --git a/include/qhy/qhy5iiicoolbase.h b/include/qhy/qhy5iiicoolbase.h new file mode 100644 index 0000000..9a80123 --- /dev/null +++ b/include/qhy/qhy5iiicoolbase.h @@ -0,0 +1,57 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhycam.h"
+#include "qhyccdcamdef.h"
+#include "qhyccderr.h"
+#include "log4z.h"
+#include "cmosdll.h"
+#include "stdint.h"
+#include "qhy5iiibase.h"
+
+#ifndef __QHY5IIICOOLBASEDEF_H__
+#define __QHY5IIICOOLBASEDEF_H__
+
+class QHY5IIICOOLBASE : public QHY5IIIBASE {
+
+public:
+ uint8_t firstcheckfilters;
+
+public:
+ QHY5IIICOOLBASE();
+ virtual ~QHY5IIICOOLBASE();
+
+ double GetChipCoolTemp(qhyccd_handle *pDevHandle);
+ double GetChipCoolPWM();
+ uint32_t AutoTempControl(qhyccd_handle *pDevHandle,double ttemp);
+ uint32_t SetChipCoolPWM(qhyccd_handle *pDevHandle,double PWM);
+ uint32_t SendOrder2CFW(qhyccd_handle *pDevHandle,char *order,uint32_t length);
+ uint32_t GetCFWStatus(qhyccd_handle *pDevHandle,char *status);
+ uint32_t IsCFWPlugged(qhyccd_handle *pDevHandle);
+ uint32_t GetCFWSlotsNum(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposing(qhyccd_handle *pDevHandle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *pDevHandle);
+};
+
+#endif
diff --git a/include/qhy/qhy5iiiddrcoolbase.h b/include/qhy/qhy5iiiddrcoolbase.h new file mode 100644 index 0000000..ebcee9b --- /dev/null +++ b/include/qhy/qhy5iiiddrcoolbase.h @@ -0,0 +1,51 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhy5iiicoolbase.h"
+
+#ifndef QHY5IIIDDRCOOLBASE_DEF
+#define QHY5IIIDDRCOOLBASE_DEF
+
+class QHY5IIIDDRCOOLBASE : public QHY5IIICOOLBASE {
+public:
+ double pllratio;
+ uint32_t hmax_ref,vmax_ref;
+ uint32_t hmax,vmax;
+ uint16_t vwinpos,vwidcut;
+ uint32_t patchvnumberstart;
+
+ public:
+ QHY5IIIDDRCOOLBASE();
+ virtual ~QHY5IIIDDRCOOLBASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+ uint32_t CancelExposing(qhyccd_handle *h);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+};
+
+#endif
diff --git a/include/qhy/qhy5iiig400m.h b/include/qhy/qhy5iiig400m.h new file mode 100644 index 0000000..83f2e2a --- /dev/null +++ b/include/qhy/qhy5iiig400m.h @@ -0,0 +1,150 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5iiig400m.h
+ * @brief QHY5IIIG400M class define
+ */
+
+#include "qhy5iiibase.h"
+
+#ifndef QHY5IIIG400_M_DEF
+#define QHY5IIIG400_M_DEF
+
+
+/**
+ * @brief QHY5IIIG400M class define
+ *
+ * include all functions for qhy5iiig400m
+ */
+class QHY5IIIG400M:public QHY5IIIBASE
+{
+public:
+ QHY5IIIG400M();
+ ~QHY5IIIG400M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ uint32_t GetChipMemoryLength();
+
+//private:
+// double pllratio; //!< inter pll ratio
+// uint32_t longtimeflag;
+};
+#endif
diff --git a/include/qhy/qhy5lii_c.h b/include/qhy/qhy5lii_c.h new file mode 100644 index 0000000..a24f61f --- /dev/null +++ b/include/qhy/qhy5lii_c.h @@ -0,0 +1,70 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5lii_c.h
+ * @brief QHY5LII_C class define
+ */
+
+#include "qhy5liibase.h"
+
+#ifndef QHY5LII_C_DEF
+#define QHY5LII_C_DEF
+
+/**
+ * @brief QHY5LII_C class define
+ *
+ * include all functions for qhy5lii-c
+ */
+class QHY5LII_C:public QHY5LIIBASE
+{
+public:
+ QHY5LII_C();
+ virtual ~QHY5LII_C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+
+
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+private:
+};
+#endif
diff --git a/include/qhy/qhy5lii_lowlevel.h b/include/qhy/qhy5lii_lowlevel.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/qhy/qhy5lii_lowlevel.h diff --git a/include/qhy/qhy5lii_m.h b/include/qhy/qhy5lii_m.h new file mode 100644 index 0000000..109d4fa --- /dev/null +++ b/include/qhy/qhy5lii_m.h @@ -0,0 +1,65 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5lii_m.h
+ * @brief QHY5LII_M class define
+ */
+
+#include "qhy5liibase.h"
+
+#ifndef QHY5LII_M_DEF
+#define QHY5LII_M_DEF
+
+/**
+ * @brief QHY5LII_M class define
+ *
+ * include all functions for qhy5lii-m
+ */
+class QHY5LII_M:public QHY5LIIBASE
+{
+public:
+ QHY5LII_M();
+ virtual ~QHY5LII_M();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+};
+#endif
diff --git a/include/qhy/qhy5liibase.h b/include/qhy/qhy5liibase.h new file mode 100644 index 0000000..4e50926 --- /dev/null +++ b/include/qhy/qhy5liibase.h @@ -0,0 +1,210 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5lii_c.h
+ * @brief QHY5LII_C class define
+ */
+
+#include "qhy5iibase.h"
+
+#ifndef QHY5LIIBASE_DEF
+#define QHY5LIIBASE_DEF
+
+/**
+ * @brief QHY5LII_C class define
+ *
+ * include all functions for qhy5lii-c
+ */
+class QHY5LIIBASE:public QHY5IIBASE {
+public:
+ QHY5LIIBASE();
+ virtual ~QHY5LIIBASE();
+
+ virtual uint32_t BeginSingleExposure(qhyccd_handle *h);
+ virtual uint32_t CancelExposing(qhyccd_handle *h);
+ virtual uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ virtual uint32_t BeginLiveExposure(qhyccd_handle *h);
+ virtual uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ virtual uint32_t GetSingleFrame(qhyccd_handle *h, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ virtual uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn void InitCmos(qhyccd_handle *h)
+ @brief Init the registers
+ @param h camera control handle
+ */
+ void InitCmos(qhyccd_handle *h);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double time)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param time expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double time);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera image bin mode
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn double SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double SetPll(qhyccd_handle *h,uint8_t clk);
+
+ /**
+ @fn void SWIFT_MSBLSB(uint8_t *ImgData)
+ @brief switch the image pixel data to right position
+ @param ImgData image buffer
+ */
+ void SWIFT_MSBLSB(uint8_t *ImgData);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ void UpdateParameters(qhyccd_handle *h);
+ void ResetParameters();
+
+ uint32_t expmode; //!< expose time mode
+ double pllratio; //!< inter pll ratio
+ uint32_t longtimeflag;
+
+ uint32_t timerregs,oldtimerregs,reg3012,oldreg3012,reg300c,oldreg300c;
+ uint32_t reg30b0,oldreg30b0,reg3ee4,oldreg3ee4;
+ uint32_t reg3058,oldreg3058,reg305a,oldreg305a,reg305c,oldreg305c,reg3056,oldreg3056;
+ uint32_t reg305e,oldreg305e;
+ uint32_t reg3064,oldreg3064;
+ uint32_t reg302a,oldreg302a,reg302c,oldreg302c,reg302e,oldreg302e,reg3030,oldreg3030,reg3082,oldreg3082;
+ uint32_t reg3002,oldreg3002,reg3004,oldreg3004,reg3006,oldreg3006,reg3008,oldreg3008,reg300a,oldreg300a,reg301a,oldreg301a;
+
+ uint32_t oldchipoutputsizex,oldchipoutputsizey,oldchipoutputbits;
+ uint32_t oldusbspeed;
+ uint32_t oldlongtimeflag;
+};
+#endif
diff --git a/include/qhy/qhy5pii_c.h b/include/qhy/qhy5pii_c.h new file mode 100644 index 0000000..25f7846 --- /dev/null +++ b/include/qhy/qhy5pii_c.h @@ -0,0 +1,191 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5pii_c.h
+ * @brief QHY5II class define
+ */
+
+#include "qhy5iibase.h"
+
+#ifndef QHY5PII_C_DEF
+#define QHY5PII_C_DEF
+
+/**
+ * @brief QHY5PII_C class define
+ *
+ * include all functions for qhy5pii_c
+ */
+class QHY5PII_C:public QHY5IIBASE
+{
+public:
+ QHY5PII_C();
+ ~QHY5PII_C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+
+ /**
+ @fn uint32_t SetColorGain(qhyccd_handle *h,double gain, double RG, double BG)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @param RG red color gain
+ @param BG blue color gain
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetColorGain(qhyccd_handle *h,double gain, double RG, double BG);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ //uint32_t SetPll(qhyccd_handle *h,uint8_t clk);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ //uint32_t pllratio; //!< inter pll ratio
+ //uint32_t longtimeflag;
+};
+#endif
diff --git a/include/qhy/qhy5pii_m.h b/include/qhy/qhy5pii_m.h new file mode 100644 index 0000000..af5f883 --- /dev/null +++ b/include/qhy/qhy5pii_m.h @@ -0,0 +1,172 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5pii_m.h
+ * @brief QHY5II class define
+ */
+
+#include "qhy5iibase.h"
+
+#ifndef QHY5PII_M_DEF
+#define QHY5PII_M_DEF
+
+/**
+ * @brief QHY5PII_M class define
+ *
+ * include all functions for qhy5pii_m
+ */
+class QHY5PII_M:public QHY5IIBASE
+{
+public:
+ QHY5PII_M();
+ ~QHY5PII_M();
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ //uint32_t SetPll(qhyccd_handle *h,uint8_t clk);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ //double pllratio; //!< inter pll ratio
+ //uint32_t longtimeflag;
+
+};
+#endif
diff --git a/include/qhy/qhy5rii_m.h b/include/qhy/qhy5rii_m.h new file mode 100644 index 0000000..2e9217d --- /dev/null +++ b/include/qhy/qhy5rii_m.h @@ -0,0 +1,182 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5rii_m.h
+ * @brief MINICAM5S_M class define
+ */
+
+#include "qhy5iibase.h"
+
+
+#ifndef QHY5RII_M_DEF
+#define QHY5RII_M_DEF
+
+
+/**
+ * @brief QHY5RII_M class define
+ *
+ * include all functions for miniCam5s-m
+ */
+class QHY5RII_M:public QHY5IIBASE {
+public:
+ QHY5RII_M();
+ ~QHY5RII_M();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn void InitCmos(qhyccd_handle *h)
+ @brief Init the registers
+ @param h camera control handle
+ */
+ void InitCmos(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ uint32_t SetChipOffset(qhyccd_handle *h, double offset);
+
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ //uint32_t longtimeflag;
+ uint32_t reg300c;
+ uint32_t rgbgainb,rgbgainc;
+ uint32_t rgbgainbluea,rgbgainreda;
+};
+#endif
diff --git a/include/qhy/qhy5tii_c.h b/include/qhy/qhy5tii_c.h new file mode 100644 index 0000000..25490e2 --- /dev/null +++ b/include/qhy/qhy5tii_c.h @@ -0,0 +1,191 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file qhy5pii_c.h
+ * @brief QHY5II class define
+ */
+
+#include "qhy5iibase.h"
+
+#ifndef QHY5TII_C_DEF
+#define QHY5TII_C_DEF
+
+/**
+ * @brief QHY5TII_C class define
+ *
+ * include all functions for qhy5tii_c
+ */
+class QHY5TII_C:public QHY5IIBASE
+{
+public:
+ QHY5TII_C();
+ ~QHY5TII_C();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ uint32_t SetChipWBRed(qhyccd_handle *h,double red);
+
+ uint32_t SetChipWBGreen(qhyccd_handle *h,double green);
+
+ uint32_t SetChipWBBlue(qhyccd_handle *h,double blue);
+
+ /**
+ @fn uint32_t SetColorGain(qhyccd_handle *h,double gain, double RG, double BG)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @param RG red color gain
+ @param BG blue color gain
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetColorGain(qhyccd_handle *h,double gain, double RG, double BG);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ //uint32_t SetPll(qhyccd_handle *h,uint8_t clk);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+private:
+ //uint32_t pllratio; //!< inter pll ratio
+ //uint32_t longtimeflag;
+};
+#endif
diff --git a/include/qhy/qhy6.h b/include/qhy/qhy6.h new file mode 100644 index 0000000..6a82daf --- /dev/null +++ b/include/qhy/qhy6.h @@ -0,0 +1,298 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy6.h
+ * @brief QHY6 class define
+ */
+
+#include "qhybase.h"
+
+
+#ifndef __QHY6DEF_H__
+#define __QHY6DEF_H__
+
+#define GUIDE_EAST 0x00010010 /* 0 RA+ */
+#define GUIDE_NORTH 0x00020020 /* 1 DEC+ */
+#define GUIDE_SOUTH 0x00020040 /* 2 DEC- */
+#define GUIDE_WEST 0x00010080 /* 3 RA- */
+
+/**
+ * @brief QHY6 class define
+ *
+ * include all functions for QHY6
+ */
+class QHY6:public QHYBASE
+{
+public:
+ QHY6();
+ ~QHY6();
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode();
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode();
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopSingleExposure(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime)
+ @brief send the command to camera's guide port
+ @param h camera control handle
+ @param Direction RA DEC
+ @param PulseTime the time last for command
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime);
+};
+#endif
+
diff --git a/include/qhy/qhy695a.h b/include/qhy/qhy695a.h new file mode 100644 index 0000000..6c4ce5a --- /dev/null +++ b/include/qhy/qhy695a.h @@ -0,0 +1,98 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy695a.h
+ * @brief QHY695A class define
+ */
+
+#include "qhyabase.h"
+
+#ifndef __QHY695ADEF_H__
+#define __QHY695ADEF_H__
+
+/**
+ * @brief QHY695A class define
+ *
+ * include all functions for QHY695A
+ */
+class QHY695A:public QHYABASE
+{
+public:
+ QHY695A();
+ ~QHY695A();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+
+};
+#endif
+
diff --git a/include/qhy/qhy7.h b/include/qhy/qhy7.h new file mode 100644 index 0000000..fac6e9b --- /dev/null +++ b/include/qhy/qhy7.h @@ -0,0 +1,362 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy7.h
+ * @brief QHY7 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY7DEF_H__
+#define __QHY7DEF_H__
+
+/**
+ * @brief QHY7 class define
+ *
+ * include all functions for qhy7
+ */
+class QHY7:public QHYBASE
+{
+public:
+ QHY7();
+ ~QHY7();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy8.h b/include/qhy/qhy8.h new file mode 100644 index 0000000..c1448f2 --- /dev/null +++ b/include/qhy/qhy8.h @@ -0,0 +1,363 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy8.h
+ * @brief QHY8 class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY8DEF_H__
+#define __QHY8DEF_H__
+
+/**
+ * @brief QHY8 class define
+ *
+ * include all functions for QHY8
+ */
+class QHY8:public QHYBASE
+{
+public:
+ QHY8();
+ ~QHY8();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopSingleExposure(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy814a.h b/include/qhy/qhy814a.h new file mode 100644 index 0000000..0584fc4 --- /dev/null +++ b/include/qhy/qhy814a.h @@ -0,0 +1,74 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy814a.h
+ * @brief QHY814A class define
+ */
+
+#include "qhyabase.h"
+
+#ifndef __QHY814ADEF_H__
+#define __QHY814ADEF_H__
+
+/**
+ * @brief IC8300 class define
+ *
+ * include all functions for ic8300
+ */
+class QHY814A:public QHYABASE
+{
+public:
+ QHY814A();
+ ~QHY814A();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+
+ uint32_t SetFocusSetting(qhyccd_handle *h, uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy814g.h b/include/qhy/qhy814g.h new file mode 100644 index 0000000..32371af --- /dev/null +++ b/include/qhy/qhy814g.h @@ -0,0 +1,311 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy814g.h
+ * @brief QHY814G class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY814GDEF_H__
+#define __QHY814GDEF_H__
+
+/**
+ * @brief QHY16000G class define
+ *
+ * include all functions for QHY814G
+ */
+class QHY814G:public QHYBASE
+{
+public:
+ QHY814G();
+ ~QHY814G();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+
+ */
+ uint32_t SetChipDepth(qhyccd_handle *h,uint32_t depth);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode();
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode();
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+};
+#endif
+
diff --git a/include/qhy/qhy8l.h b/include/qhy/qhy8l.h new file mode 100644 index 0000000..99d13c7 --- /dev/null +++ b/include/qhy/qhy8l.h @@ -0,0 +1,326 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy8l.h
+ * @brief QHY8L class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY8LDEF_H__
+#define __QHY8LDEF_H__
+
+/**
+ * @brief QHY8L class define
+ *
+ * include all functions for ic8300
+ */
+class QHY8L:public QHYBASE
+{
+public:
+ QHY8L();
+ ~QHY8L();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy8pro.h b/include/qhy/qhy8pro.h new file mode 100644 index 0000000..908fb0f --- /dev/null +++ b/include/qhy/qhy8pro.h @@ -0,0 +1,363 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy8pro.h
+ * @brief QHY8PRO class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY8PRODEF_H__
+#define __QHY8PRODEF_H__
+
+/**
+ * @brief QHY8PRO class define
+ *
+ * include all functions for QHY8PRO
+ */
+class QHY8PRO:public QHYBASE
+{
+public:
+ QHY8PRO();
+ ~QHY8PRO();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopSingleExposure(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+};
+#endif
+
diff --git a/include/qhy/qhy90a.h b/include/qhy/qhy90a.h new file mode 100644 index 0000000..b556375 --- /dev/null +++ b/include/qhy/qhy90a.h @@ -0,0 +1,83 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy90a.h
+ * @brief QHY90A class define
+ */
+
+#ifndef __QHY90ADEF_H__
+#define __QHY90ADEF_H__
+
+#include "qhyabase.h"
+
+/**
+ * @brief QHY90A class define
+ *
+ * include all functions for QHY90A
+ */
+class QHY90A:public QHYABASE
+{
+public:
+ QHY90A();
+ ~QHY90A();
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ double GetChipCoolPWM();
+
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+private:
+ double lastTargetTemp;
+ double lastPWM;
+};
+#endif
+
diff --git a/include/qhy/qhy9s.h b/include/qhy/qhy9s.h new file mode 100644 index 0000000..93ffada --- /dev/null +++ b/include/qhy/qhy9s.h @@ -0,0 +1,344 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy9s.h
+ * @brief QHY9S class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY9SDEF_H__
+#define __QHY9SDEF_H__
+
+/**
+ * @brief QHY9S class define
+ *
+ * include all functions for QHY9S
+ */
+class QHY9S:public QHYBASE
+{
+public:
+ QHY9S();
+ ~QHY9S();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the char* order string length. eg: char* = "12". length = 2
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin33 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status)
+ @brief control camera's shutter
+ @param handle camera control handle
+ @param status the shutter status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status);
+};
+#endif
+
diff --git a/include/qhy/qhy9t.h b/include/qhy/qhy9t.h new file mode 100644 index 0000000..37fca4e --- /dev/null +++ b/include/qhy/qhy9t.h @@ -0,0 +1,323 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhy9t.h
+ * @brief QHY9T class define
+ */
+
+#include "qhybase.h"
+
+#ifndef __QHY9TDEF_H__
+#define __QHY9TDEF_H__
+
+/**
+ * @brief QHY9T class define
+ *
+ * include all functions for QHY9T
+ */
+class QHY9T:public QHYBASE
+{
+public:
+ QHY9T();
+ ~QHY9T();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin11 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin22 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn double InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin33 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN33Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+
+ /**
+ @fn double InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief init the bin44 mode setting
+ @param x the image top left x position
+ @param y the image top left y position
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode(uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+};
+#endif
+
diff --git a/include/qhy/qhyabase.h b/include/qhy/qhyabase.h new file mode 100644 index 0000000..3eface8 --- /dev/null +++ b/include/qhy/qhyabase.h @@ -0,0 +1,427 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhyabase.h
+ * @brief QHYABASE class define
+ */
+
+#ifndef QHYABASE_CLASS
+#define QHYABASE_CLASS
+
+#include "qhybase.h"
+
+/**
+ * @brief QHYABASE class define
+ *
+ * include all functions for QHYABASE
+ */
+class QHYABASE:public QHYBASE
+{
+public:
+ QHYABASE();
+ ~QHYABASE();
+
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+ uint32_t CancelExposing(qhyccd_handle *handle);
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ static void ThreadCancelExposingAndReadout(void *p);
+ void ThreadCancelExposingAndReadoutStart(qhyccd_handle *h);
+
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ static void ThreadCountExposureTime(void *p);
+
+ void ThreadCountExposureTimeStart(void *p);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+ /** @fn virtual uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt)
+ @brief Set InterCam serial2 params
+ @param h camera control handle
+ @param opt the param
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt);
+
+ /** @fn virtual uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length)
+ @brief Send data to InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @param length the length to send
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length);
+
+
+ /** @fn virtual uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf)
+ @brief Get data from InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @return
+ on success,return the data number \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf);
+
+ /** @fn virtual uint32_t Send2OledFast(qhyccd_handle *h,char *buffer)
+ @brief send data to show on InterCam's OLED
+ @param h camera control handle
+ @param buffer buffer for data
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2OledFast(qhyccd_handle *h,uint8_t *buffer);
+
+ /** @fn uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff)
+ @brief turn off or turn on the InterCam's Oled
+ @param handle camera control handle
+ @param onoff on or off the oled \n
+ 1:on \n
+ 0:off \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff);
+
+ /** @fn uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness)
+ @brief send data to show on InterCam's OLED
+ @param handle camera control handle
+ @param brightness the oled's brightness
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness);
+
+ uint32_t SendFourLine2InterCamOled(qhyccd_handle *handle,char *messagetemp,char *messageinfo,char *messagetime,char *messagemode);
+
+ /** @fn uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom)
+ @brief spilit the message to two line,send to camera
+ @param handle camera control handle
+ @param messageTop message for the oled's 1st line
+ @param messageBottom message for the oled's 2nd line
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom);
+
+ /**
+ @fn uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop)
+ @brief spilit the message to two line,send to camera
+ @param handle camera control handle
+ @param messageTop message for all the oled
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop);
+
+ /**
+ @fn uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf)
+ @brief Get camera status
+ @param h camera control handle
+ @param buf camera's status save space
+ @return
+ on success,return the camera statu \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status)
+ @brief control camera's shutter
+ @param handle camera control handle
+ @param status the shutter status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status);
+
+ /**
+ @fn uint32_t GetShutterStatus(qhyccd_handle *handle)
+ @brief get the camera's shutter status
+ @param handle camera control handle
+ @return
+ on success,return status \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetShutterStatus(qhyccd_handle *handle);
+
+ uint32_t GetHumidity(qhyccd_handle *handle,double *hd);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+ double GetReadingProgress(qhyccd_handle *handle);
+
+ uint32_t GetPreProcessInfoFromEEPROM(qhyccd_handle *h);
+
+ uint32_t widthmax;
+ uint32_t heightmax;
+
+ uint32_t curOverScanX;
+ uint32_t curOverScanY;
+ uint32_t curOverScanSizeX;
+ uint32_t curOverScanSizeY;
+#ifdef WIN32
+ HANDLE hCountExpTimeThread;
+ HANDLE hCancelExposingAndReadoutThread;
+#endif
+ uint32_t isReadoutTemp;
+
+ uint8_t flagquitgetsingleframe;
+
+ bool isbin22Tobin33;
+ uint32_t wantedWidth;
+ uint32_t wantedHeight;
+
+ uint8_t badlinenum;
+ uint16_t badlinex[32];
+ uint16_t badliney[32];
+ uint8_t badlinewidth[32];
+ uint16_t badlineendy[32];
+};
+#endif
+
diff --git a/include/qhy/qhybase.h b/include/qhy/qhybase.h new file mode 100644 index 0000000..93fc1d5 --- /dev/null +++ b/include/qhy/qhybase.h @@ -0,0 +1,1189 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhycam.h"
+#include "qhyccdcamdef.h"
+#include "qhyccderr.h"
+#include "log4z.h"
+#include "cmosdll.h"
+#include "stdint.h"
+#include "debugview.h"
+
+#ifdef WIN32
+#include "opencv2/opencv.hpp"
+#else // Linux & Mac
+#include <pthread.h>
+#include <string.h>
+#endif // WIN32
+
+#ifndef __QHYBASEDEF_H__
+#define __QHYBASEDEF_H__
+
+using namespace zsummer::log4z;
+
+#define Min2(a, b) ((a) < (b) ? (a) : (b))
+#define Max2(a, b) ((a) > (b) ? (a) : (b))
+#define LimitByte(v) ((uint8_t)Min2(Max2(v, 0), 0xFF))
+#define LimitShort(v) ((uint16_t)Min2(Max2(v, 0), 0xFFFF))
+
+/**
+ * the QHYBASE class description
+ */
+class QHYBASE : public QHYCAM {
+public:
+ QHYBASE();
+ virtual ~QHYBASE();
+
+ virtual void InitCmos(qhyccd_handle *h) {
+ };
+
+ virtual uint32_t BeginSingleExposure(qhyccd_handle *h);
+ virtual uint32_t CancelExposing(qhyccd_handle *handle);
+ virtual uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+ virtual uint32_t BeginLiveExposure(qhyccd_handle *h);
+ virtual uint32_t StopLiveExposure(qhyccd_handle *h);
+ virtual uint32_t GetSingleFrame(qhyccd_handle *h, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+ virtual uint32_t GetLiveFrame(qhyccd_handle *h, uint32_t *pW, uint32_t *pH, uint32_t * pBpp, uint32_t *pChannels, uint8_t *ImgData);
+
+ virtual void SetFlagQuit(bool val);
+ virtual bool IsFlagQuit();
+
+ virtual void SetExposureThreadRunFlag(bool val);
+ virtual bool IsExposureThreadRunning();
+
+ virtual void SetDdrnum(uint32_t val);
+ virtual uint32_t GetDdrnum();
+
+ virtual void SetTotalDataLength(uint32_t val);
+ virtual void TotalDataLengthAdd(uint32_t val);
+ virtual uint32_t GetTotalDataLength();
+
+ /**
+ @fn virtual uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect camera,get the control handle
+ @param d deivce
+ @param h camera control handle pointer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t ConnectCamera(qhyccd_device *d, qhyccd_handle **h);
+
+ /**
+ @fn virtual uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn virtual uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn virtual uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn virtual uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipOffset(qhyccd_handle *h, double offset) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipExposeTime(qhyccd_handle *h, double i) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipGain(qhyccd_handle *h, double gain) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipWBRed(qhyccd_handle *h,double red)
+ @brief set the red gain value of white balance
+ @param h camera control handle
+ @param red red gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipWBRed(qhyccd_handle *h, double red) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipWBGreen(qhyccd_handle *h,double green)
+ @brief set the red gain value of white balance
+ @param h camera control handle
+ @param green green gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipWBGreen(qhyccd_handle *h, double green) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipWBBlue(qhyccd_handle *h,double blue)
+ @brief set the red gain value of white balance
+ @param h camera control handle
+ @param blue blue gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipWBBlue(qhyccd_handle *h, double blue) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual double GetChipWBRed()
+ @brief get the red gain value of white balance
+ @return
+ success return red gain value \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipWBRed() {
+ return camred2green;
+ }
+
+ /**
+ @fn double GetChipWBBlue()
+ @brief get the blue gain value of white balance
+ @return
+ success return blue gain value \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipWBBlue() {
+ return camblue2green;
+ }
+
+ /**
+ @fn double GetChipWBGreen()
+ @brief get the green gain value of white balance
+ @return
+ success return green gain value \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipWBGreen() {
+ return camgreen;
+ }
+
+ /**
+ @fn virtual double GetChipExposeTime()
+ @brief get the current exposetime
+ @return
+ success return the current expose time (unit:us) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipExposeTime();
+
+ /**
+ @fn virtual double GetChipGain()
+ @brief get the current gain
+ @return
+ success return the current expose gain\n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipGain();
+
+ /**
+ @fn virtual double GetChipOffset()
+ @brief get the current offset
+ @return
+ success return the current camera offset \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipOffset();
+
+ /**
+ @fn virtual double GetChipSpeed()
+ @brief get the current transfer speed
+ @return
+ success return the current speed level \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipSpeed();
+
+ /**
+ @fn virtual double GetChipUSBTraffic()
+ @brief get the hblank value
+ @return
+ success return the hblank value \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipUSBTraffic();
+
+ /**
+ @fn virtual double GetChipBitsMode()
+ @brief get the current camera depth bits
+ @return
+ success return the current camera depth bits \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipBitsMode();
+
+ /**
+ @fn virtual double GetChipChannels()
+ @brief get the current camera image channels
+ @return
+ success return the current camera image channels \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipChannels() {
+ return 1;
+ }
+
+ /**
+ @fn virtual double GetChipCoolTemp()
+ @brief get the current ccd/cmos chip temprature
+ @return
+ success return the current chip temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipCoolTemp(qhyccd_handle *h) {
+ return m_CurrentTemp;
+ }
+
+ /**
+ @fn virtual double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipCoolPWM() {
+ return m_CurrentPwm;
+ }
+
+ /**
+ @fn virtual double GetChipCoolTargetTemp()
+ @brief get the current ccd/cmos target temperature
+ @return
+ success return the current cool target temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual double GetChipCoolTargetTemp() {
+ return m_TargetTemp;
+ }
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId, double *min, double *max, double *step) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t CorrectWH(uint32_t *w, uint32_t *h) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipResolution(qhyccd_handle *handle, uint32_t x, uint32_t y, uint32_t xsize, uint32_t ysize) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipUSBTraffic(qhyccd_handle *h, uint32_t i) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t DeChipRowNoise(qhyccd_handle *h,uint32_t value)
+ @brief enable the function to reduce the row noise
+ @param h camera control handle
+ @param value enable or disable
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t DeChipRowNoise(qhyccd_handle *h, uint32_t value) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t GetChipMemoryLength()
+ @brief get the image cost memory length
+ @return
+ success return memory length \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetChipMemoryLength();
+
+ /**
+ @fn virtual bool IsSupportHighSpeed()
+ @brief check the camera support high speed transfer or not
+ @return
+ support return true \n
+ not support return false
+ */
+ virtual bool IsSupportHighSpeed() {
+ return false;
+ }
+
+ /**
+ @fn virtual uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_SUCCESS \n
+ NOT HAVE return QHYCCD_ERROR_NOTSUPPORT
+ */
+ virtual uint32_t IsChipHasFunction(CONTROL_ID id) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipCoolPWM(qhyccd_handle *h, double PWM) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t AutoTempControl(qhyccd_handle *h, double ttemp) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipSpeed(qhyccd_handle *h, uint32_t i) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipBitsMode(qhyccd_handle *h, uint32_t bits) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipChannels(qhyccd_handle *h,uint32_t channels)
+ @brief set the image channels,it means the image is color one
+ @param h camera control handle
+ @param channels image channels
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipChannels(qhyccd_handle *h, uint32_t channels) {
+ return QHYCCD_SUCCESS;
+ }
+
+ /**
+ @fn virtual uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera image bin mode
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetChipBinMode(qhyccd_handle *h, uint32_t wbin, uint32_t hbin);
+
+ /**
+ @fn virtual void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ virtual void ConvertDataBIN11(uint8_t *Data, uint32_t x, uint32_t y, uint16_t PixShift) {
+ }
+
+ /**
+ @fn virtual void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ virtual void ConvertDataBIN22(uint8_t *Data, uint32_t x, uint32_t y, uint16_t TopSkipPix) {
+ }
+
+ /**
+ @fn void ConvertDataBIN33(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ virtual void ConvertDataBIN33(uint8_t *Data, uint32_t x, uint32_t y, uint16_t TopSkipPix) {
+ }
+
+ /**
+ @fn virtual void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ virtual void ConvertDataBIN44(uint8_t *Data, uint32_t x, uint32_t y, uint16_t TopSkipPix) {
+ }
+
+ /**
+ @fn virtual uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime)
+ @brief send the command to camera's guide port
+ @param h camera control handle
+ @param Direction RA DEC
+ @param PulseTime the time last for command
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t Send2GuiderPort(qhyccd_handle *h, uint32_t Direction, uint16_t PulseTime) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetFocusSetting(qhyccd_handle *h, uint32_t focusCenterX, uint32_t focusCenterY) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t ExposureRemaining(qhyccd_handle *h)
+ @brief Get remaining ccd/cmos expose time
+ @param h camera control handle
+ @return
+ 100 or less 100,it means exposoure is over \n
+ another is remaining time
+ */
+ virtual uint32_t ExposureRemaining(qhyccd_handle *h) {
+ return 100;
+ }
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetStreamMode(qhyccd_handle *handle, uint8_t mode);
+
+ /** @fn virtual uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt)
+ @brief Set InterCam serial2 params
+ @param h camera control handle
+ @param opt the param
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetInterCamSerialParam(qhyccd_handle *h, uint32_t opt) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length)
+ @brief Send data to InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @param length the length to send
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t InterCamSerialTX(qhyccd_handle *h, char *buf, uint32_t length) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf)
+ @brief Get data from InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @return
+ on success,return the data number \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t InterCamSerialRX(qhyccd_handle *h, char *buf) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t Send2OledFast(qhyccd_handle *h,char *buffer)
+ @brief send data to show on InterCam's OLED
+ @param h camera control handle
+ @param buffer buffer for data
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t Send2OledFast(qhyccd_handle *h, uint8_t *buffer) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff)
+ @brief turn off or turn on the InterCam's Oled
+ @param h camera control handle
+ @param onoff on or off the oled \n
+ 1:on \n
+ 0:off \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t InterCamOledOnOff(qhyccd_handle *handle, uint8_t onoff) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness)
+ @brief send data to show on InterCam's OLED
+ @param h camera control handle
+ @param brightness the oled's brightness
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SetInterCamOledBrightness(qhyccd_handle *handle, uint8_t brightness) {
+ return QHYCCD_ERROR;
+ }
+
+ virtual uint32_t SendFourLine2InterCamOled(qhyccd_handle *handle, char *messagetemp, char *messageinfo, char *messagetime, char *messagemode) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom)
+ @brief spilit the message to two line,send to camera
+ @param h camera control handle
+ @param messageTop message for the oled's 1st line
+ @param messageBottom message for the oled's 2nd line
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle, char *messageTop, char *messageBottom) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop)
+ @brief spilit the message to two line,send to camera
+ @param h camera control handle
+ @param messageTop message for all the oled
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle, char *messageTop) {
+ return QHYCCD_ERROR;
+ }
+
+ /** @fn virtual uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf)
+ @brief Get camera status
+ @param h camera control handle
+ @param buf camera's status save space
+ @return
+ on success,return the camera statu \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetCameraStatus(qhyccd_handle *h, uint8_t *buf) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t SendOrder2CFW(qhyccd_handle *handle, char *order, uint32_t length) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetCFWStatus(qhyccd_handle *handle, char *status) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t GetCFWSlotsNum()
+ @brief get the hole number of color filter wheel
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetCFWSlotsNum(qhyccd_handle *handle) {
+ return 9;
+ }
+
+ /**
+ @fn virtual uint32_t IsCFWPlugged(qhyccd_handle *handle)
+ @brief if CFW plugged in to the port or not.
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t IsCFWPlugged(qhyccd_handle *handle) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status)
+ @brief control camera's shutter
+ @param handle camera control handle
+ @param status the shutter status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t ControlShutter(qhyccd_handle *handle, uint8_t status) {
+ return QHYCCD_ERROR;
+ }
+
+ /**
+ @fn virtual uint32_t GetShutterStatus(qhyccd_handle *handle)
+ @brief get the camera's shutter status
+ @param handle camera control handle
+ @return
+ on success,return status \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetShutterStatus(qhyccd_handle *handle) {
+ return QHYCCD_ERROR;
+ }
+
+ virtual uint32_t GetHumidity(qhyccd_handle *handle, double *hd) {
+ return QHYCCD_ERROR;
+ }
+
+ virtual uint32_t SetTrigerFunction(qhyccd_handle *handle, bool value) {
+ return QHYCCD_ERROR;
+ }
+
+ //---------just for debugging-------------
+
+ virtual uint32_t I2C_Write(qhyccd_handle *handle, uint8_t req, uint16_t value, uint16_t index, uint8_t* data, uint16_t length) {
+ return QHYCCD_ERROR;
+ }
+
+ virtual uint32_t I2C_Read(qhyccd_handle *handle, uint8_t req, uint16_t value, uint16_t index, uint8_t* data, uint16_t length) {
+ return QHYCCD_ERROR;
+ }
+ //----------------------------------------
+
+ virtual uint32_t SetFineTone(qhyccd_handle *h, uint8_t setshporshd, uint8_t shdloc, uint8_t shploc, uint8_t shwidth) {
+ return QHYCCD_ERROR;
+ }
+
+ virtual uint32_t ReservedFunction(uint32_t width, uint32_t height, uint32_t bpp, uint32_t channels, uint8_t *ImgData) {
+ return QHYCCD_SUCCESS;
+ }
+
+ virtual uint32_t IsExposing() {
+ return QHYCCD_SUCCESS;
+ }
+
+ virtual void UpdateParameters(qhyccd_handle *h) {
+
+ }
+ /**
+ @fn virtual uint32_t GetFWVersion(qhyccd_handle *h,uint8_t *buf)
+ @brief Get the QHYCCD's firmware version
+ @param h camera control handle
+ @param buf buffer for version info
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ virtual uint32_t GetFWVersion(qhyccd_handle *h, uint8_t *buf);
+
+ virtual uint32_t SetGuideModeOnOff(qhyccd_handle *h, double mode) {
+ return QHYCCD_ERROR;
+ }
+
+ virtual uint32_t GeDDRBufferThreshold() {
+ return 0;
+ }
+public:
+
+ /**
+ @fn void ControlCamTemp(qhyccd_handle *h,double MAXPWM)
+ @brief control the ccd/cmos temprature
+ @param h camera control handle
+ @param MAXPWM the max power of cool
+ */
+ void ControlCamTemp(qhyccd_handle *h, double MAXPWM);
+
+ /**
+ @fn void Bit16To8_Stretch(uint8_t *InputData16,uint8_t \ *OutputData8,uint32_t imageX,uint32_t imageY,uint16_t B,uint16_t W)
+ @brief turn 16bits data into 8bits
+ @param InputData16 for 16bits data memory
+ @param OutputData8 for 8bits data memory
+ @param imageX image width
+ @param imageY image height
+ @param B for stretch balck
+ @param W for stretch white
+ */
+ void Bit16To8_Stretch(uint8_t *InputData16, uint8_t *OutputData8, uint32_t imageX, uint32_t imageY, uint16_t B, uint16_t W);
+
+ /**
+ @fn void HistInfo(uint32_t x,uint32_t y,uint8_t *InBuf,uint8_t *OutBuf)
+ @brief make the hist info
+ @param x image width
+ @param y image height
+ @param InBuf for the raw image data
+ @param OutBuf for 192x130 8bits 3 channels image
+ */
+ void HistInfo(uint32_t x, uint32_t y, uint8_t *InBuf, uint8_t *OutBuf);
+
+ void calibration_difference(uint8_t *inbuf, uint8_t *outbuf, uint32_t width, uint32_t height, uint32_t depth, uint32_t areax1, uint32_t areay1, uint32_t areasizex1, uint32_t areasizey1, uint32_t areax2, uint32_t areay2, uint32_t areasizex2, uint32_t areasizey2);
+ /**
+ @fn void CalibrateOverScan(uint8_t inbuf, uint8_t outbuf, uint32_t ImgW, uint32_t ImgH, uint32_t OSStartX, uint32_t OSStartY, uint32_t OSSizeX, uint32_t OSSizeY);
+ @brief calibrate the image with its overscan arean
+ @param x image width
+ @param y image height
+ @param OSStartX the start X for overscan arean
+ @param OSStartY the start Y for overscan arean
+ @param OSSizeX the X size for overscan arean
+ @param OSSizeY the Y size for overscan arean
+ @param InBuf for the raw image data
+ @param OutBuf for the image data after calibrated
+ */
+ void CalibrateOverScan(uint8_t *inbuf, uint8_t *outbuf, uint32_t ImgW, uint32_t ImgH, uint32_t OSStartX, uint32_t OSStartY, uint32_t OSSizeX, uint32_t OSSizeY);
+
+
+ /**
+ @fn void IgnoreOverscanArea(qhyccd_handle *h, bool value);
+ @brief set camera to ignore overscan area
+ @param h camera control handle
+ @param value ignore overscan area or not
+ */
+ uint32_t IgnoreOverscanArea(qhyccd_handle *h, bool value);
+
+ /** @fn uint32_t GetOverScanArea(uint32_t *startX, uint32_t *startY, uint32_t *sizeX, uint32_t *sizeY)
+
+ @brief get the ccd overscan area
+ @param startX the OverScan area x position
+ @param startY the OverScan area y position
+ @param sizeX the OverScan area x size
+
+ @param sizeY the OverScan area y size
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetOverScanArea(uint32_t *startX, uint32_t *startY, uint32_t *sizeX, uint32_t *sizeY);
+
+ /** @fn uint32_t GetEffectiveArea(qint *startX, uint32_t *startY, uint32_t *sizeX, uint32_t *sizeY)
+ @brief get the ccd effective area
+ @param startX the Effective area x position
+ @param startY the Effective area y position
+
+ @param sizeX the Effective area x size
+ @param sizeY the Effective area y size
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+
+ */
+ uint32_t GetEffectiveArea(uint32_t *startX, uint32_t *startY, uint32_t *sizeX, uint32_t *sizeY);
+
+ /** @fn uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh)
+ @brief get the camera's ccd/cmos chip info
+ @param h camera control handle
+ @param chipw chip size width
+ @param chiph chip size height
+ @param imagew chip output image width
+ @param imageh chip output image height
+ @param pixelw chip pixel size width
+ @param pixelh chip pixel size height
+ @param bpp chip pixel depth
+ */
+ uint32_t GetChipInfo(double *chipw, double *chiph, uint32_t *imagew, uint32_t *imageh, double *pixelw, double *pixelh, uint32_t *bpp);
+
+ /**
+ @fn double GetReadingProgress(qhyccd_handle *handle)
+ @brief get reading data from camera progress
+ @param handle camera control handle
+ @return current progress
+ */
+ virtual double GetReadingProgress(qhyccd_handle *handle);
+
+ uint32_t SetGPSOn(qhyccd_handle *handle, uint8_t mode);
+
+ uint32_t GetGPSSOnOff() {
+ return gpson;
+ }
+
+ static void QSleep(uint32_t mstime) {
+#ifdef WIN32
+ Sleep(mstime);
+#else
+ usleep(mstime * 1000);
+#endif
+ }
+
+ uint32_t SetPIDParas(qhyccd_handle *handle, double p, double i, double d);
+ uint32_t PixelsDataSoftBin(uint8_t *srcdata, uint8_t *bindata, uint32_t width, uint32_t height, uint32_t depth, uint32_t camxbin, uint32_t camybin);
+ uint32_t SetDebayerOnOff(bool onoff);
+ uint32_t RoiTwoChannels2OneImage(uint32_t imgX, uint32_t imgY, uint32_t depth, uint32_t uselessStartX, uint32_t uselessStartY, uint32_t uselessSizeX, uint32_t uselessSizeY, uint8_t *data);
+ uint32_t VendRequestWrite(qhyccd_handle *h, uint8_t req, uint16_t value, uint16_t index, uint32_t length, uint8_t *data);
+ uint32_t VendRequestRead(qhyccd_handle *h, uint8_t req, uint16_t value, uint16_t index, uint32_t length, uint8_t *data);
+ uint32_t QHYCCDImageROI(void* src, uint32_t chipoutputsizex, uint32_t chipoutputsizey, uint32_t cambits, void* dist, uint32_t roixstart, uint32_t roiystart, uint32_t roixsize, uint32_t roiysize);
+ uint32_t QHYCCDFlip(void* src, uint32_t xsize, uint32_t ysize, uint32_t cambits, int channels, void* dist, int flip_mode);
+ uint32_t QHYCCDFlip(void* src, uint32_t xsize, uint32_t ysize, uint32_t cambits, int channels, int flip_mode);
+ uint32_t SetAutoWhiteBalance(qhyccd_handle *h, double value);
+ uint32_t SetAutoExposure(qhyccd_handle *h, double value);
+ uint32_t SetAutoFocus(qhyccd_handle *h, double value);
+ uint32_t SetBrightness(qhyccd_handle *h, double value);
+ uint32_t SetContrast(qhyccd_handle *h, double value);
+ uint32_t SetGamma(qhyccd_handle *h, double value);
+ uint32_t SetAMPV(qhyccd_handle *h, double value);
+ uint32_t SetLPMode(qhyccd_handle *h, double value);
+ uint32_t SetCamViewMode(qhyccd_handle *h, double value);
+ uint32_t SetVcamOnoff(qhyccd_handle *h, double mode);
+ uint32_t SetScreenStretchB(qhyccd_handle *h, double value);
+ uint32_t SetScreenStretchW(qhyccd_handle *h, double value);
+
+ virtual uint32_t SetDDR(qhyccd_handle *h, double value);
+
+ double GetBrightness();
+ double GetContrast();
+ double GetGamma();
+ double GetAMPV();
+ double GetDDR();
+ double GetLPMode();
+ double GetCamViewModeStatus();
+ double GetVcamOnoff();
+ double GetScreenStretchB();
+ double GetScreenStretchW();
+ double Getqhy5iiGuidePortOnoff();
+
+ void QHYCCDDemosaic(void* dataIn, uint32_t w, uint32_t h, uint32_t bpp, void* dataOut, uint8_t mode);
+ void BuildlLut_Contrast_Brightness_Gamma(uint32_t bpp, double brightness_percent, double contrast_percent, double fPrecompensation);
+ void ImgProcess_Contrast_Brightness_Gamma(uint8_t *array, uint32_t width, uint32_t height, uint32_t bpp);
+
+ uint32_t GetTempAndPwm(qhyccd_handle *h, double &temp, double &pwm);
+ uint32_t QHYImgResize(void *src, uint32_t bpp, uint32_t ch, uint32_t src_width, uint32_t src_height, void *dst, uint32_t dst_width, uint32_t dst_height);
+ uint32_t QHYBadLineProc(void *src, uint32_t imgw, uint32_t imgh, uint32_t bpp, uint32_t startx, uint32_t starty, uint32_t linew, uint32_t endy, bool method);
+ uint32_t GeDDRBufferCap(qhyccd_handle *h);
+ uint32_t QHYConvertToSoftBIN22(void *src, uint32_t bpp, uint32_t src_width, uint32_t src_height, void *dst);
+ uint32_t QHYConvertToSoftBIN33(void *src, uint32_t bpp, uint32_t src_width, uint32_t src_height, void *dst);
+ uint32_t QHYConvertToSoftBIN44(void *src, uint32_t bpp, uint32_t src_width, uint32_t src_height, void *dst);
+
+ qhyccd_handle *GetHandle();
+ void SetHandle(qhyccd_handle *pHandle);
+
+ inline void SetMaxImageReadTrials(int value) {
+ m_max_image_read_trials = value;
+ }
+
+ inline int GetMaxImageReadTrials() {
+ return m_max_image_read_trials;
+ }
+
+ uint32_t camx; //!< current camera width
+ uint32_t camy; //!< current camera height
+ uint32_t camxbin; //!< current camera width bin
+ uint32_t camybin; //!< current camera height bin
+ uint32_t cambits; //!< current camera bits mode
+ uint32_t camchannels; //!< current camera channels
+
+ uint32_t usbtraffic; //!< current usbtraffic
+ uint32_t usbspeed; //!< current usb speed mode
+
+ double camtime; //!< current cam expose time
+ double camgain; //!< current cam gain
+ double camoffset; //!< current cam offset
+ double camred2green; //!< current white blance red value
+ double camblue2green; //!< current white blance blue value
+ double camgreen; //!< current white blance green
+
+ uint8_t *rawarray; //!< raw buffer pointer for usb transfer
+ uint8_t *roiarray; //!< roi image buffer
+
+ uint32_t roixstart; //!< roi image xstart position
+ uint32_t roiystart; //!< roi image ystart position
+ uint32_t roixsize; //!< roi image xsize
+ uint32_t roiysize; //!< roi image ysize
+
+ uint32_t unbinningx;
+ uint32_t unbinningy;
+ uint32_t unbinningxsize;
+ uint32_t unbinningysize;
+
+ // overscan area
+ uint32_t overScanStartX; //!< overscan area x position
+ uint32_t overScanStartY; //!< overscan area y position
+ uint32_t overScanSizeX; //!< overscan area x size
+ uint32_t overScanSizeY; //!< overscan area y size
+
+ // effective area
+ uint32_t onlyStartX; //!< effective area x position
+ uint32_t onlyStartY; //!< effective area y position
+ uint32_t onlySizeX; //!< effective area x size
+ uint32_t onlySizeY; //!< effective area y size
+
+ // chip info
+ double ccdchipw; //!< ccd chip width
+ double ccdchiph; //!< ccd chip height
+ uint32_t ccdimagew; //!< ccd image width
+ uint32_t ccdimageh; //!< ccd image height
+ double ccdpixelw; //!< ccd pixel width
+ double ccdpixelh; //!< ccd pixel height
+
+ uint32_t lastx, lasty, lastxsize, lastysize, lastcambits;
+ uint32_t lastcamxbin, lastcamybin;
+ uint32_t chipoutputx, chipoutputy, chipoutputsizex, chipoutputsizey, chipoutputbits;
+
+ double m_TargetTemp; //!< target ccd/cmos temprature
+ double m_CurrentTemp; //!< current ccd/cmos tempratue
+ double m_CurrentPwm; //!< current cool power
+
+ double nowVoltage; //!< reserved
+ double NowError; //!< the step k difference
+ double PrevError; //!< the step k - 2 difference
+ double LastError; //!< the step k - 1 difference
+ double Proportion; //!< scale factor value
+ double Integral; //!< integralcoefficients
+ double Derivative; //!< differential coefficient
+ double readprogress; //!< get the reading data from camera progress status
+ double humidityvalue;
+ double imgbrightness;
+ double imgcontrast;
+ double imggamma;
+ double camampv;
+ double defaultgain;
+ double defaultoffset;
+ double outputdataactualbits;
+ double outputdataalignment;
+ double camviewmode;
+
+ uint8_t isbadframe;
+ uint8_t isexposureupdate;
+ uint8_t isgainupdate;
+ uint8_t iscolorgainupdate;
+ uint8_t isoffsetupdate;
+ uint8_t isdepthupdate;
+ uint8_t isspeedupdate;
+ uint8_t isresolutionupdate;
+ uint8_t isusbtrafficupdate;
+ uint8_t is_superspeed;
+ uint8_t isReadoutTemp;
+ uint8_t islive;
+ uint8_t camtype;
+ uint8_t streammode;
+ uint8_t badframenum;
+ uint8_t gpsarray[5000 * 11 * 2];
+ uint8_t is_3a_autoexposure_on;
+ uint8_t is_3a_autowhitebalance_on;
+ uint8_t is_3a_autofocus_on;
+ uint8_t autoexposure_messuremethod;
+ uint8_t autoexposure_controlmode;
+ uint8_t autowhitebalanceloops;
+ uint8_t camLPMode; // 1: high light performance or 0: low light performance
+ uint8_t singlestatus;
+ uint8_t gpson;
+ uint8_t qhy5iiGuidePortOnOff;
+
+ bool isReadoutData; //!< sign whether it is reading out the image data
+ bool flag_timer; //!< timer flag
+ bool flag_timer_2; //!< timer flag 2
+ bool flagtempauto; //!< temperature to read flag
+ bool debayeronoff;
+ bool isOverscanRemoved; //!< sign whether removed the overscan area for image.
+ bool isFocusmode; //!< hold the camera work mode, false: capture mode, true: focus mdoe
+ bool vcamonoff;
+ bool isFX3;
+ bool delRowRoise;
+
+ uint32_t ddrnum;
+ uint32_t debayerformat;
+ uint32_t initdone;
+ uint32_t connected;
+ uint32_t resolutionmode;
+ uint32_t uselessstartx;
+ uint32_t uselessstarty;
+ uint32_t uselesssizex;
+ uint32_t uselesssizey;
+ uint32_t retrynum;
+
+ int32_t imgprocesslut[65536];
+ int32_t frameflag;
+
+ uint16_t camddr;
+ uint16_t screenstretchb, screenstretchw;
+
+ int8_t filterpos;
+
+#ifdef WIN32
+ HANDLE reseth;
+#else
+
+#endif
+
+protected:
+ bool m_flagQuit;
+ bool m_exposureThreadRunFlag;
+ qhyccd_handle *m_pHandle;
+ uint32_t m_totalDataLength;
+ int m_max_image_read_trials;
+
+private:
+#ifdef WIN32
+
+#else
+ pthread_mutex_t m_flagQuitMutex;
+ pthread_mutex_t m_ddrNumMutex;
+ pthread_mutex_t m_exposureThreadRunFlagMutex;
+ pthread_mutex_t m_totalDataLengthMutex;
+#endif
+
+};
+
+#endif
diff --git a/include/qhy/qhycam.h b/include/qhy/qhycam.h new file mode 100644 index 0000000..a4ea236 --- /dev/null +++ b/include/qhy/qhycam.h @@ -0,0 +1,572 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*
+ * @file qhycam.h
+ * @brief QHYCAM class define
+ */
+#ifndef _QHYCAM_H_
+#define _QHYCAM_H_
+
+#include <math.h>
+#include "qhyccdstruct.h"
+#include "unlockimagequeue.h"
+
+#ifdef WIN32
+#include "CyAPI.h"
+#include <process.h>
+#else // Linux & Mac
+#include <stdio.h>
+#include <unistd.h>
+#include <pthread.h>
+//#include <libusb-1.0/libusb.h>
+#include <libusb.h>
+#endif // WIN32
+
+#include "stdint.h"
+
+#define IDLE 0
+#define EXPOSING 1
+#define DOWNLOADING 2
+
+#define QHYCCD_USBTYPE_NONE (0xFF)
+#define QHYCCD_USBTYPE_CYUSB (0x00)
+#define QHYCCD_USBTYPE_WINUSB (0x01)
+
+#define LIBUSB_PACKET_LENGTH (4096)
+#define LIBUSB_WR_TIMEOUT (5000)
+
+#define LIBUSB_CONTROL_TRANSFER_RD_TIMEOUT (5000)
+#define LIBUSB_CONTROL_TRANSFER_WR_TIMEOUT (1000)
+
+#define LIBUSB_BULK_TRANSFER_RD_TIMEOUT (5000)
+#define LIBUSB_BULK_TRANSFER_WR_TIMEOUT (1000)
+
+#define LIBUSB_ASYNC_BULK_TRANSFER_TIMEOUT (3600000)
+
+#define EVENT_TIMEOUT_SEC (5)
+#define EVENT_TIMEOUT_USEC (0);
+
+#define USB_ENDPOINT (0x81)
+#define CAM_16_BITS (16)
+
+#ifdef WIN32
+
+typedef void *qhyccd_device;
+typedef CCyUSBDevice qhyccd_handle;
+
+#else // Linux & Mac
+
+typedef struct libusb_device qhyccd_device;
+typedef struct libusb_device_handle qhyccd_handle;
+
+#endif // WIN32
+
+/**
+ * @brief QHYCAM class define
+ *
+ * include all functions for qhycam
+ */
+class QHYCAM {
+public:
+
+ QHYCAM();
+ virtual ~QHYCAM();
+
+ //inline UnlockImageQueue *GetImageQueue() {
+ // return m_pImageQueue;
+ //}
+
+ //static void* EventThreadFunc(void *arg);
+ //static void AsyImageDataCallBack(struct libusb_transfer *transfer);
+
+ //int AllocFillSubmitBulkTransfers(qhyccd_handle *pCamera);
+ //int32_t InitAsyQCamLive2(qhyccd_handle *pDevHandle, int32_t x, int32_t y, int32_t depth, int32_t frameSize);
+ //bool BeginAsyQCamLive2(qhyccd_handle *pDevHandle);
+ //void StopAsyQCamLive2(qhyccd_handle *pDevHandle);
+ //uint32_t ReadAsyQCamLiveFrame2(qhyccd_handle *pDevHandle, uint8_t *pBuffer, int32_t *pFrameFlag);
+ //void SetFlagRawExit2(bool value);
+ //int GetEventCount2();
+ //int IncreaseEventCount2();
+ //int DecreaseEventCount2();
+ //bool IsFlagRawExit2();
+
+ /**
+ @fn uint32_t openCamera(qhyccd_deivce *d,qhyccd_handle **h)
+ @brief open the camera,open the device handle
+ @param d deivce deivce
+ @param h device control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t openCamera(qhyccd_device *d, qhyccd_handle **h);
+
+ /**
+ @fn void closeCamera(qhyccd_device *h)
+ @brief close the camera,close the deivce handle
+ @param h deivce control handle
+ */
+ void closeCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t sendForceStop(qhyccd_handle *h)
+ @brief force stop exposure
+ @param h device control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t sendForceStop(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t sendInterrupt(qhyccd_handle *handle,uint8_t length,uint8_t *data)
+ @brief send a package to deivce using the interrupt endpoint
+ @param handle device control handle
+ @param length the package size(unit:byte)
+ @param data package buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t sendInterrupt(qhyccd_handle *handle, uint8_t length, uint8_t *data);
+
+ /**
+ @fn uint32_t vendTXD(qhyccd_handle *dev_handle, uint8_t req, uint8_t *data, uint16_t length)
+ @brief send a package to deivce using the vendor request
+ @param dev_handle device control handle
+ @param req request command
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t vendTXD(qhyccd_handle *dev_handle, uint8_t req, uint8_t *data, uint16_t length);
+
+ /**
+ @fn uint32_t vendRXD(qhyccd_handle *dev_handle, uint8_t req, uint8_t *data, uint16_t length)
+ @brief get a package from deivce using the vendor request
+ @param dev_handle device control handle
+ @param req request command
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t vendRXD(qhyccd_handle *dev_handle, uint8_t req, uint8_t *data, uint16_t length);
+
+ /**
+ @fn iTXD(qhyccd_handle *dev_handle,uint8_t *data, int32_t length)
+ @brief send a package to deivce using the bulk endpoint
+ @param dev_handle device control handle
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t iTXD(qhyccd_handle *dev_handle, uint8_t *data, int32_t length);
+
+ /**
+ @fn iTXD_Ex(qhyccd_handle *dev_handle,uint8_t *data, int32_t length,uint8_t ep)
+ @brief send a package to deivce using the bulk endpoint
+ @param dev_handle device control handle
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @param ep the endpoint number
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t iTXD_Ex(qhyccd_handle *dev_handle, uint8_t *data, int32_t length, uint8_t ep);
+
+ /**
+ @fn iRXD(qhyccd_handle *dev_handle,uint8_t *data, int32_t length)
+ @brief get a package from deivce using the bulk endpoint
+ @param dev_handle device control handle
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t iRXD(qhyccd_handle *dev_handle, uint8_t *data, int32_t length);
+
+ /**
+ @fn iRXD_Ex(qhyccd_handle *dev_handle,uint8_t *data, int32_t length,uint8_t ep)
+ @brief get a package from deivce using the bulk endpoint
+ @param dev_handle device control handle
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @param ep the endpoint number
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t iRXD_Ex(qhyccd_handle *dev_handle, uint8_t *data, uint32_t length, uint8_t ep);
+
+ /**
+ @fn uint32_t vendTXD_Ex(qhyccd_handle *dev_handle, uint8_t req,uint16_t value,uint16_t index,uint8_t* data, uint16_t length)
+ @brief send a package to deivce using the vendor request,extend the index and value interface
+ @param dev_handle device control handle
+ @param req request command
+ @param value value interface
+ @param index index interface
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t vendTXD_Ex(qhyccd_handle *dev_handle, uint8_t req, uint16_t value, uint16_t index, uint8_t* data, uint16_t length);
+
+ /**
+ @fn uint32_t vendRXD_Ex(qhyccd_handle *dev_handle, uint8_t req,uint16_t value,uint16_t index,uint8_t* data, uint16_t length)
+ @brief get a package from deivce using the vendor request,extend the index and value interface
+ @param dev_handle device control handle
+ @param req request command
+ @param value value interface
+ @param index index interface
+ @param data package buffer
+ @param length the package size(unit:byte)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t vendRXD_Ex(qhyccd_handle *dev_handle, uint8_t req, uint16_t value, uint16_t index, uint8_t* data, uint16_t length);
+
+ uint32_t QHY5IIIreadUSB2B(qhyccd_handle *dev_handle, uint8_t *data, uint32_t p_num, uint32_t timeout);
+ /**
+ @fn uint32_t readUSB2B(qhyccd_handle *dev_handle, uint8_t *data,uint32_t p_size, uint32_t p_num, uint32_t* pos)
+ @brief get image packages from deivce using bulk endpoint
+ @param dev_handle device control handle
+ @param data package buffer
+ @param p_size package size
+ @param p_num package num
+ @param pos reserved
+ @param duration the exposure time
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t readUSB2B(qhyccd_handle *dev_handle, uint8_t *data, uint32_t p_size, uint32_t p_num, uint32_t* pos, uint32_t timeout);
+
+ /**
+ @fn uint32_t beginVideo(qhyccd_handle *handle)
+ @brief send begin exposure signal to deivce
+ @param handle device control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t beginVideo(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t sendRegisterQHYCCDOld(qhyccd_handle *handle,
+ CCDREG reg, uint32_t P_Size, uint32_t *Total_P, uint32_t *PatchNumber)
+ @brief send register params to deivce and some other info
+ @param handle deivce control handle
+ @param reg register struct
+ @param P_Size the package size
+ @param Total_P the total packages
+ @param PatchNumber the patch for usb transfer,the total size must multiple 512 bytes.
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t sendRegisterQHYCCDOld(qhyccd_handle *handle,
+ CCDREG reg, uint32_t P_Size, uint32_t *Total_P, uint32_t *PatchNumber);
+
+ /**
+ @fn uint32_t sendRegisterQHYCCDNew(qhyccd_handle *handle,
+ CCDREG reg, uint32_t P_Size, uint32_t *Total_P, uint32_t *PatchNumber)
+ @brief New interface!!! send register params to deivce and some other info
+ @param handle deivce control handle
+ @param reg register struct
+ @param P_Size the package size
+ @param Total_P the total packages
+ @param PatchNumber the patch for usb transfer,the total size must multiple 512 bytes.
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t sendRegisterQHYCCDNew(qhyccd_handle *handle,
+ CCDREG reg, uint32_t P_Size, uint32_t *Total_P, uint32_t *PatchNumber);
+
+ /**
+ @fn uint32_t sendRegisterBioCCD(qhyccd_handle *handle,BIOREG reg)
+ @brief api like sendRegisterQHYCCDOld,just a different version for some kinds of cameras
+ @param handle deivce control handle
+ @param reg register struct
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t sendRegisterBioCCD(qhyccd_handle *handle, BIOREG reg);
+
+ /**
+ @fn uint32_t setDisableGuider_INT(qhyccd_handle *handle)
+ @brief turn off the ST4 port(guide port)
+ @param handle deivce control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t setDisableGuider_INT(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t setBioCCDDigitalGain_INT(qhyccd_handle *handle,uint8_t gain)
+ @brief set bioccd digitalgain
+ @param handle deivce control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t setBioCCDDigitalGain_INT(qhyccd_handle *handle, uint8_t gain);
+
+ /**
+ @fn uint32_t setBioCCDGain_INT(qhyccd_handle *handle,uint8_t gain)
+ @brief set bioccd analog gain
+ @param handle deivce control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t setBioCCDGain_INT(qhyccd_handle *handle, uint16_t gain);
+
+ /**
+ @fn uint32_t getExpSetting(double T, uint32_t *ExpTime, int32_t *LiveExpTime, double A,double B, double V, double LinePeriod)
+ @brief calc the exposure time
+ @param T
+ @param ExpTime
+ @param LiveExpTime
+ @param A
+ @param B
+ @param V
+ @param LinePeriod
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t getExpSetting(double T, uint32_t *ExpTime, int32_t *LiveExpTime, double A, double B, double V, double LinePeriod);
+
+ /**
+ @fn uint32_t setBioCCDExp_INT(qhyccd_handle *handle,uint32_t ExpTime)
+ @brief set bioccd exposure time
+ @param handle deivce control handle
+ @param ExpTime exposure time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t setBioCCDExp_INT(qhyccd_handle *handle, uint32_t ExpTime);
+
+ /**
+ @fn uint32_t setBioCCDLiveExp_INT(qhyccd_handle *handle,uint16_t VideoExpTime)
+ @brief set bioccd live exposure time
+ @param handle deivce control handle
+ @param VideoExpTime live exposure time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t setBioCCDLiveExp_INT(qhyccd_handle *handle, uint16_t VideoExpTime);
+
+ /**
+ @fn uint32_t setDC201FromInterrupt(qhyccd_handle *handle,uint8_t PWM,uint8_t FAN)
+ @brief control the DC201 using the interrupt endpoint
+ @param handle deivce control handle
+ @param PWM cool power
+ @param FAN switch for camera's fan (NOT SUPPORT NOW)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t setDC201FromInterrupt(qhyccd_handle *handle, uint8_t PWM, uint8_t FAN);
+
+ /**
+ @fn signed short getDC201FromInterrupt(qhyccd_handle *handle)
+ @brief get the temprature value from DC201 using the interrupt endpoint
+ @param handle deivce control handle
+ @return
+ success return temprature value \n
+ another QHYCCD_ERROR code on other failures
+ */
+ int16_t getDC201FromInterrupt(qhyccd_handle *handle);
+
+ /**
+ @fn uint8_t getFromInterrupt(qhyccd_handle *handle,uint8_t length,uint8_t *data)
+ @brief get some special information from deivce,using interrupt endpoint
+ @param handle deivce control handle
+ @param length package size
+ @param data package buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint8_t getFromInterrupt(qhyccd_handle *handle, uint8_t length, uint8_t *data);
+
+ /**
+ @fn double GetCCDTemp(qhyccd_handle *handle)
+ @brief get ccd/cmos chip temperature
+ @param handle deivce control handle
+ @return
+ success return temperature \n
+ */
+ double GetCCDTemp(qhyccd_handle *handle);
+
+ /**
+ @fn double RToDegree(double R)
+ @brief calc,transfer R to degree
+ @param R R
+ @return
+ success return degree
+ */
+ double RToDegree(double R);
+
+ /**
+ @fn double mVToDegree(double V)
+ @brief calc,transfer mV to degree
+ @param V mv
+ @return
+ success return degree
+ */
+ double mVToDegree(double V);
+
+ /**
+ @fn double DegreeTomV(double degree)
+ @brief calc,transfer degree to mv
+ @param degree degree
+ @return
+ success return mv
+ */
+ double DegreeTomV(double degree);
+
+ /**
+ @fn double DegreeToR(double degree)
+ @brief calc,transfer degree to R
+ @param degree degree
+ @return
+ success return R
+ */
+ double DegreeToR(double degree);
+
+ /**
+ @fn uint32_t I2CTwoWrite(qhyccd_handle *handle,uint16_t addr,uint16_t value)
+ @brief set param by I2C
+ @param handle device control handle
+ @param addr inter reg addr
+ @param value param value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t I2CTwoWrite(qhyccd_handle *handle, uint16_t addr, uint16_t value);
+
+ /**
+ @fn uint16_t I2CTwoRead(qhyccd_handle *handle,uint16_t addr)
+ @brief get param by I2C
+ @param handle device control handle
+ @param addr inter reg addr
+ @return
+ success return param value \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint16_t I2CTwoRead(qhyccd_handle *handle, uint16_t addr);
+
+ /**
+ @fn uint8_t MSB(uint16_t i)
+ @brief apart the 16 bits value to 8bits(high 8bits)
+ @param i 16bits value
+ @return
+ success return 8bits value(high 8bits) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint8_t MSB(uint16_t i);
+
+ /**
+ @fn uint8_t LSB(uint16_t i)
+ @brief apart the 16 bits value to 8bits(low 8bits)
+ @param i 16bits value
+ @return
+ success return 8bits value(low 8bits) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint8_t LSB(uint16_t i);
+ uint8_t MSB3(uint32_t i);
+ uint8_t MSB2(uint32_t i);
+ uint8_t MSB1(uint32_t i);
+ uint8_t MSB0(uint32_t i);
+
+ void SWIFT_MSBLSB12BITS(uint8_t * Data, uint32_t x, uint32_t y);
+ void SWIFT_MSBLSB16BITS(uint8_t * Data, uint32_t x, uint32_t y);
+ void SWIFT_MSBLSB14BITS(uint8_t * Data, uint32_t x, uint32_t y);
+
+ void QHY5II_SWIFT_MSBLSB12BITS(uint8_t * Data, uint32_t x, uint32_t y);
+ void QHY5II_SWIFT_MSBLSB14BITS(uint8_t * Data, uint32_t x, uint32_t y);
+ void QHY5II_SWIFT_8BitsTo16Bits(uint8_t * Dst, uint8_t * Src, uint32_t x, uint32_t y);
+
+ void QHY5II_DeNoise(uint8_t *data, uint32_t x, uint32_t y, double curgain);
+ //void OutputDebugPrintf(const char * strOutputString,...);
+
+ static void *pollHandleEvents(void *arg);
+ static void findCompleteFrame(uint8_t *rawarray, uint32_t length);
+ static void asyImageDataCallBack(struct libusb_transfer *transfer);
+ const char* STDCALL GetTimeStamp();
+
+ uint32_t camstatus; // the camera current status
+ uint32_t ep1num; // ep1in transfer data length
+ uint32_t usbintrep; // usb interrupt read endpoint
+ uint32_t psize; // usb transfer package size at onece
+ uint32_t totalp; // the total usb transfer packages
+ uint32_t patchnumber; // patch for image transfer packages
+ uint32_t readp; // the number of alreay read usb transfer packages
+
+ int32_t m_UsbTransferred;
+
+ uint8_t m_disableTempReadout;
+
+ uint8_t usbep; // usb transfer endpoint
+ uint8_t usbintwep; // usb interrupt write endpoint
+ uint8_t intepflag;
+ uint8_t usbtype;
+ uint8_t m_UsbPacket[LIBUSB_PACKET_LENGTH];
+
+ CCDREG ccdreg; // ccd registers params
+ BIOREG imgreg; // bioccd registers params
+ char timeStampStr[128];
+
+#ifdef WIN32
+ CRITICAL_SECTION csep;
+#else
+ pthread_mutex_t mutex;
+#endif
+
+};
+
+#endif
diff --git a/include/qhy/qhyccd.h b/include/qhy/qhyccd.h new file mode 100644 index 0000000..8f709e1 --- /dev/null +++ b/include/qhy/qhyccd.h @@ -0,0 +1,139 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+#ifndef _QHYCCD_H_
+#define _QHYCCD_H_
+
+#include "qhycam.h"
+#include "qhyccderr.h"
+#include "qhyccdcamdef.h"
+#include "qhyccdstruct.h"
+#include "stdint.h"
+#include "qhydevice.h"
+
+#ifdef WIN32
+#include "cyapi.h"
+typedef CCyUSBDevice qhyccd_handle;
+#else // Linux & Mac
+typedef struct libusb_device_handle qhyccd_handle;
+uint32_t DeviceIsQHYCCD(uint32_t index, qhyccd_device *pDevice);
+EXPORTC void STDCALL MutexInit();
+EXPORTC void STDCALL MutexDestroy();
+EXPORTC void STDCALL MutexLock();
+EXPORTC void STDCALL MutexUnlock();
+EXPORTC int STDCALL MutexTrylock();
+#endif // WIN32
+
+class QHYBASE;
+class QhyDevice;
+
+uint32_t DeviceIsQHYCCD(uint32_t index, uint32_t vid, uint32_t pid);
+uint32_t QHYCCDSeriesMatch(uint32_t index, qhyccd_handle *pHandle);
+uint32_t GetIdFromCam(qhyccd_handle *pHandle, char *id);
+
+EXPORTC QhyDevice* STDCALL GetCyDevBasedOnInstance(QHYBASE *pCam);
+EXPORTC QhyDevice* STDCALL GetCyDevBasedOnHandle(qhyccd_handle *pHandle);
+EXPORTC int GetCyDevIdxBasedOnInstance(QHYBASE *pCam);
+EXPORTC int GetCyDevIdxBasedOnHandle(qhyccd_handle *pHandle);
+EXPORTC uint32_t STDCALL GetReceivedRawDataLen(QHYBASE *pCam);
+EXPORTC bool STDCALL SetReceivedRawDataLen(QHYBASE *pCam, uint32_t value);
+EXPORTC bool STDCALL CleanUnlockImageQueue(QHYBASE *pCam);
+//EXPORTC bool STDCALL SetUnlockImageQueue(QHYBASE *pCam);
+EXPORTC uint32_t STDCALL InitQHYCCDClass(uint32_t camtype, uint32_t index);
+EXPORTC uint32_t STDCALL InitQHYCCDResource(void);
+EXPORTC uint32_t STDCALL ReleaseQHYCCDResource(void);
+EXPORTC uint32_t STDCALL ScanQHYCCD(void);
+EXPORTC uint32_t STDCALL GetQHYCCDId(int index, char *id);
+EXPORTC uint32_t STDCALL GetQHYCCDModel(char *id, char *model);
+EXPORTC qhyccd_handle * STDCALL OpenQHYCCD(char *id);
+EXPORTC uint32_t STDCALL CloseQHYCCD(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL SetQHYCCDStreamMode(qhyccd_handle *handle,uint8_t mode);
+EXPORTC uint32_t STDCALL InitQHYCCD(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL IsQHYCCDControlAvailable(qhyccd_handle *handle,CONTROL_ID controlId);
+EXPORTC uint32_t STDCALL SetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId, double value);
+EXPORTC double STDCALL GetQHYCCDParam(qhyccd_handle *handle,CONTROL_ID controlId);
+EXPORTC uint32_t STDCALL GetQHYCCDParamMinMaxStep(qhyccd_handle *handle,CONTROL_ID controlId,double *min,double *max,double *step);
+EXPORTC uint32_t STDCALL SetQHYCCDResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+EXPORTC uint32_t STDCALL GetQHYCCDMemLength(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL ExpQHYCCDSingleFrame(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL GetQHYCCDSingleFrame(qhyccd_handle *handle,uint32_t *w,uint32_t *h,uint32_t *bpp,uint32_t *channels,uint8_t *imgdata);
+EXPORTC uint32_t STDCALL CancelQHYCCDExposing(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL CancelQHYCCDExposingAndReadout(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL BeginQHYCCDLive(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL GetQHYCCDLiveFrame(qhyccd_handle *handle,uint32_t *w,uint32_t *h,uint32_t *bpp,uint32_t *channels,uint8_t *imgdata);
+EXPORTC uint32_t STDCALL StopQHYCCDLive(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL SetQHYCCDBinMode(qhyccd_handle *handle,uint32_t wbin,uint32_t hbin);
+EXPORTC uint32_t STDCALL SetQHYCCDBitsMode(qhyccd_handle *handle,uint32_t bits);
+EXPORTC uint32_t STDCALL ControlQHYCCDTemp(qhyccd_handle *handle,double targettemp);
+EXPORTC uint32_t STDCALL ControlQHYCCDGuide(qhyccd_handle *handle,uint32_t direction,uint16_t duration);
+EXPORTC uint32_t STDCALL SendOrder2QHYCCDCFW(qhyccd_handle *handle,char *order,uint32_t length);
+EXPORTC uint32_t STDCALL GetQHYCCDCFWStatus(qhyccd_handle *handle,char *status);
+EXPORTC uint32_t STDCALL IsQHYCCDCFWPlugged(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL SetQHYCCDTrigerMode(qhyccd_handle *handle,uint32_t trigerMode);
+EXPORTC void STDCALL Bits16ToBits8(qhyccd_handle *h,uint8_t *InputData16,uint8_t *OutputData8,uint32_t imageX,uint32_t imageY,uint16_t B,uint16_t W);
+EXPORTC void STDCALL HistInfo192x130(qhyccd_handle *h,uint32_t x,uint32_t y,uint8_t *InBuf,uint8_t *OutBuf);
+EXPORTC uint32_t STDCALL OSXInitQHYCCDFirmware(char *path);
+EXPORTC uint32_t STDCALL GetQHYCCDChipInfo(qhyccd_handle *h,double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh,uint32_t *bpp);
+EXPORTC uint32_t STDCALL GetQHYCCDEffectiveArea(qhyccd_handle *h,uint32_t *startX, uint32_t *startY, uint32_t *sizeX, uint32_t *sizeY);
+EXPORTC uint32_t STDCALL GetQHYCCDOverScanArea(qhyccd_handle *h,uint32_t *startX, uint32_t *startY, uint32_t *sizeX, uint32_t *sizeY);
+EXPORTC uint32_t STDCALL SetQHYCCDFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+EXPORTC uint32_t STDCALL GetQHYCCDExposureRemaining(qhyccd_handle *h);
+EXPORTC uint32_t STDCALL GetQHYCCDFWVersion(qhyccd_handle *h,uint8_t *buf);
+EXPORTC uint32_t STDCALL SetQHYCCDInterCamSerialParam(qhyccd_handle *h,uint32_t opt);
+EXPORTC uint32_t STDCALL QHYCCDInterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length);
+EXPORTC uint32_t STDCALL QHYCCDInterCamSerialRX(qhyccd_handle *h,char *buf);
+EXPORTC uint32_t STDCALL QHYCCDInterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff);
+EXPORTC uint32_t STDCALL SetQHYCCDInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness);
+EXPORTC uint32_t STDCALL SendFourLine2QHYCCDInterCamOled(qhyccd_handle *handle,char *messagetemp,char *messageinfo,char *messagetime,char *messagemode);
+EXPORTC uint32_t STDCALL SendTwoLine2QHYCCDInterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom);
+EXPORTC uint32_t STDCALL SendOneLine2QHYCCDInterCamOled(qhyccd_handle *handle,char *messageTop);
+EXPORTC uint32_t STDCALL GetQHYCCDCameraStatus(qhyccd_handle *h,uint8_t *buf);
+EXPORTC uint32_t STDCALL GetQHYCCDShutterStatus(qhyccd_handle *handle);
+EXPORTC uint32_t STDCALL ControlQHYCCDShutter(qhyccd_handle *handle,uint8_t status);
+EXPORTC uint32_t STDCALL GetQHYCCDHumidity(qhyccd_handle *handle,double *hd);
+EXPORTC uint32_t STDCALL QHYCCDI2CTwoWrite(qhyccd_handle *handle,uint16_t addr,uint16_t value);
+EXPORTC uint32_t STDCALL QHYCCDI2CTwoRead(qhyccd_handle *handle,uint16_t addr);
+EXPORTC double STDCALL GetQHYCCDReadingProgress(qhyccd_handle *handle);
+EXPORTC void STDCALL SetQHYCCDLogLevel(uint8_t logLevel);
+EXPORTC uint32_t STDCALL TestQHYCCDPIDParas(qhyccd_handle *h, double p, double i, double d);
+EXPORTC uint32_t STDCALL SetQHYCCDTrigerFunction(qhyccd_handle *h,bool value);
+EXPORTC uint32_t STDCALL DownloadFX3FirmWare(uint16_t vid,uint16_t pid,char *imgpath);
+EXPORTC uint32_t STDCALL GetQHYCCDType(qhyccd_handle *h);
+EXPORTC uint32_t STDCALL SetQHYCCDDebayerOnOff(qhyccd_handle *h,bool onoff);
+EXPORTC uint32_t STDCALL SetQHYCCDFineTone(qhyccd_handle *h,uint8_t setshporshd,uint8_t shdloc,uint8_t shploc,uint8_t shwidth);
+EXPORTC uint32_t STDCALL SetQHYCCDGPSVCOXFreq(qhyccd_handle *handle,uint16_t i);
+EXPORTC uint32_t STDCALL SetQHYCCDGPSLedCalMode(qhyccd_handle *handle,uint8_t i);
+EXPORTC void STDCALL SetQHYCCDGPSLedCal(qhyccd_handle *handle,uint32_t pos,uint8_t width);
+EXPORTC void STDCALL SetQHYCCDGPSPOSA(qhyccd_handle *handle,uint8_t is_slave,uint32_t pos,uint8_t width);
+EXPORTC void STDCALL SetQHYCCDGPSPOSB(qhyccd_handle *handle,uint8_t is_slave,uint32_t pos,uint8_t width);
+EXPORTC uint32_t STDCALL SetQHYCCDGPSMasterSlave(qhyccd_handle *handle,uint8_t i);
+EXPORTC void STDCALL SetQHYCCDGPSSlaveModeParameter(qhyccd_handle *handle,uint32_t target_sec,uint32_t target_us,uint32_t deltaT_sec,uint32_t deltaT_us,uint32_t expTime);
+EXPORTC uint32_t STDCALL QHYCCDVendRequestWrite(qhyccd_handle *h,uint8_t req,uint16_t value,uint16_t index1,uint32_t length,uint8_t *data);
+EXPORTC uint32_t STDCALL QHYCCDReadUSB_SYNC(qhyccd_handle *pDevHandle, uint8_t endpoint, uint32_t length, uint8_t *data, uint32_t timeout);
+EXPORTC uint32_t STDCALL QHYCCDLibusbBulkTransfer(qhyccd_handle *pDevHandle, uint8_t endpoint, uint8_t *data, uint32_t length, int32_t *transferred, uint32_t timeout);
+EXPORTC uint32_t STDCALL GetQHYCCDSDKVersion(uint32_t *year,uint32_t *month,uint32_t *day,uint32_t *subday);
+EXPORTC void STDCALL print_cydev(const char *pTitle);
+EXPORTC const char* STDCALL GetTimeStamp();
+EXPORTC void STDCALL GetQHYCCDControlIdString(CONTROL_ID controlId, char *pStr);
+
+#endif // __QHYCCD_H__
diff --git a/include/qhy/qhyccd3a.h b/include/qhy/qhyccd3a.h new file mode 100644 index 0000000..7c8d3f2 --- /dev/null +++ b/include/qhy/qhyccd3a.h @@ -0,0 +1,48 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhybase.h"
+#include "stdint.h"
+
+#ifdef WIN32
+
+void STDCALL Init_3A_AutoExposure(qhyccd_handle *h, double curaec, double curagc);
+
+void STDCALL Release_3A_AutoExposure();
+
+void STDCALL AECAGC(qhyccd_handle *camhandle,IplImage *img, int MessureMethod, int ControlMode);
+
+void STDCALL Init_3A_AutoWhiteBalance(qhyccd_handle *h);
+
+uint32_t STDCALL AutoControlWhiteBlance(qhyccd_handle *h,IplImage *img,uint32_t isglobal,uint32_t x,uint32_t y);
+
+void STDCALL Release_3A_AutoWhiteBalance();
+
+void STDCALL Init_3A_AutoFocus(qhyccd_handle *h);
+
+uint32_t STDCALL GetFocusCandy(IplImage *img, IplImage *outputImg, int x, int y);
+
+void STDCALL Release_3A_AutoFocus();
+
+#endif
\ No newline at end of file diff --git a/include/qhy/qhyccdcamdef.h b/include/qhy/qhyccdcamdef.h new file mode 100644 index 0000000..e7051f4 --- /dev/null +++ b/include/qhy/qhyccdcamdef.h @@ -0,0 +1,528 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ @file qhyccdcamdef.h
+ @brief QHYCCD SDK error define
+ */
+
+#ifndef __QHYCCDCAMDEF_H__
+#define __QHYCCDCAMDEF_H__
+
+//#define GIGAESUPPORT
+
+//#define QHYCCD_OPENCV_SUPPORT
+
+
+/* IMG series */
+
+
+/**
+ * Type define for IMG0S */
+#define DEVICETYPE_IMG0S 1000
+
+/**
+ * Type define for IMG0H */
+#define DEVICETYPE_IMG0H 1001
+
+/**
+ * Type define for IMG0L */
+#define DEVICETYPE_IMG0L 1002
+
+/**
+ * Type define for IMG0X */
+#define DEVICETYPE_IMG0X 1003
+
+/**
+ * Type define for IMG1S */
+#define DEVICETYPE_IMG1S 1004
+
+/**
+ * Type define for IMG2S */
+#define DEVICETYPE_IMG2S 1005
+
+/**
+ * Type define for IMG1E */
+#define DEVICETYPE_IMG1E 1006
+
+
+/* QHY5 seires */
+
+/**
+ * Type define for QHY5 */
+#define DEVICETYPE_QHY5 2001
+
+
+/* QHY5II series */
+
+/**
+ * Type define for QHY5II */
+#define DEVICETYPE_QHY5II 3001
+
+/**
+ * Type define for QHY5LII_M */
+#define DEVICETYPE_QHY5LII_M 3002
+
+/**
+ * Type define for QHY5LII_C */
+#define DEVICETYPE_QHY5LII_C 3003
+
+/**
+ * Type define for QHY5TII */
+#define DEVICETYPE_QHY5TII 3004
+
+/**
+ * Type define for QHY5RII */
+#define DEVICETYPE_QHY5RII 3005
+
+/**
+ * Type define for QHY5PII */
+#define DEVICETYPE_QHY5PII 3006
+
+/**
+ * Type define for QHY5VII */
+#define DEVICETYPE_QHY5VII 3007
+
+/**
+ * Type define for QHY5HII */
+#define DEVICETYPE_QHY5HII 3008
+
+/**
+ * Type define for QHYXXX */
+#define DEVICETYPE_MINICAM5S_M 3009
+
+/**
+ * Type define for QHYXXX */
+#define DEVICETYPE_MINICAM5S_C 3010
+
+/**
+ * Type define for QHY5PII_C */
+#define DEVICETYPE_QHY5PII_C 3011
+
+/**
+ * Type define for QHY5RII-M */
+#define DEVICETYPE_QHY5RII_M 3012
+
+/**
+ * Type define for QHY5RII-M */
+#define DEVICETYPE_MINICAM5F_M 3013
+
+/**
+ * Type define for QHY5PII_M */
+#define DEVICETYPE_QHY5PII_M 3014
+
+/**
+ * Type define for QHY5TII */
+#define DEVICETYPE_QHY5TII_C 3015
+
+/**
+ * Type define for POLEMASTER */
+#define DEVICETYPE_POLEMASTER 3016
+
+/**
+ * Type define for QHY5IIEND */
+#define DEVICETYPE_QHY5IIEND 3999
+
+
+/* QHY5III seires */
+
+/**
+ * Type define for QHY5III174*/
+#define DEVICETYPE_QHY5III174 4000
+
+/**
+ * Type define for QHY5III174 */
+#define DEVICETYPE_QHY5III174M 4001
+
+/**
+ * Type define for QHY5III174C*/
+#define DEVICETYPE_QHY5III174C 4002
+
+/**
+ * Type define for QHY174*/
+#define DEVICETYPE_QHY174 4003
+
+/**
+ * Type define for QHY174M*/
+#define DEVICETYPE_QHY174M 4004
+
+/**
+ * Type define for QHY174C*/
+#define DEVICETYPE_QHY174C 4005
+
+/**
+ * Type define for QHY5III178*/
+#define DEVICETYPE_QHY5III178 4006
+
+/**
+ * Type define for QHY5III178C*/
+#define DEVICETYPE_QHY5III178C 4007
+
+/**
+ * Type define for QHY5III178M*/
+#define DEVICETYPE_QHY5III178M 4008
+
+/**
+ * Type define for QHY178*/
+#define DEVICETYPE_QHY178 4009
+
+/**
+ * Type define for QHY178M*/
+#define DEVICETYPE_QHY178M 4010
+
+/**
+ * Type define for QHY178C*/
+#define DEVICETYPE_QHY178C 4011
+
+/**
+ * Type define for QHY5III185*/
+#define DEVICETYPE_QHY5III185 4012
+
+/**
+ * Type define for QHY5III185C*/
+#define DEVICETYPE_QHY5III185C 4013
+
+/**
+ * Type define for QHY5III185M*/
+#define DEVICETYPE_QHY5III185M 4014
+
+/**
+ * Type define for QHY185*/
+#define DEVICETYPE_QHY185 4015
+
+/**
+ * Type define for QHY185M*/
+#define DEVICETYPE_QHY185M 4016
+
+/**
+ * Type define for QHY185C*/
+#define DEVICETYPE_QHY185C 4017
+
+/**
+ * Type define for QHY5III224*/
+#define DEVICETYPE_QHY5III224 4018
+
+/**
+ * Type define for QHY5III224C*/
+#define DEVICETYPE_QHY5III224C 4019
+
+/**
+ * Type define for QHY5III224M*/
+#define DEVICETYPE_QHY5III224M 4020
+
+/**
+ * Type define for QHY224*/
+#define DEVICETYPE_QHY224 4021
+
+/**
+ * Type define for QHY224M*/
+#define DEVICETYPE_QHY224M 4022
+
+/**
+ * Type define for QHY224C*/
+#define DEVICETYPE_QHY224C 4023
+
+/**
+ * Type define for QHY5III290*/
+#define DEVICETYPE_QHY5III290 4024
+
+/**
+ * Type define for QHY5III290C*/
+#define DEVICETYPE_QHY5III290C 4025
+
+/**
+ * Type define for QHY5III290M*/
+#define DEVICETYPE_QHY5III290M 4026
+
+/**
+ * Type define for QHY290*/
+#define DEVICETYPE_QHY290 4027
+
+/**
+ * Type define for QHY290M*/
+#define DEVICETYPE_QHY290M 4028
+
+/**
+ * Type define for QHY290C*/
+#define DEVICETYPE_QHY290C 4029
+
+/**
+ * Type define for QHY5III236*/
+#define DEVICETYPE_QHY5III236 4030
+
+/**
+ * Type define for QHY5III236C*/
+#define DEVICETYPE_QHY5III236C 4031
+
+/**
+ * Type define for QHY5III290M*/
+#define DEVICETYPE_QHY5III236M 4032
+
+/**
+ * Type define for QHY236*/
+#define DEVICETYPE_QHY236 4033
+
+/**
+ * Type define for QHY236M*/
+#define DEVICETYPE_QHY236M 4034
+
+/**
+ * Type define for QHY236C*/
+#define DEVICETYPE_QHY236C 4035
+
+/**
+ * Type define for GSENSE400*/
+#define DEVICETYPE_QHY5IIIG400M 4036
+
+/**
+ * Type define for QHY163*/
+#define DEVICETYPE_QHY163 4037
+
+/**
+ * Type define for QHY163M*/
+#define DEVICETYPE_QHY163M 4038
+
+/**
+ * Type define for QHY163C*/
+#define DEVICETYPE_QHY163C 4039
+
+/**
+ * Type define for QHY165*/
+#define DEVICETYPE_QHY165 4040
+
+/**
+ * Type define for QHY165C*/
+#define DEVICETYPE_QHY165C 4041
+
+/**
+ * Type define for QHY367*/
+#define DEVICETYPE_QHY367 4042
+
+/**
+ * Type define for QHY367C*/
+#define DEVICETYPE_QHY367C 4043
+
+/**
+ * Type define for QHY183*/
+#define DEVICETYPE_QHY183 4044
+
+/**
+ * Type define for QHY183C*/
+#define DEVICETYPE_QHY183C 4045
+
+/**
+ * Type define for QHY-DevelopDev*/
+#define DEVICETYPE_QHY5IIICOMMON 4046
+
+/**
+ * Type define for QHY247*/
+#define DEVICETYPE_QHY247 4047
+
+/**
+ * Type define for QHY247C*/
+#define DEVICETYPE_QHY247C 4048
+
+/**
+ * Type define for MINICAM6F*/
+#define DEVICETYPE_MINICAM6F 4049
+
+/**
+ * Type define for QHY168C*/
+#define DEVICETYPE_QHY168 4050
+
+#define DEVICETYPE_QHY168C 4051
+
+/**
+ * Type define for QHY128C*/
+#define DEVICETYPE_QHY128 4052
+
+#define DEVICETYPE_QHY128C 4053
+#define DEVICETYPE_QHY294 4054
+#define DEVICETYPE_QHY2020 4055
+#define DEVICETYPE_QHY4040 4056
+
+
+
+/**
+ * Type define for QHY5IIIEND*/
+#define DEVICETYPE_QHY5IIIEND 4999
+
+/**
+ * Type define for QHY16 */
+#define DEVICETYPE_QHY16 16
+
+/**
+ * Type define for QHY6 */
+#define DEVICETYPE_QHY6 60
+
+/**
+ * Type define for QHY7 */
+#define DEVICETYPE_QHY7 70
+
+/**
+ * Type define for QHY2PRO */
+#define DEVICETYPE_QHY2PRO 221
+
+/**
+ * Type define for IMG2P */
+#define DEVICETYPE_IMG2P 220
+
+/**
+ * Type define for QHY8 */
+#define DEVICETYPE_QHY8 400
+
+/**
+ * Type define for QHY8PRO */
+#define DEVICETYPE_QHY8PRO 453
+
+/**
+ * Type define for QHY16000 */
+#define DEVICETYPE_QHY16000 361
+
+/**
+ * Type define for QHY12 */
+#define DEVICETYPE_QHY12 613
+
+/**
+ * Type define for IC8300 */
+#define DEVICETYPE_IC8300 890
+
+/**
+ * Type define for QHY9S */
+#define DEVICETYPE_QHY9S 892
+
+/**
+ * Type define for QHY10 */
+#define DEVICETYPE_QHY10 893
+
+/**
+ * Type define for QHY8L */
+#define DEVICETYPE_QHY8L 891
+
+/**
+ * Type define for QHY11 */
+#define DEVICETYPE_QHY11 894
+
+/**
+ * Type define for QHY21 */
+#define DEVICETYPE_QHY21 895
+
+/**
+ * Type define for QHY22 */
+#define DEVICETYPE_QHY22 896
+
+/**
+ * Type define for QHY23 */
+#define DEVICETYPE_QHY23 897
+
+/**
+ * Type define for QHY15 */
+#define DEVICETYPE_QHY15 898
+
+/**
+ * Type define for QHY27 */
+#define DEVICETYPE_QHY27 899
+
+
+/**
+ * Type define for QHY28 */
+#define DEVICETYPE_QHY28 902
+
+/**
+ * Type define for QHY9T */
+#define DEVICETYPE_QHY9T 905
+
+/**
+ * Type define for QHY29 */
+#define DEVICETYPE_QHY29 907
+
+/**
+ * Type define for SOLAR1600 */
+#define DEVICETYPE_SOLAR1600 908
+
+/* QHYA seires */
+
+/**
+ * Type define for QHY90A/IC90A */
+#define DEVICETYPE_90A 900
+
+/**
+ * Type define for QHY16200A/IC16200A */
+#define DEVICETYPE_16200A 901
+
+/**
+ * Type define for QHY814A/IC814A */
+#define DEVICETYPE_814A 903
+
+/**
+ * Type define for 16803 */
+#define DEVICETYPE_16803 906
+
+/**
+ * Type define for 16803 */
+#define DEVICETYPE_09000 930
+
+
+/**
+ * Type define for 695A*/
+#define DEVICETYPE_695A 916
+
+
+/**
+ * Type define for QHY15GIGAE */
+#define DEVICETYPE_QHY15G 9000
+
+/**
+ * Type define for SOLAR800G */
+#define DEVICETYPE_SOLAR800G 9001
+
+#define DEVICETYPE_A0340G 9003
+
+#define DEVICETYPE_QHY08050G 9004
+
+#define DEVICETYPE_QHY694G 9005
+
+#define DEVICETYPE_QHY27G 9006
+
+#define DEVICETYPE_QHY23G 9007
+
+#define DEVICETYPE_QHY16000G 9008
+
+#define DEVICETYPE_QHY160002AD 9009
+
+#define DEVICETYPE_QHY814G 9010
+
+#define DEVICETYPE_QHY45GX 9011
+
+#define DEVICETYPE_QHY10_FOCUS 9012
+
+#define DEVICETYPE_QHY50GX 9013
+
+
+
+/**
+ * Type define for UNKNOWN */
+#define DEVICETYPE_UNKNOWN -1
+
+#endif
diff --git a/include/qhy/qhyccderr.h b/include/qhy/qhyccderr.h new file mode 100644 index 0000000..be24b3a --- /dev/null +++ b/include/qhy/qhyccderr.h @@ -0,0 +1,169 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! \file qhyccderr.h
+ \brief QHYCCD SDK error define
+ */
+
+#ifndef __QHYCCDERR_H__
+#define __QHYCCDERR_H__
+
+#define QHYCCD_READ_DIRECTLY 0x2001
+
+#define QHYCCD_DELAY_200MS 0x2000
+/**
+ * It means the camera using GiGaE transfer data */
+#define QHYCCD_QGIGAE 7
+
+/**
+ * It means the camera using usb sync transfer data */
+#define QHYCCD_USBSYNC 6
+
+/**
+ * It means the camera using usb async transfer data */
+#define QHYCCD_USBASYNC 5
+
+/**
+ * It means the camera is color one */
+#define QHYCCD_COLOR 4
+
+/**
+ * It means the camera is mono one*/
+#define QHYCCD_MONO 3
+
+/**
+ * It means the camera has cool function */
+#define QHYCCD_COOL 2
+
+/**
+ * It means the camera do not have cool function */
+#define QHYCCD_NOTCOOL 1
+
+/**
+ * camera works well */
+#define QHYCCD_SUCCESS 0
+
+/**
+ * Other error */
+#define QHYCCD_ERROR 0xFFFFFFFF
+
+#if 0
+/**
+ * There is no camera connected */
+#define QHYCCD_ERROR_NO_DEVICE -2
+
+/**
+ * Do not support the function */
+#define QHYCCD_ERROR -3
+
+/**
+ * Set camera params error */
+#define QHYCCD_ERROR_SETPARAMS -4
+
+/**
+ * Get camera params error */
+#define QHYCCD_ERROR_GETPARAMS -5
+
+/**
+ * The camera is exposing now */
+#define QHYCCD_ERROR_EXPOSING -6
+
+/**
+ * The camera expose failed */
+#define QHYCCD_ERROR_EXPFAILED -7
+
+/**
+ * There is another instance is getting data from camera */
+#define QHYCCD_ERROR_GETTINGDATA -8
+
+/**
+ * Get data from camera failed */
+#define QHYCCD_ERROR_GETTINGFAILED -9
+
+/**
+ * Init camera failed */
+#define QHYCCD_ERROR_INITCAMERA -10
+
+/**
+ * Release SDK resouce failed */
+#define QHYCCD_ERROR_RELEASERESOURCE -11
+
+/**
+ * Init SDK resouce failed */
+#define QHYCCD_ERROR_INITRESOURCE -12
+
+/**
+ * There is no match camera */
+#define QHYCCD_ERROR -13
+
+/**
+ * Open cam failed */
+#define QHYCCD_ERROR_OPENCAM -14
+
+/**
+ * Init cam class failed */
+#define QHYCCD_ERROR_INITCLASS -15
+
+/**
+ * Set Resolution failed */
+#define QHYCCD_ERROR -16
+
+/**
+ * Set usbtraffic failed */
+#define QHYCCD_ERROR -17
+
+/**
+ * Set usb speed failed */
+#define QHYCCD_ERROR -18
+
+/**
+ * Set expose time failed */
+#define QHYCCD_ERROR_SETEXPOSE -19
+
+/**
+ * Set cam gain failed */
+#define QHYCCD_ERROR_SETGAIN -20
+
+/**
+ * Set cam white balance red failed */
+#define QHYCCD_ERROR_SETRED -21
+
+/**
+ * Set cam white balance blue failed */
+#define QHYCCD_ERROR_SETBLUE -22
+
+/**
+ * Set cam white balance blue failed */
+#define QHYCCD_ERROR_EVTCMOS -23
+
+/**
+ * Set cam white balance blue failed */
+#define QHYCCD_ERROR_EVTUSB -24
+
+/**
+ * Set cam white balance blue failed */
+#define QHYCCD_ERROR -25
+#endif // #if 0
+
+#endif
diff --git a/include/qhy/qhyccdhex2cam.h b/include/qhy/qhyccdhex2cam.h new file mode 100644 index 0000000..c64d506 --- /dev/null +++ b/include/qhy/qhyccdhex2cam.h @@ -0,0 +1,292 @@ +/* + QHYCCD SDK + + Copyright (c) 2014 QHYCCD. + All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + The full GNU General Public License is included in this distribution in the + file called LICENSE. + */ + +/*! + * @file qhyccdhex2cam.h + * @brief QHYCCD SDK struct define + */ + +#ifndef __QHYCCDHEX2CAMDEF_H__ +#define __QHYCCDHEX2CAMDEF_H__ + +#define FX2_CPUCS_ADDR (0xE600) +#define FX2_INT_RAMSIZE (0x4000) + +#define VENDORCMD_TIMEOUT (5000) +#define MAX_LINE_LENGTH (512) +#define MAX_BYTES_PER_LINE (256) +#define EEPROM_WRITE_SIZE (1024) + +#define ROUND_UP(n,v) ((((n) + ((v) - 1)) / (v)) * (v)) +#define CHAR_TO_HEXVAL(c) ((((c) >= '0') && ((c) <= '9')) ? ((c) - '0') : ((((c) - 'A') & 0x0F) + 10)) +#define GET_HEX_BYTE(char_p) (((CHAR_TO_HEXVAL((char_p)[0])) << 4) | (CHAR_TO_HEXVAL((char_p)[1]))) +#define GET_HEX_WORD(char_p) (((CHAR_TO_HEXVAL((char_p)[0])) << 12) | ((CHAR_TO_HEXVAL((char_p)[1])) << 8) | \ +((CHAR_TO_HEXVAL((char_p)[2])) << 4) | (CHAR_TO_HEXVAL((char_p)[3]))) + +/* List of supported programming targets */ +typedef enum { + FW_TARGET_NONE = 0, // Invalid target + FW_TARGET_RAM, // Program firmware (hex) to RAM + FW_TARGET_SM_I2C, // Program VID and PID to Small I2C EEPROM + FW_TARGET_LR_I2C // Program VID and PID to Large I2C EEPROM +} fx2_fw_tgt_p; + +/* +static char fx2_vendax[][256] = { + ":0a0d3e0000010202030304040505", + ":10064d00E4F52CF52BF52AF529C203C200C202C2", + ":10065d0001120C6C7E0A7F008E0A8F0B75120A75", + ":10066d00131275080A75091C75100A75114A7514", + ":10067d000A751578EE54C07003020752752D0075", + ":10068d002E808E2F8F30C3749A9FFF740A9ECF24", + ":10069d0002CF3400FEE48F288E27F526F525F524", + ":1006ad00F523F522F521AF28AE27AD26AC25AB24", + ":1006bd00AA23A922A821C3120D035037E5302524", + ":1006cd00F582E52F3523F583E0FFE52E2524F582", + ":1006dd00E52D3523F583EFF0E4FAF9F8E5242401", + ":1006ed00F524EA3523F523E93522F522E83521F5", + ":1006fd002180B3852D0A852E0B74002480FF740A", + ":10070d0034FFFEC3E5139FF513E5129EF512C3E5", + ":10071d000D9FF50DE50C9EF50CC3E50F9FF50FE5", + ":10072d000E9EF50EC3E5099FF509E5089EF508C3", + ":10073d00E5119FF511E5109EF510C3E5159FF515", + ":10074d00E5149EF514D2E843D82090E668E04409", + ":10075d00F090E65CE0443DF0D2AF90E680E054F7", + ":10076d00F0538EF8C2031207FF30010512039AC2", + ":10077d00013003F2120D6450EDC203120C0D2000", + ":10078d001690E682E030E704E020E1EF90E682E0", + ":10079d0030E604E020E0E4120BB6120D6680C722", + ":0b0d330090E50DE030E402C322D322", + ":10039a0090E6B9E0700302048514700302052E24", + ":1003aa00FE70030205C424FB700302047F147003", + ":1003ba0002047914700302046D14700302047324", + ":1003ca00056003020639120D68400302064590E6", + ":1003da00BBE024FE603B14605624FD6016146040", + ":1003ea0024067075E50A90E6B3F0E50B90E6B4F0", + ":1003fa00020645120D33500FE51290E6B3F0E513", + ":10040a0090E6B4F002064590E6A0E04401F00206", + ":10041a0045E50C90E6B3F0E50D90E6B4F0020645", + ":10042a00E50E90E6B3F0E50F90E6B4F002064590", + ":10043a00E6BAE0FF120BE2AA06A9077B01EA494B", + ":10044a00600DEE90E6B3F0EF90E6B4F002064590", + ":10045a00E6A0E04401F002064590E6A0E04401F0", + ":10046a00020645120CF1020645120D5002064512", + ":10047a000D48020645120CDF020645120D6A4003", + ":10048a0002064590E6B8E0247F602B14603C2402", + ":10049a006003020524A200E433FF25E0FFA202E4", + ":1004aa00334F90E740F0E4A3F090E68AF090E68B", + ":1004ba007402F0020645E490E740F0A3F090E68A", + ":1004ca00F090E68B7402F002064590E6BCE0547E", + ":1004da00FF7E00E0D3948040067C007D0180047C", + ":1004ea00007D00EC4EFEED4F243EF582740D3EF5", + ":1004fa0083E493FF3395E0FEEF24A1FFEE34E68F", + ":10050a0082F583E0540190E740F0E4A3F090E68A", + ":10051a00F090E68B7402F002064590E6A0E04401", + ":10052a00F0020645120D6C400302064590E6B8E0", + ":10053a0024FE601D2402600302064590E6BAE0B4", + ":10054a000105C20002064590E6A0E04401F00206", + ":10055a004590E6BAE0705990E6BCE0547EFF7E00", + ":10056a00E0D3948040067C007D0180047C007D00", + ":10057a00EC4EFEED4F243EF582740D3EF583E493", + ":10058a00FF3395E0FEEF24A1FFEE34E68F82F583", + ":10059a00E054FEF090E6BCE05480FF131313541F", + ":1005aa00FFE0540F2F90E683F0E04420F0020645", + ":1005ba0090E6A0E04401F0020645120D6E507C90", + ":1005ca00E6B8E024FE60202402705B90E6BAE0B4", + ":1005da000104D200806590E6BAE06402605D90E6", + ":1005ea00A0E04401F0805490E6BCE0547EFF7E00", + ":1005fa00E0D3948040067C007D0180047C007D00", + ":10060a00EC4EFEED4F243EF582740D3EF583E493", + ":10061a00FF3395E0FEEF24A1FFEE34E68F82F583", + ":10062a00E04401F0801590E6A0E04401F0800C12", + ":10063a000080500790E6A0E04401F090E6A0E044", + ":03064a0080F022", + ":03003300020D60", + ":040d600053D8EF32", + ":100c6c00D200E4F51A90E678E05410FFC4540F44", + ":090c7c0050F51713E433F51922", + ":0107ff0022", + ":060d6400D322D322D322", + ":080d480090E6BAE0F518D322", + ":100cdf0090E740E518F0E490E68AF090E68B04F0", + ":020cef00D322", + ":080d500090E6BAE0F516D322", + ":100cf10090E740E516F0E490E68AF090E68B04F0", + ":020d0100D322", + ":060d6a00D322D322D322", + ":1000800090E6B9E0245EB40B0040030203989000", + ":100090009C75F003A4C58325F0C5837302019202", + ":1000a000019202010D0200BD0200D70200F30201", + ":1000b0003C02018C02011602012902016290E740", + ":1000c000E519F0E490E68AF090E68B04F090E6A0", + ":1000d000E04480F002039890E60AE090E740F0E4", + ":1000e00090E68AF090E68B04F090E6A0E04480F0", + ":1000f00002039890E740740FF0E490E68AF090E6", + ":100100008B04F090E6A0E04480F002039890E6BA", + ":10011000E0F51702039890E67AE054FEF0E490E6", + ":100120008AF090E68BF002039890E67AE04401F0", + ":10013000E490E68AF090E68BF002039890E74074", + ":1001400007F0E490E68AF090E68B04F090E6A0E0", + ":100150004480F07FE87E031207ADD204120B8702", + ":10016000039890E6B5E054FEF090E6BFE090E68A", + ":10017000F090E6BEE090E68BF090E6BBE090E6B3", + ":10018000F090E6BAE090E6B4F002039875190143", + ":10019000170190E6BAE0753100F532A3E0FEE4EE", + ":1001a000423190E6BEE0753300F534A3E0FEE4EE", + ":1001b000423390E6B8E064C06003020282E53445", + ":1001c00033700302039890E6A0E020E1F9C3E534", + ":1001d0009440E533940050088533358534368006", + ":1001e00075350075364090E6B9E0B4A335E4F537", + ":1001f000F538C3E5389536E53795355060E53225", + ":1002000038F582E5313537F583E0FF74402538F5", + ":1002100082E434E7F583EFF00538E53870020537", + ":1002200080D0E4F537F538C3E5389536E5379535", + ":10023000501874402538F582E434E7F58374CDF0", + ":100240000538E5387002053780DDAD367AE77940", + ":100250007EE77F40AB07AF32AE311208B8E490E6", + ":100260008AF090E68BE536F02532F532E5353531", + ":10027000F531C3E5349536F534E5339535F53302", + ":1002800001BD90E6B8E064406003020398E51A70", + ":10029000051209678F1AE53445337003020398E4", + ":1002a00090E68AF090E68BF090E6A0E020E1F990", + ":1002b000E68BE0753500F53690E6B9E0B4A338E4", + ":1002c000F537F538C3E5389536E5379535400302", + ":1002d000037C74402538F582E434E7F583E0FFE5", + ":1002e000322538F582E5313537F583EFF00538E5", + ":1002f000387002053780CDE4F537F538C3E53895", + ":1003000036E53795355075851A39E51A64016044", + ":10031000E5322538FFE5313537FEE51A24FFFDE4", + ":1003200034FF5EFEEF5D4E6010E5322538FFE51A", + ":10033000145FFFC3E51A9FF539C3E5369538FFE5", + ":10034000359537FEC3EF9539EE94005007C3E536", + ":100350009538F539E5322538FFE5313537FE7440", + ":100360002538F582E434E7AD82FCAB39120A9CE5", + ":10037000392538F538E43537F5378080E5362532", + ":10038000F532E5353531F531C3E5349536F534E5", + ":0a039000339535F533020296C322", + ":100c3200C0E0C083C08290E6B5E04401F0D20153", + ":0f0c420091EF90E65D7401F0D082D083D0E032", + ":100c9d00C0E0C083C0825391EF90E65D7404F0D0", + ":100cad0082D083D0E032C0E0C083C0825391EF90", + ":0c0cbd00E65D7402F0D082D083D0E032", + ":100b1900C0E0C083C08290E680E030E70E85080C", + ":100b290085090D85100E85110F800C85100C8511", + ":100b39000D85080E85090F5391EF90E65D7410F0", + ":070b4900D082D083D0E032", + ":100c8500C0E0C083C082D2035391EF90E65D7408", + ":080c9500F0D082D083D0E032", + ":100b5000C0E0C083C08290E680E030E70E85080C", + ":100b600085090D85100E85110F800C85100C8511", + ":100b70000D85080E85090F5391EF90E65D7420F0", + ":070b8000D082D083D0E032", + ":0109ff0032", + ":100d700032323232323232323232323232323232", + ":100d800032323232323232323232323232323232", + ":030d9000323232", + ":100a00001201000200000040B404041000000102", + ":100a100000010A06000200000040010009022E00", + ":100a200001010080320904000004FF0000000705", + ":100a300002020002000705040200020007058602", + ":100a40000002000705880200020009022E000101", + ":100a50000080320904000004FF00000007050202", + ":100a600040000007050402400000070586024000", + ":100a700000070588024000000403090410034300", + ":100a80007900700072006500730073000E034500", + ":0c0a90005A002D005500530042000000", + ":100bb60090E682E030E004E020E60B90E682E030", + ":100bc600E119E030E71590E680E04401F07F147E", + ":0c0bd600001207AD90E680E054FEF022", + ":100b870030040990E680E0440AF0800790E680E0", + ":100b97004408F07FDC7E051207AD90E65D74FFF0", + ":0f0ba70090E65FF05391EF90E680E054F7F022", + ":1007ad008E3A8F3B90E600E054187012E53B2401", + ":1007bd00FFE4353AC313F53AEF13F53B801590E6", + ":1007cd0000E05418FFBF100BE53B25E0F53BE53A", + ":1007dd0033F53AE53B153BAE3A7002153A4E6005", + ":0607ed00120C2180EE22", + ":100be200A907AE14AF158F828E83A3E064037017", + ":100bf200AD0119ED7001228F828E83E07C002FFD", + ":100c0200EC3EFEAF0580DFE4FEFF2290E682E044", + ":100c1200C0F090E681F043870100000000002274", + ":100c220000F58690FDA57C05A3E582458370F922", + ":03004300020800", + ":03005300020800", + ":10080000020C3200020CB300020C9D00020C8500", + ":10081000020B1900020B50000209FF00020D7000", + ":10082000020D7100020D7200020D7300020D7400", + ":10083000020D7500020D7600020D7700020D7800", + ":10084000020D7900020D7000020D7A00020D7B00", + ":10085000020D7C00020D7D00020D7E00020D7F00", + ":10086000020D8000020D7000020D7000020D7000", + ":10087000020D8100020D8200020D8300020D8400", + ":10088000020D8500020D8600020D8700020D8800", + ":10089000020D8900020D8A00020D8B00020D8C00", + ":1008a000020D8D00020D8E00020D8F00020D9000", + ":0808b000020D9100020D9200", + ":100a9c008E3C8F3D8C3E8D3F8B40C28743B28012", + ":100aac000D58120D24120CC95004D2048059E519", + ":100abc00600FE53C90E679F0120CC95004D20480", + ":100acc0046E53D90E679F0120CC95004D2048037", + ":100adc00E4F541E541C395405021053FE53FAE3E", + ":100aec007002053E14F5828E83E090E679F0120D", + ":100afc00145004D2048010054180D890E678E044", + ":0d0b0c0040F0120C51C20453B27FA20422", + ":0f0d240090E6787480F0E51725E090E679F022", + ":100c5100120D58120D24120D1490E678E04440F0", + ":0b0c6100120D5890E678E030E1E922", + ":080d580090E678E020E6F922", + ":1008b8008E3C8F3D8D3E8A3F8B40120D58120D24", + ":1008c800120CC9500122E519600CE53C90E679F0", + ":1008d800120CC9500122E53D90E679F0120CC950", + ":1008e800012290E6787480F0E51725E0440190E6", + ":1008f80079F0120D1450012290E679E0F541120D", + ":1009080014500122E4F541E53E14FFE541C39F50", + ":100918001C90E679E0FFE5402541F582E4353FF5", + ":1009280083EFF0120D14500122054180DA90E678", + ":100938007420F0120D1450012290E679E0FFE540", + ":100948002541F582E4353FF583EFF0120D145001", + ":0f0958002290E6787440F090E679E0F541C322", + ":100d140090E678E0FF30E0F8EF30E202D322C322", + ":100cc90090E678E0FF30E0F8EF30E202D322EF20", + ":060cd900E102D322C322", + ":10096700E51970037F01227A107B407D40E4FFFE", + ":100977001208B8E4F53A7400253AF582E43410F5", + ":1009870083E53AF0053AE53AB440EB7C107D007B", + ":1009970040E4FFFE120A9CE4F53AE53AF4FF7400", + ":1009a700253AF582E43410F583EFF0053AE53AB4", + ":1009b70040E87A107B007D40E4FFFE1208B89010", + ":1009c70000E0F53AE53A30E005753B018008633A", + ":1009d7003F053A853A3BE4F53AE53AC394405015", + ":1009e700AF3A7E007C107D40AB3B120A9CE53B25", + ":0809f7003AF53A80E4AF3B22", + ":030000000207F3", + ":0c07f300787FE4F6D8FD75814102064D", + ":100d0300EB9FF5F0EA9E42F0E99D42F0E89C45F0", + ":010d130022", + ":00000001FF" +}; +#define FX2_VENDAX_SIZE (sizeof (fx2_vendax) / (256 * sizeof(char))) +*/ + +#endif
\ No newline at end of file diff --git a/include/qhy/qhyccdlog.h b/include/qhy/qhyccdlog.h new file mode 100644 index 0000000..0ab8470 --- /dev/null +++ b/include/qhy/qhyccdlog.h @@ -0,0 +1,3713 @@ +#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0x0,0x0,0x0,0x0,0x0,\
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,\
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,\
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,\
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,\
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,\
+0x0};
+
+#endif
\ No newline at end of file diff --git a/include/qhy/qhyccdstruct.h b/include/qhy/qhyccdstruct.h new file mode 100644 index 0000000..c226926 --- /dev/null +++ b/include/qhy/qhyccdstruct.h @@ -0,0 +1,222 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhyccdstruct.h
+ * @brief QHYCCD SDK struct define
+ */
+
+#ifndef WIN32
+ #define LINUX
+#else
+ #define QHYCCD_OPENCV_SUPPORT
+#endif
+
+#ifdef WIN32
+ #include <windows.h>
+#else // Linux & Mac
+ #include <pthread.h>
+#endif
+
+#ifndef __QHYCCDSTRUCTDEF_H__
+#define __QHYCCDSTRUCTDEF_H__
+
+#ifdef WIN32
+
+#ifndef EXPORTFUNC
+#define EXPORTFUNC extern "C" __declspec(dllexport)
+#endif
+
+#ifndef STDCALL
+#define STDCALL __stdcall
+#endif
+
+#ifndef EXPORTC
+#define EXPORTC extern "C"
+#endif
+
+#else
+
+#define EXPORTFUNC extern "C"
+#define STDCALL
+#define EXPORTC extern "C"
+
+#endif
+
+#include "stdint.h"
+
+/**
+ * usb vendor request command
+ */
+#define QHYCCD_REQUEST_READ (0xC0)
+
+/**
+ * usb vendor request command
+ */
+#define QHYCCD_REQUEST_WRITE (0x40)
+
+#define MACHANICALSHUTTER_OPEN 0
+#define MACHANICALSHUTTER_CLOSE 1
+#define MACHANICALSHUTTER_FREE 2
+
+/**
+ * @brief CCDREG struct define
+ *
+ * List the ccd registers param
+ */
+typedef struct ccdreg
+{
+ uint8_t Gain; //!< ccd gain
+ uint8_t Offset; //!< ccd offset
+ uint32_t Exptime; //!< expose time
+ uint8_t HBIN; //!< width bin
+ uint8_t VBIN; //!< height bin
+ uint16_t LineSize; //!< almost match image width
+ uint16_t VerticalSize; //!< almost match image height
+ uint16_t SKIP_TOP; //!< Reserved
+ uint16_t SKIP_BOTTOM; //!< Reserved
+ uint16_t LiveVideo_BeginLine;//!< Reserved
+ uint16_t AnitInterlace; //!< Reserved
+ uint8_t MultiFieldBIN; //!< Reserved
+ uint8_t AMPVOLTAGE; //!< Reserved
+ uint8_t DownloadSpeed; //!< transfer speed
+ uint8_t TgateMode; //!< Reserved
+ uint8_t ShortExposure; //!< Reserved
+ uint8_t VSUB; //!< Reserved
+ uint8_t CLAMP; //!< Reserved
+ uint8_t TransferBIT; //!< Reserved
+ uint8_t TopSkipNull; //!< Reserved
+ uint16_t TopSkipPix; //!< Reserved
+ uint8_t MechanicalShutterMode;//!< Reserved
+ uint8_t DownloadCloseTEC; //!< Reserved
+ uint8_t SDRAM_MAXSIZE; //!< Reserved
+ uint16_t ClockADJ; //!< Reserved
+ uint8_t Trig; //!< Reserved
+ uint8_t MotorHeating; //!< Reserved
+ uint8_t WindowHeater; //!< Reserved
+ uint8_t ADCSEL; //!< Reserved
+}CCDREG;
+
+struct BIOREG
+{
+ uint16_t LineSize;
+ uint16_t PatchNumber;
+ uint8_t AMPVOLTAGE;
+ uint8_t ShortExposure;
+ uint8_t SDRAM_MAXSIZE;
+ uint8_t DownloadSpeed;
+ uint8_t TransferBIT;
+ uint8_t BIOCCD_Mode;
+ uint8_t BIOCCD_Video;
+ uint8_t SDRAM_Bypass;
+};
+
+/**
+ * @brief CONTROL_ID enum define
+ *
+ * List of the function could be control
+ */
+enum CONTROL_ID
+{
+ CONTROL_BRIGHTNESS = 0, //!< image brightness
+ CONTROL_CONTRAST, //1 image contrast
+ CONTROL_WBR, //2 red of white balance
+ CONTROL_WBB, //3 blue of white balance
+ CONTROL_WBG, //4 the green of white balance
+ CONTROL_GAMMA, //5 screen gamma
+ CONTROL_GAIN, //6 camera gain
+ CONTROL_OFFSET, //7 camera offset
+ CONTROL_EXPOSURE, //8 expose time (us)
+ CONTROL_SPEED, //9 transfer speed
+ CONTROL_TRANSFERBIT, //10 image depth bits
+ CONTROL_CHANNELS, //11 image channels
+ CONTROL_USBTRAFFIC, //12 hblank
+ CONTROL_ROWNOISERE, //13 row denoise
+ CONTROL_CURTEMP, //14 current cmos or ccd temprature
+ CONTROL_CURPWM, //15 current cool pwm
+ CONTROL_MANULPWM, //16 set the cool pwm
+ CONTROL_CFWPORT, //17 control camera color filter wheel port
+ CONTROL_COOLER, //18 check if camera has cooler
+ CONTROL_ST4PORT, //19 check if camera has st4port
+ CAM_COLOR, //20
+ CAM_BIN1X1MODE, //21 check if camera has bin1x1 mode
+ CAM_BIN2X2MODE, //22 check if camera has bin2x2 mode
+ CAM_BIN3X3MODE, //23 check if camera has bin3x3 mode
+ CAM_BIN4X4MODE, //24 check if camera has bin4x4 mode
+ CAM_MECHANICALSHUTTER, //25 mechanical shutter
+ CAM_TRIGER_INTERFACE, //26 triger
+ CAM_TECOVERPROTECT_INTERFACE, //27 tec overprotect
+ CAM_SINGNALCLAMP_INTERFACE, //28 singnal clamp
+ CAM_FINETONE_INTERFACE, //29 fine tone
+ CAM_SHUTTERMOTORHEATING_INTERFACE, //30 shutter motor heating
+ CAM_CALIBRATEFPN_INTERFACE, //31 calibrated frame
+ CAM_CHIPTEMPERATURESENSOR_INTERFACE, //32 chip temperaure sensor
+ CAM_USBREADOUTSLOWEST_INTERFACE, //33 usb readout slowest
+
+ CAM_8BITS, //34 8bit depth
+ CAM_16BITS, //35 16bit depth
+ CAM_GPS, //36 check if camera has gps
+
+ CAM_IGNOREOVERSCAN_INTERFACE, //37 ignore overscan area
+
+ QHYCCD_3A_AUTOBALANCE, //38
+ QHYCCD_3A_AUTOEXPOSURE, //39
+ QHYCCD_3A_AUTOFOCUS, //40
+ CONTROL_AMPV, //41 ccd or cmos ampv
+ CONTROL_VCAM, //42 Virtual Camera on off
+ CAM_VIEW_MODE, //43
+
+ CONTROL_CFWSLOTSNUM, //44 check CFW slots number
+ IS_EXPOSING_DONE, //45
+ ScreenStretchB, //46
+ ScreenStretchW, //47
+ CONTROL_DDR, //47
+ CAM_LIGHT_PERFORMANCE_MODE, //49
+
+ CAM_QHY5II_GUIDE_MODE, //50
+ DDR_BUFFER_CAPACITY, //51
+ DDR_BUFFER_READ_THRESHOLD, //52
+
+ DefaultOffset, //53
+ OutputDataActualBits, //54
+ OutputDataAlignment //55
+};
+
+/**
+ * debayer mode for mono to color */
+enum BAYER_ID
+{
+ BAYER_GB = 1,
+ BAYER_GR,
+ BAYER_BG,
+ BAYER_RG
+};
+
+enum CodecID
+{
+ NONE_CODEC,
+ H261_CODEC
+};
+
+#endif
diff --git a/include/qhy/qhydevice.h b/include/qhy/qhydevice.h new file mode 100644 index 0000000..2e25049 --- /dev/null +++ b/include/qhy/qhydevice.h @@ -0,0 +1,92 @@ +#ifndef _QHYDEVICE_H_ +#define _QHYDEVICE_H_ + +// written by Jan Soldan, 2018 + +#ifdef __APPLE__ + #include <libusb.h> + #include <mutex> // std::mutex +#elif __linux__ + #include <libusb-1.0/libusb.h> + #include <libusb.h> + #include <mutex> // std::mutex +#endif + +#include "qhyccd.h" +#include "qhybase.h" + +#define MAX_ID_PAIRS (100) +#define MAX_DEVICE_TYPES (100) +// we can open up to MAX_OPEN_DEVICES QHYCCD cameras +#define MAX_OPEN_DEVICES (8) +#define ID_STR_LEN (0x20) + +#define TRANSFER_COUNT (32) +#define TRANSFER_SIZE (76800) + +#define DATA_CACHE_WIDTH (7400) +#define DATA_CACHE_HEIGHT (5000) +#define DATA_CACHE_CHANNELS (4) + +class UnlockImageQueue; +/* + **************************************************************************************** + * class QhyDevice + **************************************************************************************** + */ +class QhyDevice { + public: + libusb_device *dev; +#ifdef WIN32 + void *handle; +#else + libusb_device_handle *handle; +#endif + uint16_t vid; + uint16_t pid; + uint8_t is_open; + char id[64]; + QHYBASE *qcam; + + // added stuff for libusb async functions + struct libusb_transfer *libusb_transfer_array[TRANSFER_COUNT]; + + UnlockImageQueue *p_image_queue; + uint32_t image_queue_len; + + int event_count; + bool thread_exit_flag; + bool first_exposure_flag; + + std::mutex event_count_mutex; + std::mutex thread_exit_flag_mutex; + std::mutex first_exposure_flag_mutex; + + pthread_t thread_id; + + uint8_t sig[16]; + uint8_t sigcrc[16]; + + uint8_t *p_raw_data_cache; + uint8_t *p_img_buffer; + + uint32_t header_len; + uint32_t frame_len; + uint32_t ending_len; + + uint32_t sig_len; + uint32_t header_type; + uint32_t raw_frame_width; + uint32_t raw_frame_height; + uint32_t raw_frame_bpp; + int32_t received_raw_data_len; + + public: + QhyDevice(); + QhyDevice(int idx); + virtual ~QhyDevice(); + void dump(int idx); + void clear(); +}; + +#endif diff --git a/include/qhy/qhyicbase.h b/include/qhy/qhyicbase.h new file mode 100644 index 0000000..11f4fd0 --- /dev/null +++ b/include/qhy/qhyicbase.h @@ -0,0 +1,461 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file qhyicbase.h
+ * @brief QHYICBASE class define
+ */
+
+#ifndef QHYICBASE_CLASS
+#define QHYICBASE_CLASS
+
+#include "qhybase.h"
+
+/**
+ * @brief QHYICBASE class define
+ *
+ * include all functions for QHYICBASE
+ */
+class QHYICBASE:public QHYBASE
+{
+public:
+ QHYICBASE();
+ ~QHYICBASE();
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t SetChipOffset(qhyccd_handle *h,double offset)
+ @brief set the camera offset
+ @param h camera control handle
+ @param offset offset value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipOffset(qhyccd_handle *h,double offset);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /**
+ @fn void ConvertDataBIN11(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN11(uint8_t * Data, uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN22(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN22(uint8_t * Data, uint32_t x, uint32_t y, uint16_t PixShift);
+
+ /**
+ @fn void ConvertDataBIN44(uint8_t * Data,uint32_t x, uint32_t y, uint16_t PixShift)
+ @brief move the pixel raw data to correction position,and bin if need
+ @param Data raw image data
+ @param x image width
+ @param y image height
+ @param PixShift this is a way to fix the bad pixel data by the usb transfer
+ */
+ void ConvertDataBIN44(uint8_t * Data, uint32_t x, uint32_t y, uint16_t PixShift);
+#if 0
+ /**
+ @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+#endif
+
+ /** @fn virtual uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt)
+ @brief Set InterCam serial2 params
+ @param h camera control handle
+ @param opt the param
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetInterCamSerialParam(qhyccd_handle *h,uint32_t opt);
+
+ /** @fn virtual uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length)
+ @brief Send data to InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @param length the length to send
+ @return
+ on success,return QHYCCD_SUCCESS \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamSerialTX(qhyccd_handle *h,char *buf,uint32_t length);
+
+ /** @fn virtual uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf)
+ @brief Get data from InterCam serial2
+ @param h camera control handle
+ @param buf buffer for data
+ @return
+ on success,return the data number \n
+
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamSerialRX(qhyccd_handle *h,char *buf);
+
+ /** @fn virtual uint32_t Send2OledFast(qhyccd_handle *h,char *buffer)
+ @brief send data to show on InterCam's OLED
+ @param h camera control handle
+ @param buffer buffer for data
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2OledFast(qhyccd_handle *h,uint8_t *buffer);
+
+ /** @fn uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff)
+ @brief turn off or turn on the InterCam's Oled
+ @param handle camera control handle
+ @param onoff on or off the oled \n
+ 1:on \n
+ 0:off \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InterCamOledOnOff(qhyccd_handle *handle,uint8_t onoff);
+
+ /** @fn uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness)
+ @brief send data to show on InterCam's OLED
+ @param handle camera control handle
+ @param brightness the oled's brightness
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetInterCamOledBrightness(qhyccd_handle *handle,uint8_t brightness);
+
+ /** @fn uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom)
+ @brief spilit the message to two line,send to camera
+ @param handle camera control handle
+ @param messageTop message for the oled's 1st line
+ @param messageBottom message for the oled's 2nd line
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendTwoLine2InterCamOled(qhyccd_handle *handle,char *messageTop,char *messageBottom);
+
+ /**
+ @fn uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop)
+ @brief spilit the message to two line,send to camera
+ @param handle camera control handle
+ @param messageTop message for all the oled
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOneLine2InterCamOled(qhyccd_handle *handle,char *messageTop);
+
+ /**
+ @fn uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf)
+ @brief Get camera status
+ @param h camera control handle
+ @param buf camera's status save space
+ @return
+ on success,return the camera statu \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCameraStatus(qhyccd_handle *h,uint8_t *buf);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief control color filter wheel
+ @param handle camera control handle
+ @param order order send to color filter wheel
+ @param length the order string length
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t GetCFWStatus(qhyccd_handle *handle,char *status)
+ @brief get the color filter wheel status
+ @param handle camera control handle
+ @param status the color filter wheel position status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetCFWStatus(qhyccd_handle *handle,char *status);
+
+ /**
+ @fn uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status)
+ @brief control camera's shutter
+ @param handle camera control handle
+ @param status the shutter status
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ControlShutter(qhyccd_handle *handle,uint8_t status);
+
+ /**
+ @fn uint32_t GetShutterStatus(qhyccd_handle *handle)
+ @brief get the camera's shutter status
+ @param handle camera control handle
+ @return
+ on success,return status \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetShutterStatus(qhyccd_handle *handle);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+
+ uint32_t widthmax;
+ uint32_t heightmax;
+
+ uint32_t curOverScanX;
+ uint32_t curOverScanY;
+ uint32_t curOverScanSizeX;
+ uint32_t curOverScanSizeY;
+
+ uint32_t isReadoutTemp;
+
+};
+#endif
+
diff --git a/include/qhy/qwinusb.h b/include/qhy/qwinusb.h new file mode 100644 index 0000000..5c76df2 --- /dev/null +++ b/include/qhy/qwinusb.h @@ -0,0 +1,18 @@ +#ifndef QHYCCD_WINUSB_H
+#define QHYCCD_WINUSB_H
+
+#define WINUSB_ALREADY_SUPPORT_NUM 10
+
+extern char *winusbcamname[WINUSB_ALREADY_SUPPORT_NUM];
+
+#ifdef WIN32
+
+GUID * STDCALL name2GUID(PCHAR name);
+uint32_t STDCALL QWinusbOpenDriver(HANDLE * phInDeviceHandle,GUID *cameraguid);
+uint32_t STDCALL QWinusbGetCamType(char *camnamestr);
+uint32_t STDCALL QWinusbCloseDriver(HANDLE handle);
+
+#endif
+
+
+#endif
\ No newline at end of file diff --git a/include/qhy/solar1600.h b/include/qhy/solar1600.h new file mode 100644 index 0000000..b49b4b8 --- /dev/null +++ b/include/qhy/solar1600.h @@ -0,0 +1,348 @@ +/* + QHYCCD SDK + + Copyright (c) 2014 QHYCCD. + All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + The full GNU General Public License is included in this distribution in the + file called LICENSE. + */ + +/*! + * @file solar1600.h + * @brief SOLAR1600 class define + */ + +#include "qhybase.h" + +#ifdef WIN32 +#include "d5100.h" +#endif + +#ifndef __SOLAR1600DEF_H__ +#define __SOLAR1600DEF_H__ + +/** + * @brief SOLAR1600 class define + * + * include all functions for SOLAR1600 + */ +class SOLAR1600:public QHYBASE +{ +public: + SOLAR1600(); + ~SOLAR1600(); + /** + @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h) + @brief connect to the connected camera + @param d camera deivce + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h); + + /** + @fn uint32_t DisConnectCamera(qhyccd_handle *h) + @brief disconnect to the connected camera + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t DisConnectCamera(qhyccd_handle *h); + + /** + @fn uint32_t InitChipRegs(qhyccd_handle *h) + @brief Init the registers and some other things + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitChipRegs(qhyccd_handle *h); + + /** + @fn uint32_t IsChipHasFunction(CONTROL_ID id) + @brief check the camera has the function or not + @param id function id + @return + HAVE return QHYCCD_HAVE \n + NOT HAVE return QHYCCD_NOTHAVE + */ + uint32_t IsChipHasFunction(CONTROL_ID id); + + + /** + @fn uint32_t ReSetParams2cam(qhyccd_handle *h) + @brief re set the params to camera,because some behavior will cause camera reset + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t ReSetParams2cam(qhyccd_handle *h); + + /** + @fn uint32_t SetChipGain(qhyccd_handle *h,double gain) + @brief set the gain to camera + @param h camera control handle + @param gain gain value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipGain(qhyccd_handle *h,double gain); + + /** + @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i) + @brief set the expose time to camera + @param h camera control handle + @param i expose time value + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipExposeTime(qhyccd_handle *h,double i); + + /** + @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i) + @brief set the transfer speed to camera + @param h camera control handle + @param i speed level + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i); + + /** + + */ + uint32_t SetChipDepth(qhyccd_handle *h,uint32_t depth); + + /** + @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin) + @brief set the camera offset + @param h camera control handle + @param wbin width bin + @param hbin height bin + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin); + + + /** + @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step) + @brief get the min,max and step value for function + @param controlId the control id + @param min the min value for function + @param max the max value for function + @param step single step value for function + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step); + + /** + @fn uint32_t GetChipMemoryLength() + @brief get the min cost memory for the image + @return + success return the total memory space(unit:byte) \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetChipMemoryLength(); + + /** + @fn double GetChipExposeTime() + @brief get the current exposetime + @return + success return the current expose time (unit:us) \n + another QHYCCD_ERROR code on other failures + */ + double GetChipExposeTime(); + + /** + @fn double GetChipGain() + @brief get the current gain + @return + success return the current expose gain\n + another QHYCCD_ERROR code on other failures + */ + double GetChipGain(); + + /** + @fn double GetChipSpeed() + @brief get the current transfer speed + @return + success return the current speed level \n + another QHYCCD_ERROR code on other failures + */ + double GetChipSpeed(); + + + /** + @fn double GetChipBitsMode() + @brief get the current camera depth bits + @return + success return the current camera depth bits \n + another QHYCCD_ERROR code on other failures + */ + double GetChipBitsMode(); + + + /** + @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h) + @brief correct width and height if the setting width or height is not correct + @param w set width + @param h set height + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t CorrectWH(uint32_t *w,uint32_t *h); + + /** + @fn double InitBIN11Mode() + @brief init the bin11 mode setting + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN11Mode(); + + /** + @fn double InitBIN22Mode() + @brief init the bin22 mode setting + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN22Mode(); + + /** + @fn double InitBIN44Mode() + @brief init the bin44 mode setting + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t InitBIN44Mode(); + + /** + @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize) + @brief set camera ouput resolution + @param handle camera control handle + @param x the top left position x + @param y the top left position y + @param xsize the image width + @param ysize the image height + @return + on success,return QHYCCD_SUCCESS\n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize); + + /** + @fn uint32_t BeginSingleExposure(qhyccd_handle *h) + @brief begin single exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t BeginSingleExposure(qhyccd_handle *h); + + /** + @fn uint32_t StopSingleExposure(qhyccd_handle *h) + @brief stop single exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t StopSingleExposure(qhyccd_handle *h); + + /** + @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData) + @brief get single frame image data + @param h camera control handle + @param pW real width + @param pH real height + @param pBpp real depth bits + @param pChannels real channels + @param ImgData image data buffer + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData); + + /** + @fn uint32_t BeginLiveExposure(qhyccd_handle *h) + @brief begin live exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t BeginLiveExposure(qhyccd_handle *h); + + /** + @fn uint32_t StopLiveExposure(qhyccd_handle *h) + @brief stop live exposure + @param h camera control handle + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t StopLiveExposure(qhyccd_handle *h); + + /** + @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData) + @brief get live frame image data + @param h camera control handle + @param pW real width + @param pH real height + @param pBpp real depth bits + @param pChannels real channels + @param ImgData image data buffer + @return + success return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData); + + + /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY) + @brief Set the camera on focus mode + @param h camera control handle + @param focusCenterX + @param focusCenterY + @return + on success,return QHYCCD_SUCCESS \n + another QHYCCD_ERROR code on other failures + */ + uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY); + +}; +#endif + diff --git a/include/qhy/solar800g.h b/include/qhy/solar800g.h new file mode 100644 index 0000000..4861473 --- /dev/null +++ b/include/qhy/solar800g.h @@ -0,0 +1,403 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*!
+ * @file solar800g.h
+ * @brief SOLAR800G class define
+ */
+
+#include "qhybase.h"
+
+#ifdef WIN32
+//#include "QGigE.h"
+#endif
+
+#ifndef __SOLAR800GDEF_H__
+#define __SOLAR800GDEF_H__
+
+/**
+ * @brief SOLAR800G class define
+ *
+ * include all functions for SOLAR800G
+ */
+class SOLAR800G:public QHYBASE
+{
+public:
+ SOLAR800G();
+ ~SOLAR800G();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+
+ */
+ uint32_t SetChipDepth(qhyccd_handle *h,uint32_t depth);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera offset
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos)
+ @brief send the command to camera's color filter wheel port
+ @param h camera control handle
+ @param pos the color filter position
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2CFWPort(qhyccd_handle *h,uint32_t pos);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t GetChipMemoryLength()
+ @brief get the min cost memory for the image
+ @return
+ success return the total memory space(unit:byte) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn double GetChipExposeTime()
+ @brief get the current exposetime
+ @return
+ success return the current expose time (unit:us) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipExposeTime();
+
+ /**
+ @fn double GetChipGain()
+ @brief get the current gain
+ @return
+ success return the current expose gain\n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipGain();
+
+ /**
+ @fn double GetChipSpeed()
+ @brief get the current transfer speed
+ @return
+ success return the current speed level \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipSpeed();
+
+
+ /**
+ @fn double GetChipBitsMode()
+ @brief get the current camera depth bits
+ @return
+ success return the current camera depth bits \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipBitsMode();
+
+ /**
+ @fn double GetChipCoolTemp(qhyccd_handle *h)
+ @brief get the current ccd/cmos temprature
+ @param h camera control handle
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolTemp(qhyccd_handle *h);
+
+ /**
+ @fn double GetChipCoolPWM()
+ @brief get the current ccd/cmos temprature
+ @return
+ success return the current cool temprature \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipCoolPWM();
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn double InitBIN11Mode()
+ @brief init the bin11 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN11Mode();
+
+ /**
+ @fn double InitBIN22Mode()
+ @brief init the bin22 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN22Mode();
+
+ /**
+ @fn double InitBIN44Mode()
+ @brief init the bin44 mode setting
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitBIN44Mode();
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length)
+ @brief send the command to camera's color filter wheel port
+ @param handle camera control handle
+ @param order the color filter position
+ @param length the order string length
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SendOrder2CFW(qhyccd_handle *handle,char *order,uint32_t length);
+
+ /**
+ @fn uint32_t AutoTempControl(qhyccd_handle *h,double ttemp)
+ @brief auto temprature control
+ @param h camera control handle
+ @param ttemp target temprature(degree Celsius)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t AutoTempControl(qhyccd_handle *h,double ttemp);
+
+ /**
+ @fn uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM)
+ @brief set cool power
+ @param h camera control handle
+ @param PWM power(0-255)
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipCoolPWM(qhyccd_handle *h,double PWM);
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+ uint32_t SetTrigerFunction(qhyccd_handle *handle,bool value);
+
+};
+#endif
+
diff --git a/include/qhy/ssd1306.h b/include/qhy/ssd1306.h new file mode 100644 index 0000000..3535f21 --- /dev/null +++ b/include/qhy/ssd1306.h @@ -0,0 +1,62 @@ +/*___________________________________________________ + | _____ _____ _ _ _ | + | | __ \ | __ (_) | | | | + | | |__) |__ _ __ __ _ _ _| |__) || | ___ | |_ | + | | ___/ _ \ '_ \ / _` | | | | ___/ | |/ _ \| __| | + | | | | __/ | | | (_| | |_| | | | | | (_) | |_ | + | |_| \___|_| |_|\__, |\__,_|_| |_|_|\___/ \__| | + | __/ | | + | GNU/Linux based |___/ Multi-Rotor UAV Autopilot | + |___________________________________________________| + + Adafruit 128x64 SSD1307 Linux I2C Driver Interface + + Copyright (C) 2013 Tobias Simon, Ilmenau University of Technology + Based on code written by Limor Fried/Ladyada. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. */ + + +#ifndef __SSD1306_H__ +#define __SSD1306_H__ + +#include "i2c.h" +#include <stdint.h> + + +typedef struct +{ + i2c_dev_t *i2c_dev; + uint8_t *buf; + int16_t width; + int16_t height; +} +ssd1306_t; + + +/* initializes display */ +void ssd1306_init(ssd1306_t *ssd, i2c_dev_t *i2c_dev); + +/* inverts display */ +void ssd1306_invert(ssd1306_t *ssd, uint8_t inv); + +/* writes buffer contents to display */ +void ssd1306_update(ssd1306_t *ssd); + +/* clears buffer */ +void ssd1306_clear(ssd1306_t *ssd); + +/* sets pixel in buffer */ +void ssd1306_set_pixel(ssd1306_t *ssd, int16_t x, int16_t y, uint16_t color); + + +#endif /* __SSD1306_H__ */ + diff --git a/include/qhy/stdint.h b/include/qhy/stdint.h new file mode 100644 index 0000000..8c6e626 --- /dev/null +++ b/include/qhy/stdint.h @@ -0,0 +1,527 @@ +#include "qhyccdstruct.h"
+
+#ifdef LINUX
+
+/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C99: 7.18 Integer types <stdint.h>
+ */
+
+#ifndef _STDINT_H
+#define _STDINT_H 1
+
+#ifdef __APPLE__
+
+#include "stdint.h.mac"
+
+#else
+
+#include <features.h>
+#include <bits/wchar.h>
+#include <bits/wordsize.h>
+
+/* Exact integral types. */
+
+/* Signed. */
+
+/* There is some amount of overlap with <sys/types.h> as known by inet code */
+#ifndef __int8_t_defined
+# define __int8_t_defined
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+# if __WORDSIZE == 64
+typedef long int int64_t;
+# else
+__extension__
+typedef long long int int64_t;
+# endif
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+#ifndef __uint32_t_defined
+typedef unsigned int uint32_t;
+# define __uint32_t_defined
+#endif
+#if __WORDSIZE == 64
+typedef unsigned long int uint64_t;
+#else
+__extension__
+typedef unsigned long long int uint64_t;
+#endif
+
+
+/* Small types. */
+
+/* Signed. */
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+#if __WORDSIZE == 64
+typedef long int int_least64_t;
+#else
+__extension__
+typedef long long int int_least64_t;
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint_least64_t;
+#else
+__extension__
+typedef unsigned long long int uint_least64_t;
+#endif
+
+
+/* Fast types. */
+
+/* Signed. */
+typedef signed char int_fast8_t;
+#if __WORDSIZE == 64
+typedef long int int_fast16_t;
+typedef long int int_fast32_t;
+typedef long int int_fast64_t;
+#else
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+__extension__
+typedef long long int int_fast64_t;
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint_fast8_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint_fast16_t;
+typedef unsigned long int uint_fast32_t;
+typedef unsigned long int uint_fast64_t;
+#else
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+__extension__
+typedef unsigned long long int uint_fast64_t;
+#endif
+
+
+/* Types for `void *' pointers. */
+#if __WORDSIZE == 64
+# ifndef __intptr_t_defined
+typedef long int intptr_t;
+# define __intptr_t_defined
+# endif
+typedef unsigned long int uintptr_t;
+#else
+# ifndef __intptr_t_defined
+typedef int intptr_t;
+# define __intptr_t_defined
+# endif
+typedef unsigned int uintptr_t;
+#endif
+
+
+/* Largest integral types. */
+#if __WORDSIZE == 64
+typedef long int intmax_t;
+typedef unsigned long int uintmax_t;
+#else
+__extension__
+typedef long long int intmax_t;
+__extension__
+typedef unsigned long long int uintmax_t;
+#endif
+
+
+# if __WORDSIZE == 64
+# define __INT64_C(c) c ## L
+# define __UINT64_C(c) c ## UL
+# else
+# define __INT64_C(c) c ## LL
+# define __UINT64_C(c) c ## ULL
+# endif
+
+/* Limits of integral types. */
+
+/* Minimum of signed integral types. */
+# define INT8_MIN (-128)
+# define INT16_MIN (-32767-1)
+# define INT32_MIN (-2147483647-1)
+# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types. */
+# define INT8_MAX (127)
+# define INT16_MAX (32767)
+# define INT32_MAX (2147483647)
+# define INT64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types. */
+# define UINT8_MAX (255)
+# define UINT16_MAX (65535)
+# define UINT32_MAX (4294967295U)
+# define UINT64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Minimum of signed integral types having a minimum size. */
+# define INT_LEAST8_MIN (-128)
+# define INT_LEAST16_MIN (-32767-1)
+# define INT_LEAST32_MIN (-2147483647-1)
+# define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types having a minimum size. */
+# define INT_LEAST8_MAX (127)
+# define INT_LEAST16_MAX (32767)
+# define INT_LEAST32_MAX (2147483647)
+# define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types having a minimum size. */
+# define UINT_LEAST8_MAX (255)
+# define UINT_LEAST16_MAX (65535)
+# define UINT_LEAST32_MAX (4294967295U)
+# define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Minimum of fast signed integral types having a minimum size. */
+# define INT_FAST8_MIN (-128)
+# if __WORDSIZE == 64
+# define INT_FAST16_MIN (-9223372036854775807L-1)
+# define INT_FAST32_MIN (-9223372036854775807L-1)
+# else
+# define INT_FAST16_MIN (-2147483647-1)
+# define INT_FAST32_MIN (-2147483647-1)
+# endif
+# define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of fast signed integral types having a minimum size. */
+# define INT_FAST8_MAX (127)
+# if __WORDSIZE == 64
+# define INT_FAST16_MAX (9223372036854775807L)
+# define INT_FAST32_MAX (9223372036854775807L)
+# else
+# define INT_FAST16_MAX (2147483647)
+# define INT_FAST32_MAX (2147483647)
+# endif
+# define INT_FAST64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of fast unsigned integral types having a minimum size. */
+# define UINT_FAST8_MAX (255)
+# if __WORDSIZE == 64
+# define UINT_FAST16_MAX (18446744073709551615UL)
+# define UINT_FAST32_MAX (18446744073709551615UL)
+# else
+# define UINT_FAST16_MAX (4294967295U)
+# define UINT_FAST32_MAX (4294967295U)
+# endif
+# define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Values to test for integral types holding `void *' pointer. */
+# if __WORDSIZE == 64
+# define INTPTR_MIN (-9223372036854775807L-1)
+# define INTPTR_MAX (9223372036854775807L)
+# define UINTPTR_MAX (18446744073709551615UL)
+# else
+# define INTPTR_MIN (-2147483647-1)
+# define INTPTR_MAX (2147483647)
+# define UINTPTR_MAX (4294967295U)
+# endif
+
+
+/* Minimum for largest signed integral type. */
+# define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum for largest signed integral type. */
+# define INTMAX_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum for largest unsigned integral type. */
+# define UINTMAX_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Limits of other integer types. */
+
+/* Limits of `ptrdiff_t' type. */
+# if __WORDSIZE == 64
+# define PTRDIFF_MIN (-9223372036854775807L-1)
+# define PTRDIFF_MAX (9223372036854775807L)
+# else
+# define PTRDIFF_MIN (-2147483647-1)
+# define PTRDIFF_MAX (2147483647)
+# endif
+
+/* Limits of `sig_atomic_t'. */
+# define SIG_ATOMIC_MIN (-2147483647-1)
+# define SIG_ATOMIC_MAX (2147483647)
+
+/* Limit of `size_t' type. */
+# if __WORDSIZE == 64
+# define SIZE_MAX (18446744073709551615UL)
+# else
+# define SIZE_MAX (4294967295U)
+# endif
+
+/* Limits of `wchar_t'. */
+# ifndef WCHAR_MIN
+/* These constants might also be defined in <wchar.h>. */
+# define WCHAR_MIN __WCHAR_MIN
+# define WCHAR_MAX __WCHAR_MAX
+# endif
+
+/* Limits of `wint_t'. */
+# define WINT_MIN (0u)
+# define WINT_MAX (4294967295u)
+
+/* Signed. */
+# define INT8_C(c) c
+# define INT16_C(c) c
+# define INT32_C(c) c
+# if __WORDSIZE == 64
+# define INT64_C(c) c ## L
+# else
+# define INT64_C(c) c ## LL
+# endif
+
+/* Unsigned. */
+# define UINT8_C(c) c
+# define UINT16_C(c) c
+# define UINT32_C(c) c ## U
+# if __WORDSIZE == 64
+# define UINT64_C(c) c ## UL
+# else
+# define UINT64_C(c) c ## ULL
+# endif
+
+/* Maximal type. */
+# if __WORDSIZE == 64
+# define INTMAX_C(c) c ## L
+# define UINTMAX_C(c) c ## UL
+# else
+# define INTMAX_C(c) c ## LL
+# define UINTMAX_C(c) c ## ULL
+# endif
+
+
+#endif /* linux */
+
+#endif /* stdint.h */
+
+#else
+
+#include <wchar.h>
+
+/* stdint.h standard header */
+#pragma once
+#ifndef _STDINT
+#define _STDINT
+#ifndef RC_INVOKED
+#include <yvals.h>
+
+/* NB: assumes
+ byte has 8 bits
+ long is 32 bits
+ pointer can convert to and from long long
+ long long is longest type
+ */
+
+_C_STD_BEGIN
+ /* TYPE DEFINITIONS */
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+
+typedef signed char int_least8_t;
+typedef short int_least16_t;
+typedef int int_least32_t;
+
+typedef unsigned char uint_least8_t;
+typedef unsigned short uint_least16_t;
+typedef unsigned int uint_least32_t;
+
+typedef char int_fast8_t;
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+
+typedef unsigned char uint_fast8_t;
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+
+#ifndef _INTPTR_T_DEFINED
+ #define _INTPTR_T_DEFINED
+ #ifdef _WIN64
+typedef __int64 intptr_t;
+ #else /* _WIN64 */
+typedef _W64 int intptr_t;
+ #endif /* _WIN64 */
+#endif /* _INTPTR_T_DEFINED */
+
+#ifndef _UINTPTR_T_DEFINED
+ #define _UINTPTR_T_DEFINED
+ #ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+ #else /* _WIN64 */
+typedef _W64 unsigned int uintptr_t;
+ #endif /* _WIN64 */
+#endif /* _UINTPTR_T_DEFINED */
+
+typedef _Longlong int64_t;
+typedef _ULonglong uint64_t;
+
+typedef _Longlong int_least64_t;
+typedef _ULonglong uint_least64_t;
+
+typedef _Longlong int_fast64_t;
+typedef _ULonglong uint_fast64_t;
+
+typedef _Longlong intmax_t;
+typedef _ULonglong uintmax_t;
+
+ /* LIMIT MACROS */
+#define INT8_MIN (-0x7f - _C2)
+#define INT16_MIN (-0x7fff - _C2)
+#define INT32_MIN (-0x7fffffff - _C2)
+
+#define INT8_MAX 0x7f
+#define INT16_MAX 0x7fff
+#define INT32_MAX 0x7fffffff
+#define UINT8_MAX 0xff
+#define UINT16_MAX 0xffff
+#define UINT32_MAX 0xffffffff
+
+#define INT_LEAST8_MIN (-0x7f - _C2)
+#define INT_LEAST16_MIN (-0x7fff - _C2)
+#define INT_LEAST32_MIN (-0x7fffffff - _C2)
+
+#define INT_LEAST8_MAX 0x7f
+#define INT_LEAST16_MAX 0x7fff
+#define INT_LEAST32_MAX 0x7fffffff
+#define UINT_LEAST8_MAX 0xff
+#define UINT_LEAST16_MAX 0xffff
+#define UINT_LEAST32_MAX 0xffffffff
+
+#define INT_FAST8_MIN (-0x7f - _C2)
+#define INT_FAST16_MIN (-0x7fff - _C2)
+#define INT_FAST32_MIN (-0x7fffffff - _C2)
+
+#define INT_FAST8_MAX 0x7f
+#define INT_FAST16_MAX 0x7fff
+#define INT_FAST32_MAX 0x7fffffff
+#define UINT_FAST8_MAX 0xff
+#define UINT_FAST16_MAX 0xffff
+#define UINT_FAST32_MAX 0xffffffff
+
+ #if _INTPTR == 0 || _INTPTR == 1
+#define INTPTR_MAX 0x7fffffff
+#define INTPTR_MIN (-INTPTR_MAX - _C2)
+#define UINTPTR_MAX 0xffffffff
+
+ #else /* _INTPTR == 2 */
+#define INTPTR_MIN (-_LLONG_MAX - _C2)
+#define INTPTR_MAX _LLONG_MAX
+#define UINTPTR_MAX _ULLONG_MAX
+#endif /* _INTPTR */
+
+#define INT8_C(x) (x)
+#define INT16_C(x) (x)
+#define INT32_C(x) ((x) + (INT32_MAX - INT32_MAX))
+
+#define UINT8_C(x) (x)
+#define UINT16_C(x) (x)
+#define UINT32_C(x) ((x) + (UINT32_MAX - UINT32_MAX))
+
+#ifdef _WIN64
+ #define PTRDIFF_MIN INT64_MIN
+ #define PTRDIFF_MAX INT64_MAX
+#else /* _WIN64 */
+ #define PTRDIFF_MIN INT32_MIN
+ #define PTRDIFF_MAX INT32_MAX
+#endif /* _WIN64 */
+
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
+#ifndef SIZE_MAX
+ #ifdef _WIN64
+ #define SIZE_MAX UINT64_MAX
+ #else /* _WIN64 */
+ #define SIZE_MAX UINT32_MAX
+ #endif /* _WIN64 */
+#endif /* SIZE_MAX */
+
+#ifndef WCHAR_MIN
+#define WCHAR_MIN 0x0000
+#endif
+#define WCHAR_MAX 0xffff
+
+#define WINT_MIN 0x0000
+#define WINT_MAX 0xffff
+
+ #define INT64_MIN (-0x7fffffffffffffff - _C2)
+ #define INT64_MAX 0x7fffffffffffffff
+ #define UINT64_MAX 0xffffffffffffffffU
+
+ #define INT_LEAST64_MIN (-0x7fffffffffffffff - _C2)
+ #define INT_LEAST64_MAX 0x7fffffffffffffff
+ #define UINT_LEAST64_MAX 0xffffffffffffffffU
+
+ #define INT_FAST64_MIN (-0x7fffffffffffffff - _C2)
+ #define INT_FAST64_MAX 0x7fffffffffffffff
+ #define UINT_FAST64_MAX 0xffffffffffffffffU
+
+ #define INTMAX_MIN (-0x7fffffffffffffff - _C2)
+ #define INTMAX_MAX 0x7fffffffffffffff
+ #define UINTMAX_MAX 0xffffffffffffffffU
+
+#define INT64_C(x) ((x) + (INT64_MAX - INT64_MAX))
+#define UINT64_C(x) ((x) + (UINT64_MAX - UINT64_MAX))
+#define INTMAX_C(x) INT64_C(x)
+#define UINTMAX_C(x) UINT64_C(x)
+_C_STD_END
+#endif /* RC_INVOKED */
+#endif /* _STDINT */
+
+ #if defined(_STD_USING)
+using _CSTD int8_t; using _CSTD int16_t;
+using _CSTD int32_t; using _CSTD int64_t;
+
+using _CSTD uint8_t; using _CSTD uint16_t;
+using _CSTD uint32_t; using _CSTD uint64_t;
+
+using _CSTD int_least8_t; using _CSTD int_least16_t;
+using _CSTD int_least32_t; using _CSTD int_least64_t;
+using _CSTD uint_least8_t; using _CSTD uint_least16_t;
+using _CSTD uint_least32_t; using _CSTD uint_least64_t;
+
+using _CSTD intmax_t; using _CSTD uintmax_t;
+
+using _CSTD uintptr_t;
+using _CSTD intptr_t;
+
+using _CSTD int_fast8_t; using _CSTD int_fast16_t;
+using _CSTD int_fast32_t; using _CSTD int_fast64_t;
+using _CSTD uint_fast8_t; using _CSTD uint_fast16_t;
+using _CSTD uint_fast32_t; using _CSTD uint_fast64_t;
+ #endif /* defined(_STD_USING) */
+
+/*
+ * Copyright (c) 1992-2009 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+V5.20:0009 */
+
+#endif
diff --git a/include/qhy/titan034.h b/include/qhy/titan034.h new file mode 100644 index 0000000..f24ae63 --- /dev/null +++ b/include/qhy/titan034.h @@ -0,0 +1,412 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+/*! @file titan034.h
+ * @brief TITAN034 class define
+ */
+
+#include "qhybase.h"
+
+#ifdef LINUX
+#include <opencv/cv.h>
+#endif
+
+#ifndef TITAN034_DEF
+#define TITAN034_DEF
+
+
+/**
+ * @brief TITAN034 class define
+ *
+ * include all functions for titan034
+ */
+class TITAN034:public QHYBASE
+{
+public:
+ TITAN034();
+ ~TITAN034();
+ /**
+ @fn uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h)
+ @brief connect to the connected camera
+ @param d camera deivce
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ConnectCamera(qhyccd_device *d,qhyccd_handle **h);
+
+ /**
+ @fn uint32_t DisConnectCamera(qhyccd_handle *h)
+ @brief disconnect to the connected camera
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t DisConnectCamera(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t InitChipRegs(qhyccd_handle *h)
+ @brief Init the registers and some other things
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t InitChipRegs(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t IsChipHasFunction(CONTROL_ID id)
+ @brief check the camera has the function or not
+ @param id function id
+ @return
+ HAVE return QHYCCD_HAVE \n
+ NOT HAVE return QHYCCD_NOTHAVE
+ */
+ uint32_t IsChipHasFunction(CONTROL_ID id);
+
+ /**
+ @fn uint32_t ReSetParams2cam(qhyccd_handle *h)
+ @brief re set the params to camera,because some behavior will cause camera reset
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t ReSetParams2cam(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t SetChipGain(qhyccd_handle *h,double gain)
+ @brief set the gain to camera
+ @param h camera control handle
+ @param gain gain value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipGain(qhyccd_handle *h,double gain);
+
+ /**
+ @fn uint32_t SetChipExposeTime(qhyccd_handle *h,double i)
+ @brief set the expose time to camera
+ @param h camera control handle
+ @param i expose time value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipExposeTime(qhyccd_handle *h,double i);
+
+ /**
+ @fn uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i)
+ @brief set the transfer speed to camera
+ @param h camera control handle
+ @param i speed level
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipSpeed(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step)
+ @brief get the min,max and step value for function
+ @param controlId the control id
+ @param min the min value for function
+ @param max the max value for function
+ @param step single step value for function
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetControlMinMaxStepValue(CONTROL_ID controlId,double *min,double *max,double *step);
+
+ /**
+ @fn uint32_t GetChipMemoryLength()
+ @brief get the min cost memory for the image
+ @return
+ success return the total memory space(unit:byte) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetChipMemoryLength();
+
+ /**
+ @fn double GetChipExposeTime()
+ @brief get the current exposetime
+ @return
+ success return the current expose time (unit:us) \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipExposeTime();
+
+ /**
+ @fn double GetChipGain()
+ @brief get the current gain
+ @return
+ success return the current expose gain\n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipGain();
+
+ /**
+ @fn double GetChipSpeed()
+ @brief get the current transfer speed
+ @return
+ success return the current speed level \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipSpeed();
+
+ /**
+ @fn double GetChipBitsMode()
+ @brief get the current camera depth bits
+ @return
+ success return the current camera depth bits \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double GetChipBitsMode();
+
+ /**
+ @fn uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits)
+ @brief set the camera depth bits
+ @param h camera control handle
+ @param bits depth bits
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBitsMode(qhyccd_handle *h,uint32_t bits);
+
+ /**
+ @fn uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin)
+ @brief set the camera image bin mode
+ @param h camera control handle
+ @param wbin width bin
+ @param hbin height bin
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipBinMode(qhyccd_handle *h,uint32_t wbin,uint32_t hbin);
+
+ /**
+ @fn uint32_t CorrectWH(uint32_t *w,uint32_t *h)
+ @brief correct width and height if the setting width or height is not correct
+ @param w set width
+ @param h set height
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CorrectWH(uint32_t *w,uint32_t *h);
+
+ /**
+ @fn uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize)
+ @brief set camera ouput resolution
+ @param handle camera control handle
+ @param x the top left position x
+ @param y the top left position y
+ @param xsize the image width
+ @param ysize the image height
+ @return
+ on success,return QHYCCD_SUCCESS\n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipResolution(qhyccd_handle *handle,uint32_t x,uint32_t y,uint32_t xsize,uint32_t ysize);
+
+ /**
+ @fn uint32_t BeginSingleExposure(qhyccd_handle *h)
+ @brief begin single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginSingleExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t CancelExposing(qhyccd_handle *handle)
+ @param handle camera control handle
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposing(qhyccd_handle *handle);
+
+ /**
+ @fn uint32_t CancelExposingAndReadout(qhyccd_handle *h)
+ @brief stop single exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t CancelExposingAndReadout(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get single frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetSingleFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t BeginLiveExposure(qhyccd_handle *h)
+ @brief begin live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t BeginLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t StopLiveExposure(qhyccd_handle *h)
+ @brief stop live exposure
+ @param h camera control handle
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t StopLiveExposure(qhyccd_handle *h);
+
+ /**
+ @fn uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData)
+ @brief get live frame image data
+ @param h camera control handle
+ @param pW real width
+ @param pH real height
+ @param pBpp real depth bits
+ @param pChannels real channels
+ @param ImgData image data buffer
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t GetLiveFrame(qhyccd_handle *h,uint32_t *pW,uint32_t *pH,uint32_t * pBpp,uint32_t *pChannels,uint8_t *ImgData);
+
+ /**
+ @fn uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i)
+ @brief set hblank
+ @param h camera control handle
+ @param i hblank value
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetChipUSBTraffic(qhyccd_handle *h,uint32_t i);
+
+ /**
+ @fn uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime)
+ @brief send the command to camera's guide port
+ @param h camera control handle
+ @param Direction RA DEC
+ @param PulseTime the time last for command
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t Send2GuiderPort(qhyccd_handle *h,uint32_t Direction,uint16_t PulseTime);
+
+
+ /**
+ @fn double SetPll(qhyccd_handle *h,uint8_t clk)
+ @brief set the cmos inter pll
+ @param h camera control handle
+ @param clk clock
+ @return
+ success return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ double SetPll(qhyccd_handle *h,uint8_t clk);
+
+ /**
+ @fn void SWIFT_MSBLSB(uint8_t *ImgData)
+ @brief switch the image pixel data to right position
+ @param ImgData image buffer
+ */
+ void SWIFT_MSBLSB(uint8_t *ImgData);
+
+ /**
+ @fn void SetAnalogGain(double gain)
+ @brief set gain to camera,here it is the bottom
+ @param gain gain value
+ */
+ void SetAnalogGain(qhyccd_handle *h,double gain);
+
+ /** @fn uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh)
+ @brief get the camera's ccd/cmos chip info
+ @param h camera control handle
+ @param chipw chip size width
+ @param chiph chip size height
+ @param imagew chip output image width
+ @param imageh chip output image height
+ @param pixelw chip pixel size width
+ @param pixelh chip pixel size height
+ @param bpp chip pixel depth
+ */
+ uint32_t GetChipInfo(double *chipw,double *chiph,uint32_t *imagew,uint32_t *imageh,double *pixelw,double *pixelh,uint32_t *bpp);
+
+
+ /** @fn uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY)
+ @brief Set the camera on focus mode
+ @param h camera control handle
+ @param focusCenterX
+ @param focusCenterY
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetFocusSetting(qhyccd_handle *h,uint32_t focusCenterX, uint32_t focusCenterY);
+
+ /**
+ @fn uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode)
+ @brief Set the camera's mode to chose the way reading data from camera
+ @param handle camera control handle
+ @param mode the stream mode \n
+ 0x00:default mode,single frame mode \n
+ 0x01:live mode \n
+ @return
+ on success,return QHYCCD_SUCCESS \n
+ another QHYCCD_ERROR code on other failures
+ */
+ uint32_t SetStreamMode(qhyccd_handle *handle,uint8_t mode);
+
+private:
+ uint32_t expmode; //!< expose time mode
+ uint32_t pllratio; //!< inter pll ratio
+ uint32_t lastx,lasty,lastxsize,lastysize;
+ uint32_t longtimeflag;
+ uint32_t transferflag;
+};
+#endif
diff --git a/include/qhy/unlockimagequeue.h b/include/qhy/unlockimagequeue.h new file mode 100644 index 0000000..35aef29 --- /dev/null +++ b/include/qhy/unlockimagequeue.h @@ -0,0 +1,56 @@ +/* + QHYCCD SDK + + Copyright (c) 2014 QHYCCD. + All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + The full GNU General Public License is included in this distribution in the + file called LICENSE. + */ +#ifndef _UNLOCK_QUEUE_H +#define _UNLOCK_QUEUE_H + +class UnlockImageQueue { +public: + UnlockImageQueue(); + virtual ~UnlockImageQueue(); + + bool Initialize(int nSize); + unsigned int Put(const unsigned char *pBuffer, unsigned int nLen); + unsigned int Get(unsigned char *pBuffer, unsigned int nLen); + inline void Clean() { + m_nIn = 0; + m_nOut = 0; + } + inline unsigned int GetDataLen() const { + return m_nIn - m_nOut; + } + +private: + inline bool is_power_of_2(unsigned long n) { + return (n != 0 && ((n & (n - 1)) == 0)); + }; + + inline unsigned long roundup_power_of_two(unsigned long val); +private: + unsigned char *m_pBuffer; /* the buffer holding the data */ + unsigned int m_nSize; /* the size of the allocated buffer */ + unsigned int m_nIn; /* data is added at offset (in % size) */ + unsigned int m_nOut; /* data is extracted from offset (out % size) */ +}; + +#endif diff --git a/include/qhy/usb.h b/include/qhy/usb.h new file mode 100644 index 0000000..ac5d23f --- /dev/null +++ b/include/qhy/usb.h @@ -0,0 +1,1083 @@ +/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ USB.H
+
+Abstract:
+
+ structures and APIs for USB drivers.
+
+Environment:
+
+ Kernel & user mode
+
+Revision History:
+
+ 09-29-95 : created
+ 02-10-04 : Updated to include header versioning
+
+--*/
+
+#ifndef __USB_H__
+#define __USB_H__
+
+
+
+/*
+ This file is equivalent to USBDI.H with extensions supported by
+ usbport.sys for eUSB.
+
+ This file replaces usbdi.h and is compatible with older versions
+ of the USB stack.
+*/
+
+#ifdef OSR21_COMPAT
+#pragma message("WARNING: OSR21_COMPAT SWITCH NOT SUPPORTED")
+#endif
+
+#ifndef _NTDDK_
+#ifndef _WDMDDK_
+typedef PVOID PIRP;
+typedef PVOID PMDL;
+#endif
+#endif
+
+#define USBDI_VERSION 0x00000600
+
+#include "usb200.h"
+#ifdef _WDMDDK_
+#endif
+
+/*
+ Microsoft Extended Port Attribute Flags
+*/
+#if _MSC_VER >= 1200
+#pragma warning(push)
+#endif
+#pragma warning(disable:4201) // named type definition in parentheses
+#pragma warning(disable:4214) // named type definition in parentheses
+
+#define USB_PORTATTR_NO_CONNECTOR 0x00000001
+#define USB_PORTATTR_SHARED_USB2 0x00000002
+#define USB_PORTATTR_MINI_CONNECTOR 0x00000004
+#define USB_PORTATTR_OEM_CONNECTOR 0x00000008
+
+/* dynamic attributes */
+#define USB_PORTATTR_OWNED_BY_CC 0x01000000
+#define USB_PORTATTR_NO_OVERCURRENT_UI 0x02000000
+
+
+/* define USB controller flavors:
+ These are all known HW implementations that require special
+ hacks.
+*/
+
+typedef enum _USB_CONTROLLER_FLAVOR {
+
+ USB_HcGeneric = 0,
+
+ OHCI_Generic = 100,
+ OHCI_Hydra,
+ OHCI_NEC,
+
+ UHCI_Generic = 200,
+ UHCI_Piix4 = 201,
+ UHCI_Piix3 = 202,
+ UHCI_Ich2 = 203,
+ UHCI_Reserved204 = 204, // was ich2_2
+ UHCI_Ich1 = 205,
+ UHCI_Ich3m = 206,
+ UHCI_Ich4 = 207,
+ UHCI_Ich5 = 208,
+ UHCI_Ich6 = 209,
+
+ UHCI_Intel = 249,
+
+ //these VIA revs require special handling in the uhci miniport
+ UHCI_VIA = 250,
+ UHCI_VIA_x01 = 251,
+ UHCI_VIA_x02 = 252,
+ UHCI_VIA_x03 = 253,
+ UHCI_VIA_x04 = 254,
+
+ UHCI_VIA_x0E_FIFO = 264,
+
+ EHCI_Generic = 1000,
+ EHCI_NEC = 2000,
+ EHCI_Lucent = 3000
+
+} USB_CONTROLLER_FLAVOR;
+
+
+//
+// USB defined structures and constants
+// (see chapter 9 of USB specification)
+//
+
+#define USB_DEFAULT_DEVICE_ADDRESS 0
+#define USB_DEFAULT_ENDPOINT_ADDRESS 0
+
+//
+// max packet size (bytes) for default endpoint
+// until SET_ADDRESS command is received.
+//
+
+#define USB_DEFAULT_MAX_PACKET 64
+
+//
+// USBD interface structures and constants
+//
+
+
+#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1)
+
+//
+// URB request codes
+//
+
+#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
+#define URB_FUNCTION_SELECT_INTERFACE 0x0001
+#define URB_FUNCTION_ABORT_PIPE 0x0002
+#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
+#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
+#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005
+#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006
+#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
+#define URB_FUNCTION_CONTROL_TRANSFER 0x0008
+#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
+#define URB_FUNCTION_ISOCH_TRANSFER 0x000A
+#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
+#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
+#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
+#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
+#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
+#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
+#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
+#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
+#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
+#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
+#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
+#define URB_FUNCTION_RESERVED_0X0016 0x0016
+#define URB_FUNCTION_VENDOR_DEVICE 0x0017
+#define URB_FUNCTION_VENDOR_INTERFACE 0x0018
+#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019
+#define URB_FUNCTION_CLASS_DEVICE 0x001A
+#define URB_FUNCTION_CLASS_INTERFACE 0x001B
+#define URB_FUNCTION_CLASS_ENDPOINT 0x001C
+#define URB_FUNCTION_RESERVE_0X001D 0x001D
+// previously URB_FUNCTION_RESET_PIPE
+#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E
+#define URB_FUNCTION_CLASS_OTHER 0x001F
+#define URB_FUNCTION_VENDOR_OTHER 0x0020
+#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021
+#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022
+#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023
+#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024
+#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025
+#define URB_FUNCTION_GET_CONFIGURATION 0x0026
+#define URB_FUNCTION_GET_INTERFACE 0x0027
+#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
+#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029
+
+// USB 2.0 calls start at 0x0030
+
+#if (_WIN32_WINNT >= 0x0501)
+
+#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A
+#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030
+#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031
+
+#endif
+
+#if (_WIN32_WINNT >= 0x0600)
+
+#define URB_FUNCTION_CONTROL_TRANSFER_EX 0x0032
+#define URB_FUNCTION_RESERVE_0X0033 0x0033
+#define URB_FUNCTION_RESERVE_0X0034 0x0034
+
+#endif
+
+// Reserve 0x002B-0x002F
+#define URB_FUNCTION_RESERVE_0X002B 0x002B
+#define URB_FUNCTION_RESERVE_0X002C 0x002C
+#define URB_FUNCTION_RESERVE_0X002D 0x002D
+#define URB_FUNCTION_RESERVE_0X002E 0x002E
+#define URB_FUNCTION_RESERVE_0X002F 0x002F
+
+
+// for backward drivers
+#define URB_FUNCTION_RESET_PIPE \
+ URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL
+
+/* Control Pipe Function Groupings
+
+ These functions correspond to the standard commands
+ on the default pipe, direction is implied
+
+
+URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
+URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT
+URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE
+
+URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE
+URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT
+URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE
+
+URB_FUNCTION_SET_FEATURE_TO_DEVICE
+URB_FUNCTION_SET_FEATURE_TO_INTERFACE
+URB_FUNCTION_SET_FEATURE_TO_ENDPOINT
+URB_FUNCTION_SET_FEATURE_TO_OTHER
+
+URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE
+URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE
+URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT
+URB_FUNCTION_CLEAR_FEATURE_TO_OTHER
+
+URB_FUNCTION_GET_STATUS_FROM_DEVICE
+URB_FUNCTION_GET_STATUS_FROM_INTERFACE
+URB_FUNCTION_GET_STATUS_FROM_ENDPOINT
+URB_FUNCTION_GET_STATUS_FROM_OTHER
+
+URB_FUNCTION_VENDOR_DEVICE
+URB_FUNCTION_VENDOR_INTERFACE
+URB_FUNCTION_VENDOR_ENDPOINT
+URB_FUNCTION_VENDOR_OTHER
+
+URB_FUNCTION_CLASS_DEVICE
+URB_FUNCTION_CLASS_INTERFACE
+URB_FUNCTION_CLASS_ENDPOINT
+URB_FUNCTION_CLASS_OTHER
+
+*/
+
+//
+// Values for URB TransferFlags Field
+//
+
+/*
+ Set if data moves device->host
+*/
+#define USBD_TRANSFER_DIRECTION 0x00000001
+/*
+ This bit if not set indicates that a short packet, and hence,
+ a short transfer is an error condition
+*/
+#define USBD_SHORT_TRANSFER_OK 0x00000002
+/*
+ Subit the iso transfer on the next frame
+*/
+#define USBD_START_ISO_TRANSFER_ASAP 0x00000004
+#define USBD_DEFAULT_PIPE_TRANSFER 0x00000008
+
+
+#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION)
+
+#define USBD_TRANSFER_DIRECTION_OUT 0
+#define USBD_TRANSFER_DIRECTION_IN 1
+
+#define VALID_TRANSFER_FLAGS_MASK (USBD_SHORT_TRANSFER_OK | \
+ USBD_TRANSFER_DIRECTION | \
+ USBD_START_ISO_TRANSFER_ASAP | \
+ USBD_DEFAULT_PIPE_TRANSFER)
+
+#define USBD_ISO_START_FRAME_RANGE 1024
+
+typedef LONG USBD_STATUS;
+
+//
+// USBD status codes
+//
+// Status values are 32 bit values layed out as follows:
+//
+// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+// +---+---------------------------+-------------------------------+
+// | S | Status Code |
+// +---+---------------------------+-------------------------------+
+//
+// where
+//
+// S - is the state code
+//
+// 00 - completed with success
+// 01 - request is pending
+// 11, 10 - completed with error
+//
+//
+// Code - is the status code
+//
+
+//
+// Generic test for success on any status value (non-negative numbers
+// indicate success).
+//
+
+#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0)
+
+//
+// Generic test for pending status value.
+//
+
+#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1)
+
+//
+// Generic test for error on any status value.
+//
+
+#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0)
+
+//
+// Macro to check the status code only
+//
+//
+//define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL)
+
+// the high order bits (0xC) will always be set on an error
+
+#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L)
+#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L)
+//
+//#define USBD_STATUS_ERROR ((USBD_STATUS)0xC0000000L)
+
+
+// The following are defined for backward compatibility with the usb 1.0 stack
+
+
+//
+// HC (Hardware) status codes range 0x00000001 - 0x000000FF
+//
+
+#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L)
+#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L)
+#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L)
+#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L)
+#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L)
+#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L)
+#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L)
+#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L)
+#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L)
+#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL)
+#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL)
+#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL)
+#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL)
+#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL)
+#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L)
+
+#define USBD_STATUS_XACT_ERROR ((USBD_STATUS)0xC0000011L)
+#define USBD_STATUS_BABBLE_DETECTED ((USBD_STATUS)0xC0000012L)
+#define USBD_STATUS_DATA_BUFFER_ERROR ((USBD_STATUS)0xC0000013L)
+
+//
+// returned by HCD if a transfer is submitted to an endpoint that is
+// stalled
+//
+#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L)
+
+//
+// Software status codes
+//
+#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L)
+#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L)
+
+//
+// returned if client driver attempts to close an endpoint/interface
+// or configuration with outstanding transfers.
+//
+#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L)
+//
+// returned by USBD if it cannot complete a URB request, typically this
+// will be returned in the URB status field when the Irp is completed
+// with a more specific NT error code in the irp.status field.
+//
+//#define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L)
+
+#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L)
+
+// returned when there is not enough bandwidth avialable
+// to open a requested endpoint
+#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L)
+//
+// generic HC error
+//
+#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L)
+//
+// returned when a short packet terminates the transfer
+// ie USBD_SHORT_TRANSFER_OK bit not set
+//
+#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L)
+//
+// returned if the requested start frame is not within
+// USBD_ISO_START_FRAME_RANGE of the current USB frame,
+// note that the stall bit is set
+//
+#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L)
+//
+// returned by HCD if all packets in an iso transfer complete with an error
+//
+#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L)
+//
+// returned by USBD if the frame length control for a given
+// HC is already taken by anothe driver
+//
+#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L)
+//
+// returned by USBD if the caller does not own frame length control and
+// attempts to release or modify the HC frame length
+//
+#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED ((USBD_STATUS)0xC0000D00L)
+
+//
+// additonal software error codes added for usb 2.0
+//
+
+//
+// returned for APIS not supported/implemented
+//
+#define USBD_STATUS_NOT_SUPPORTED ((USBD_STATUS)0xC0000E00L)
+
+#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR \
+ ((USBD_STATUS)0xC0000F00L)
+
+#define USBD_STATUS_INVALID_CONFIGURATION_DESCRIPTOR \
+ ((USBD_STATUS)0xC0000F00L)
+
+#define USBD_STATUS_INSUFFICIENT_RESOURCES ((USBD_STATUS)0xC0001000L)
+
+#define USBD_STATUS_SET_CONFIG_FAILED ((USBD_STATUS)0xC0002000L)
+
+#define USBD_STATUS_BUFFER_TOO_SMALL ((USBD_STATUS)0xC0003000L)
+
+#define USBD_STATUS_INTERFACE_NOT_FOUND ((USBD_STATUS)0xC0004000L)
+
+#define USBD_STATUS_INAVLID_PIPE_FLAGS ((USBD_STATUS)0xC0005000L)
+
+#define USBD_STATUS_TIMEOUT ((USBD_STATUS)0xC0006000L)
+
+#define USBD_STATUS_DEVICE_GONE ((USBD_STATUS)0xC0007000L)
+
+#define USBD_STATUS_STATUS_NOT_MAPPED ((USBD_STATUS)0xC0008000L)
+
+// returned when urb is intercepted or handled by the hub driver
+#define USBD_STATUS_HUB_INTERNAL_ERROR ((USBD_STATUS)0xC0009000L)
+
+
+//
+// set when a transfers is completed due to an AbortPipe request from
+// the client driver
+//
+//
+#define USBD_STATUS_CANCELED ((USBD_STATUS)0xC0010000L)
+
+//
+// extended isochronous error codes, these errors appear in the
+// packet status field of an isochronous transfer
+//
+
+
+// for some reason the controller did not access the TD asocated with this
+// packet
+#define USBD_STATUS_ISO_NOT_ACCESSED_BY_HW ((USBD_STATUS)0xC0020000L)
+// controller reported an error in the TD
+// since TD errors are controoler specific they are reorted
+// generically with this error code
+#define USBD_STATUS_ISO_TD_ERROR ((USBD_STATUS)0xC0030000L)
+// the packet was submitted in time by the client but
+// failed to reach the miniport in time
+#define USBD_STATUS_ISO_NA_LATE_USBPORT ((USBD_STATUS)0xC0040000L)
+// the packet was not sent because the client submitted it too late
+// to transmit
+#define USBD_STATUS_ISO_NOT_ACCESSED_LATE ((USBD_STATUS)0xC0050000L)
+
+// new parameter validation status codes
+#define USBD_STATUS_BAD_DESCRIPTOR ((USBD_STATUS)0xC0100000L)
+#define USBD_STATUS_BAD_DESCRIPTOR_BLEN ((USBD_STATUS)0xC0100001L)
+#define USBD_STATUS_BAD_DESCRIPTOR_TYPE ((USBD_STATUS)0xC0100002L)
+#define USBD_STATUS_BAD_INTERFACE_DESCRIPTOR ((USBD_STATUS)0xC0100003L)
+#define USBD_STATUS_BAD_ENDPOINT_DESCRIPTOR ((USBD_STATUS)0xC0100004L)
+#define USBD_STATUS_BAD_INTERFACE_ASSOC_DESCRIPTOR ((USBD_STATUS)0xC0100005L)
+#define USBD_STATUS_BAD_CONFIG_DESC_LENGTH ((USBD_STATUS)0xC0100006L)
+#define USBD_STATUS_BAD_NUMBER_OF_INTERFACES ((USBD_STATUS)0xC0100007L)
+#define USBD_STATUS_BAD_NUMBER_OF_ENDPOINTS ((USBD_STATUS)0xC0100008L)
+#define USBD_STATUS_BAD_ENDPOINT_ADDRESS ((USBD_STATUS)0xC0100009L)
+
+
+
+typedef PVOID USBD_PIPE_HANDLE;
+typedef PVOID USBD_CONFIGURATION_HANDLE;
+typedef PVOID USBD_INTERFACE_HANDLE;
+
+//
+// Value used to indicate the default max transfer size
+//
+
+/*
+ MAX TRANSFER SIZE
+
+ Specified during select_configuration or
+ selec_interface. This is the largest
+ transfer a client driver will do to an
+ endpoint.
+
+ This value may be from 0x00000001 to
+ 0xFFFFFFFF (1 to 4GB)
+
+*/
+//
+
+#if (_WIN32_WINNT >= 0x0501)
+
+//
+// For windows XP and later
+//
+
+#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE 0xFFFFFFFF
+
+#else
+
+//
+// For Windows 2000
+//
+
+#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE PAGE_SIZE
+
+#endif
+
+//
+// structure returned from USBD_GetVersion function
+//
+
+typedef struct _USBD_VERSION_INFORMATION {
+ ULONG USBDI_Version; //BCD usb interface version number
+ ULONG Supported_USB_Version; //BCD USB spec version number
+} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION;
+
+typedef enum _USBD_PIPE_TYPE {
+ UsbdPipeTypeControl,
+ UsbdPipeTypeIsochronous,
+ UsbdPipeTypeBulk,
+ UsbdPipeTypeInterrupt
+} USBD_PIPE_TYPE;
+
+#define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & \
+ USB_ENDPOINT_DIRECTION_MASK)
+
+typedef struct _USBD_DEVICE_INFORMATION {
+ ULONG OffsetNext;
+ PVOID UsbdDeviceHandle;
+ USB_DEVICE_DESCRIPTOR DeviceDescriptor;
+} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION;
+
+//
+// URB request structures
+//
+
+//
+// USBD pipe information structure, this structure
+// is returned for each pipe opened thru an
+// SELECT_CONFIGURATION or SELECT_INTERFACE request.
+//
+
+typedef struct _USBD_PIPE_INFORMATION {
+ //
+ // OUTPUT
+ // These fields are filled in by USBD
+ //
+ USHORT MaximumPacketSize; // Maximum packet size for this pipe
+ UCHAR EndpointAddress; // 8 bit USB endpoint address (includes direction)
+ // taken from endpoint descriptor
+ UCHAR Interval; // Polling interval in ms if interrupt pipe
+
+ USBD_PIPE_TYPE PipeType; // PipeType identifies type of transfer valid for this pipe
+ USBD_PIPE_HANDLE PipeHandle;
+
+ //
+ // INPUT
+ // These fields are filled in by the client driver
+ //
+ ULONG MaximumTransferSize; // Maximum size for a single request
+ // in bytes.
+ ULONG PipeFlags;
+} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION;
+
+//
+// values for PipeFlags field in USBD_PIPE_INFORMATION field
+//
+
+// override the enpoint max_packet size
+// with the value in pipe_information
+// field
+#define USBD_PF_CHANGE_MAX_PACKET 0x00000001
+// optimize for short packets
+// 'bulk optimization #1'
+#define USBD_PF_SHORT_PACKET_OPT 0x00000002
+// optimize transfers for use
+// with 'real time threads
+#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004
+// causes the driver to allocate map
+// map more transfers in the queue.
+#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008
+
+#define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | \
+ USBD_PF_SHORT_PACKET_OPT | \
+ USBD_PF_ENABLE_RT_THREAD_ACCESS | \
+ USBD_PF_MAP_ADD_TRANSFERS)
+
+
+//
+// USBD interface information structure, this structure
+// is returned for each interface opened thru an
+// SELECT_CONFIGURATION or SELECT_INTERFACE request.
+//
+
+typedef struct _USBD_INTERFACE_INFORMATION {
+ USHORT Length; // Length of this structure, including
+ // all pipe information structures that
+ // follow.
+ //
+ // INPUT
+ //
+ // Interface number and Alternate setting this
+ // structure is associated with
+ //
+ UCHAR InterfaceNumber;
+ UCHAR AlternateSetting;
+
+ //
+ // OUTPUT
+ // These fields are filled in by USBD
+ //
+ UCHAR Class;
+ UCHAR SubClass;
+ UCHAR Protocol;
+ UCHAR Reserved;
+
+ USBD_INTERFACE_HANDLE InterfaceHandle;
+ ULONG NumberOfPipes;
+
+ //
+ // INPUT/OUPUT
+ // see PIPE_INFORMATION
+
+ USBD_PIPE_INFORMATION Pipes[1];
+} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION;
+
+//
+// work space provided for HCDs
+//
+
+struct _URB_HCD_AREA {
+ PVOID Reserved8[8];
+};
+
+struct _URB_HEADER {
+ //
+ // Fields filled in by client driver
+ //
+ USHORT Length;
+ USHORT Function;
+ USBD_STATUS Status;
+ //
+ // Fields used only by USBD
+ //
+ PVOID UsbdDeviceHandle; // device handle assigned to this device
+ // by USBD
+ ULONG UsbdFlags; // flags field reserved for USBD use.
+};
+
+struct _URB_SELECT_INTERFACE {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ USBD_CONFIGURATION_HANDLE ConfigurationHandle;
+
+ // client must input AlternateSetting & Interface Number
+ // class driver returns interface and handle
+ // for new alternate setting
+ USBD_INTERFACE_INFORMATION Interface;
+};
+
+struct _URB_SELECT_CONFIGURATION {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ // NULL indicates to set the device
+ // to the 'unconfigured' state
+ // ie set to configuration 0
+ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
+ USBD_CONFIGURATION_HANDLE ConfigurationHandle;
+ USBD_INTERFACE_INFORMATION Interface;
+};
+
+//
+// This structure used for ABORT_PIPE & RESET_PIPE
+//
+
+struct _URB_PIPE_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ USBD_PIPE_HANDLE PipeHandle;
+ ULONG Reserved;
+};
+
+//
+// This structure used for
+// TAKE_FRAME_LENGTH_CONTROL &
+// RELEASE_FRAME_LENGTH_CONTROL
+//
+
+struct _URB_FRAME_LENGTH_CONTROL {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+};
+
+struct _URB_GET_FRAME_LENGTH {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ ULONG FrameLength;
+ ULONG FrameNumber;
+};
+
+struct _URB_SET_FRAME_LENGTH {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ LONG FrameLengthDelta;
+};
+
+struct _URB_GET_CURRENT_FRAME_NUMBER {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ ULONG FrameNumber;
+};
+
+//
+// Structures for specific control transfers
+// on the default pipe.
+//
+
+// GET_DESCRIPTOR
+// SET_DESCRIPTOR
+
+struct _URB_CONTROL_DESCRIPTOR_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG Reserved0;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *reserved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ USHORT Reserved1;
+ UCHAR Index;
+ UCHAR DescriptorType;
+ USHORT LanguageId;
+ USHORT Reserved2;
+};
+
+// GET_STATUS
+
+struct _URB_CONTROL_GET_STATUS_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG Reserved0;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *reserved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR Reserved1[4];
+ USHORT Index; // zero, interface or endpoint
+ USHORT Reserved2;
+};
+
+// SET_FEATURE
+// CLEAR_FEATURE
+
+struct _URB_CONTROL_FEATURE_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG Reserved2;
+ ULONG Reserved3;
+ PVOID Reserved4;
+ PMDL Reserved5;
+ struct _URB *UrbLink; // *reserved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ USHORT Reserved0;
+ USHORT FeatureSelector;
+ USHORT Index; // zero, interface or endpoint
+ USHORT Reserved1;
+};
+
+// VENDOR & CLASS
+
+struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG TransferFlags;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *reserved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR RequestTypeReservedBits;
+ UCHAR Request;
+ USHORT Value;
+ USHORT Index;
+ USHORT Reserved1;
+};
+
+
+struct _URB_CONTROL_GET_INTERFACE_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG Reserved0;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *reserved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR Reserved1[4];
+ USHORT Interface;
+ USHORT Reserved2;
+};
+
+
+struct _URB_CONTROL_GET_CONFIGURATION_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG Reserved0;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *resrved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR Reserved1[8];
+};
+
+#if (_WIN32_WINNT >= 0x0501)
+
+// Microsoft OS Descriptor APIs
+// supported in windows XP and later
+
+#define OS_STRING_DESCRIPTOR_INDEX 0xEE
+
+#define MS_GENRE_DESCRIPTOR_INDEX 0x0001
+#define MS_POWER_DESCRIPTOR_INDEX 0x0002
+
+#define MS_OS_STRING_SIGNATURE L"MSFT100"
+
+#define MS_OS_FLAGS_CONTAINERID 0x02
+
+typedef struct _OS_STRING {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ WCHAR MicrosoftString[7];
+ UCHAR bVendorCode;
+ union {
+ UCHAR bPad;
+ UCHAR bFlags;
+ };
+} OS_STRING, *POS_STRING;
+
+struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ PVOID Reserved;
+ ULONG Reserved0;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *optional* link to next urb request
+ // if this is a chain of commands
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR Recipient:5; // Recipient {Device,Interface,Endpoint}
+ UCHAR Reserved1:3;
+ UCHAR Reserved2;
+ UCHAR InterfaceNumber; // wValue - high byte
+ UCHAR MS_PageIndex; // wValue - low byte
+ USHORT MS_FeatureDescriptorIndex; // wIndex field
+ USHORT Reserved3;
+};
+
+#endif
+
+//
+// request format for a control transfer on
+// the non-default pipe.
+//
+
+struct _URB_CONTROL_TRANSFER {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ USBD_PIPE_HANDLE PipeHandle;
+ ULONG TransferFlags;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *reserved MBZ*
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR SetupPacket[8];
+};
+
+#if (_WIN32_WINNT >= 0x0600)
+
+//
+// Suported for Windows Longhorn and later
+//
+
+struct _URB_CONTROL_TRANSFER_EX {
+ struct _URB_HEADER Hdr;
+ USBD_PIPE_HANDLE PipeHandle;
+ ULONG TransferFlags;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ ULONG Timeout; // *optional* timeout in milliseconds
+ // for this request, 0 = no timeout
+#ifdef WIN64
+ ULONG Pad;
+#endif
+ struct _URB_HCD_AREA hca; // fields for HCD use
+ UCHAR SetupPacket[8];
+};
+
+#endif
+
+struct _URB_BULK_OR_INTERRUPT_TRANSFER {
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ USBD_PIPE_HANDLE PipeHandle;
+ ULONG TransferFlags; // note: the direction bit will be set by USBD
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *optional* link to next urb request
+ // if this is a chain of commands
+ struct _URB_HCD_AREA hca; // fields for HCD use
+};
+
+
+//
+// ISO Transfer request
+//
+// TransferBufferMDL must point to a single virtually
+// contiguous buffer.
+//
+// StartFrame - the frame to send/receive the first packet of
+// the request.
+//
+// NumberOfPackets - number of packets to send in this request
+//
+//
+// IsoPacket Array
+//
+// Input: Offset - offset of the packet from the beginig
+// of the client buffer.
+// Output: Length - is set to the actual length of the packet
+// (For IN transfers).
+// Status: error that occurred during transmission or
+// reception of the packet.
+//
+
+typedef struct _USBD_ISO_PACKET_DESCRIPTOR {
+ ULONG Offset; // INPUT Offset of the packet from the begining of the
+ // buffer.
+
+ ULONG Length; // OUTPUT length of data received (for in).
+ // OUTPUT 0 for OUT.
+ USBD_STATUS Status; // status code for this packet.
+} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR;
+
+struct _URB_ISOCH_TRANSFER {
+ //
+ // This block is the same as CommonTransfer
+ //
+ struct _URB_HEADER Hdr; // function code indicates get or set.
+ USBD_PIPE_HANDLE PipeHandle;
+ ULONG TransferFlags;
+ ULONG TransferBufferLength;
+ PVOID TransferBuffer;
+ PMDL TransferBufferMDL; // *optional*
+ struct _URB *UrbLink; // *optional* link to next urb request
+ // if this is a chain of commands
+ struct _URB_HCD_AREA hca; // fields for HCD use
+
+ //
+ // this block contains transfer fields
+ // specific to isochronous transfers
+ //
+
+ // 32 bit frame number to begin this transfer on, must be within 1000
+ // frames of the current USB frame or an error is returned.
+
+ // START_ISO_TRANSFER_ASAP flag in transferFlags:
+ // If this flag is set and no transfers have been submitted
+ // for the pipe then the transfer will begin on the next frame
+ // and StartFrame will be updated with the frame number the transfer
+ // was started on.
+ // If this flag is set and the pipe has active transfers then
+ // the transfer will be queued to begin on the frame after the
+ // last transfer queued is completed.
+ //
+ ULONG StartFrame;
+ // number of packets that make up this request
+ ULONG NumberOfPackets;
+ // number of packets that completed with errors
+ ULONG ErrorCount;
+ USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1];
+};
+
+
+typedef struct _URB {
+ union {
+ struct _URB_HEADER
+ UrbHeader;
+ struct _URB_SELECT_INTERFACE
+ UrbSelectInterface;
+ struct _URB_SELECT_CONFIGURATION
+ UrbSelectConfiguration;
+ struct _URB_PIPE_REQUEST
+ UrbPipeRequest;
+ struct _URB_FRAME_LENGTH_CONTROL
+ UrbFrameLengthControl;
+ struct _URB_GET_FRAME_LENGTH
+ UrbGetFrameLength;
+ struct _URB_SET_FRAME_LENGTH
+ UrbSetFrameLength;
+ struct _URB_GET_CURRENT_FRAME_NUMBER
+ UrbGetCurrentFrameNumber;
+ struct _URB_CONTROL_TRANSFER
+ UrbControlTransfer;
+
+ #if (_WIN32_WINNT >= 0x0600)
+
+ struct _URB_CONTROL_TRANSFER_EX
+ UrbControlTransferEx;
+
+ #endif
+
+ struct _URB_BULK_OR_INTERRUPT_TRANSFER
+ UrbBulkOrInterruptTransfer;
+ struct _URB_ISOCH_TRANSFER
+ UrbIsochronousTransfer;
+
+ // for standard control transfers on the default pipe
+ struct _URB_CONTROL_DESCRIPTOR_REQUEST
+ UrbControlDescriptorRequest;
+ struct _URB_CONTROL_GET_STATUS_REQUEST
+ UrbControlGetStatusRequest;
+ struct _URB_CONTROL_FEATURE_REQUEST
+ UrbControlFeatureRequest;
+ struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST
+ UrbControlVendorClassRequest;
+ struct _URB_CONTROL_GET_INTERFACE_REQUEST
+ UrbControlGetInterfaceRequest;
+ struct _URB_CONTROL_GET_CONFIGURATION_REQUEST
+ UrbControlGetConfigurationRequest;
+
+ #if (_WIN32_WINNT >= 0x0501)
+
+ struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST
+ UrbOSFeatureDescriptorRequest;
+ #endif
+
+ };
+} URB, *PURB;
+
+#if _MSC_VER >= 1200
+#pragma warning(pop)
+#endif
+
+
+#endif /* __USB_H__ */
+
diff --git a/include/qhy/usb100.h b/include/qhy/usb100.h new file mode 100644 index 0000000..5129b11 --- /dev/null +++ b/include/qhy/usb100.h @@ -0,0 +1,272 @@ +#ifndef __USB100_H__
+#define __USB100_H__
+
+
+#include <PSHPACK1.H>
+
+
+//bmRequest.Dir
+#define BMREQUEST_HOST_TO_DEVICE 0
+#define BMREQUEST_DEVICE_TO_HOST 1
+
+//bmRequest.Type
+#define BMREQUEST_STANDARD 0
+#define BMREQUEST_CLASS 1
+#define BMREQUEST_VENDOR 2
+
+//bmRequest.Recipient
+#define BMREQUEST_TO_DEVICE 0
+#define BMREQUEST_TO_INTERFACE 1
+#define BMREQUEST_TO_ENDPOINT 2
+#define BMREQUEST_TO_OTHER 3
+
+
+#define MAXIMUM_USB_STRING_LENGTH 255
+
+// values for the bits returned by the USB GET_STATUS command
+#define USB_GETSTATUS_SELF_POWERED 0x01
+#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02
+
+
+#define USB_DEVICE_DESCRIPTOR_TYPE 0x01
+#define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02
+#define USB_STRING_DESCRIPTOR_TYPE 0x03
+#define USB_INTERFACE_DESCRIPTOR_TYPE 0x04
+#define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05
+
+// descriptor types defined by DWG documents
+#define USB_RESERVED_DESCRIPTOR_TYPE 0x06
+#define USB_CONFIG_POWER_DESCRIPTOR_TYPE 0x07
+#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08
+
+#define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d<<8 | i))
+
+//
+// Values for bmAttributes field of an
+// endpoint descriptor
+//
+
+#define USB_ENDPOINT_TYPE_MASK 0x03
+
+#define USB_ENDPOINT_TYPE_CONTROL 0x00
+#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01
+#define USB_ENDPOINT_TYPE_BULK 0x02
+#define USB_ENDPOINT_TYPE_INTERRUPT 0x03
+
+
+//
+// definitions for bits in the bmAttributes field of a
+// configuration descriptor.
+//
+#define USB_CONFIG_POWERED_MASK 0xc0
+
+#define USB_CONFIG_BUS_POWERED 0x80
+#define USB_CONFIG_SELF_POWERED 0x40
+#define USB_CONFIG_REMOTE_WAKEUP 0x20
+
+//
+// Endpoint direction bit, stored in address
+//
+
+#define USB_ENDPOINT_DIRECTION_MASK 0x80
+
+// test direction bit in the bEndpointAddress field of
+// an endpoint descriptor.
+#define USB_ENDPOINT_DIRECTION_OUT(addr) (!((addr) & USB_ENDPOINT_DIRECTION_MASK))
+#define USB_ENDPOINT_DIRECTION_IN(addr) ((addr) & USB_ENDPOINT_DIRECTION_MASK)
+
+//
+// USB defined request codes
+// see chapter 9 of the USB 1.0 specifcation for
+// more information.
+//
+
+// These are the correct values based on the USB 1.0
+// specification
+
+#define USB_REQUEST_GET_STATUS 0x00
+#define USB_REQUEST_CLEAR_FEATURE 0x01
+
+#define USB_REQUEST_SET_FEATURE 0x03
+
+#define USB_REQUEST_SET_ADDRESS 0x05
+#define USB_REQUEST_GET_DESCRIPTOR 0x06
+#define USB_REQUEST_SET_DESCRIPTOR 0x07
+#define USB_REQUEST_GET_CONFIGURATION 0x08
+#define USB_REQUEST_SET_CONFIGURATION 0x09
+#define USB_REQUEST_GET_INTERFACE 0x0A
+#define USB_REQUEST_SET_INTERFACE 0x0B
+#define USB_REQUEST_SYNC_FRAME 0x0C
+
+
+//
+// defined USB device classes
+//
+
+
+#define USB_DEVICE_CLASS_RESERVED 0x00
+#define USB_DEVICE_CLASS_AUDIO 0x01
+#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
+#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
+#define USB_DEVICE_CLASS_MONITOR 0x04
+#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
+#define USB_DEVICE_CLASS_POWER 0x06
+#define USB_DEVICE_CLASS_PRINTER 0x07
+#define USB_DEVICE_CLASS_STORAGE 0x08
+#define USB_DEVICE_CLASS_HUB 0x09
+#define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF
+
+//
+// USB Core defined Feature selectors
+//
+
+#define USB_FEATURE_ENDPOINT_STALL 0x0000
+#define USB_FEATURE_REMOTE_WAKEUP 0x0001
+
+//
+// USB DWG defined Feature selectors
+//
+
+#define USB_FEATURE_INTERFACE_POWER_D0 0x0002
+#define USB_FEATURE_INTERFACE_POWER_D1 0x0003
+#define USB_FEATURE_INTERFACE_POWER_D2 0x0004
+#define USB_FEATURE_INTERFACE_POWER_D3 0x0005
+
+#if 0
+typedef struct _USB_DEVICE_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ USHORT bcdUSB;
+ UCHAR bDeviceClass;
+ UCHAR bDeviceSubClass;
+ UCHAR bDeviceProtocol;
+ UCHAR bMaxPacketSize0;
+ USHORT idVendor;
+ USHORT idProduct;
+ USHORT bcdDevice;
+ UCHAR iManufacturer;
+ UCHAR iProduct;
+ UCHAR iSerialNumber;
+ UCHAR bNumConfigurations;
+} USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR;
+
+typedef struct _USB_ENDPOINT_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bEndpointAddress;
+ UCHAR bmAttributes;
+ USHORT wMaxPacketSize;
+ UCHAR bInterval;
+} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR;
+
+typedef struct _USB_CONFIGURATION_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ USHORT wTotalLength;
+ UCHAR bNumInterfaces;
+ UCHAR bConfigurationValue;
+ UCHAR iConfiguration;
+ UCHAR bmAttributes;
+ UCHAR MaxPower;
+} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR;
+
+typedef struct _USB_INTERFACE_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bInterfaceNumber;
+ UCHAR bAlternateSetting;
+ UCHAR bNumEndpoints;
+ UCHAR bInterfaceClass;
+ UCHAR bInterfaceSubClass;
+ UCHAR bInterfaceProtocol;
+ UCHAR iInterface;
+} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR;
+
+typedef struct _USB_STRING_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ WCHAR bString[1];
+} USB_STRING_DESCRIPTOR, *PUSB_STRING_DESCRIPTOR;
+
+typedef struct _USB_COMMON_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+} USB_COMMON_DESCRIPTOR, *PUSB_COMMON_DESCRIPTOR;
+
+#endif
+
+//
+// Standard USB HUB definitions
+//
+// See Chapter 11 USB core specification
+//
+
+typedef struct _USB_HUB_DESCRIPTOR {
+ UCHAR bDescriptorLength; // Length of this descriptor
+ UCHAR bDescriptorType; // Hub configuration type
+ UCHAR bNumberOfPorts; // number of ports on this hub
+ USHORT wHubCharacteristics; // Hub Charateristics
+ UCHAR bPowerOnToPowerGood; // port power on till power good in 2ms
+ UCHAR bHubControlCurrent; // max current in mA
+ //
+ // room for 255 ports power control and removable bitmask
+ UCHAR bRemoveAndPowerMask[64];
+} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR;
+
+
+//
+// Structures defined by various DWG feature documents
+//
+
+
+//
+// See DWG USB Feature Specification: Interface Power Management
+//
+
+#define USB_SUPPORT_D0_COMMAND 0x01
+#define USB_SUPPORT_D1_COMMAND 0x02
+#define USB_SUPPORT_D2_COMMAND 0x04
+#define USB_SUPPORT_D3_COMMAND 0x08
+
+#define USB_SUPPORT_D1_WAKEUP 0x10
+#define USB_SUPPORT_D2_WAKEUP 0x20
+
+
+typedef struct _USB_CONFIGURATION_POWER_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR SelfPowerConsumedD0[3];
+ UCHAR bPowerSummaryId;
+ UCHAR bBusPowerSavingD1;
+ UCHAR bSelfPowerSavingD1;
+ UCHAR bBusPowerSavingD2;
+ UCHAR bSelfPowerSavingD2;
+ UCHAR bBusPowerSavingD3;
+ UCHAR bSelfPowerSavingD3;
+ USHORT TransitionTimeFromD1;
+ USHORT TransitionTimeFromD2;
+ USHORT TransitionTimeFromD3;
+} USB_CONFIGURATION_POWER_DESCRIPTOR, *PUSB_CONFIGURATION_POWER_DESCRIPTOR;
+
+
+typedef struct _USB_INTERFACE_POWER_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bmCapabilitiesFlags;
+ UCHAR bBusPowerSavingD1;
+ UCHAR bSelfPowerSavingD1;
+ UCHAR bBusPowerSavingD2;
+ UCHAR bSelfPowerSavingD2;
+ UCHAR bBusPowerSavingD3;
+ UCHAR bSelfPowerSavingD3;
+ USHORT TransitionTimeFromD1;
+ USHORT TransitionTimeFromD2;
+ USHORT TransitionTimeFromD3;
+} USB_INTERFACE_POWER_DESCRIPTOR, *PUSB_INTERFACE_POWER_DESCRIPTOR;
+
+
+#include <POPPACK.H>
+
+
+#endif /* __USB100_H__ */
+
diff --git a/include/qhy/usb200.h b/include/qhy/usb200.h new file mode 100644 index 0000000..06f3bfb --- /dev/null +++ b/include/qhy/usb200.h @@ -0,0 +1,111 @@ +#ifndef __USB200_H__
+#define __USB200_H__
+
+#include "usb100.h"
+
+
+#include <PSHPACK1.H>
+
+typedef enum _USB_DEVICE_SPEED {
+ UsbLowSpeed = 0,
+ UsbFullSpeed,
+ UsbHighSpeed
+} USB_DEVICE_SPEED;
+
+typedef enum _USB_DEVICE_TYPE {
+ Usb11Device = 0,
+ Usb20Device
+} USB_DEVICE_TYPE;
+
+// standard definiions for the port status
+// word of the HUB port register
+
+#define USB_PORT_STATUS_CONNECT 0x0001
+#define USB_PORT_STATUS_ENABLE 0x0002
+#define USB_PORT_STATUS_SUSPEND 0x0004
+#define USB_PORT_STATUS_OVER_CURRENT 0x0008
+#define USB_PORT_STATUS_RESET 0x0010
+#define USB_PORT_STATUS_POWER 0x0100
+#define USB_PORT_STATUS_LOW_SPEED 0x0200
+#define USB_PORT_STATUS_HIGH_SPEED 0x0400
+
+typedef union _BM_REQUEST_TYPE {
+ struct _BM {
+ UCHAR Recipient:2;
+ UCHAR Reserved:3;
+ UCHAR Type:2;
+ UCHAR Dir:1;
+ };
+ UCHAR B;
+} BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
+
+typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET {
+ BM_REQUEST_TYPE bmRequestType;
+ UCHAR bRequest;
+
+ union _wValue {
+ struct {
+ UCHAR LowByte;
+ UCHAR HiByte;
+ };
+ USHORT W;
+ } wValue;
+
+ union _wIndex {
+ struct {
+ UCHAR LowByte;
+ UCHAR HiByte;
+ };
+ USHORT W;
+ } wIndex;
+ USHORT wLength;
+} USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET;
+
+// setup packet is eight bytes -- defined by spec
+C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8);
+
+
+#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
+
+typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ USHORT bcdUSB;
+ UCHAR bDeviceClass;
+ UCHAR bDeviceSubClass;
+ UCHAR bDeviceProtocol;
+ UCHAR bMaxPacketSize0;
+ UCHAR bNumConfigurations;
+ UCHAR bReserved;
+} USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR;
+
+
+typedef union _USB_HIGH_SPEED_MAXPACKET {
+ struct _MP {
+ USHORT MaxPacket:11; /* 0..10 */
+ USHORT HSmux:2; /* 11..12 */
+ USHORT Reserved:3; /* 13..15 */
+ };
+ USHORT us;
+} USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;
+
+#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
+
+typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR {
+
+ UCHAR bLength;
+ UCHAR bDescriptorType;
+ UCHAR bFirstInterface;
+ UCHAR bInterfaceCount;
+ UCHAR bFunctionClass;
+ UCHAR bFunctionSubClass;
+ UCHAR bFunctionProtocol;
+ UCHAR iFunction;
+
+} USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR;
+
+
+#include <POPPACK.H>
+
+#endif __USB200_H__
+
diff --git a/include/qhy/virtualwdm.h b/include/qhy/virtualwdm.h new file mode 100644 index 0000000..2e48cf2 --- /dev/null +++ b/include/qhy/virtualwdm.h @@ -0,0 +1,52 @@ +/*
+ QHYCCD SDK
+
+ Copyright (c) 2014 QHYCCD.
+ All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The full GNU General Public License is included in this distribution in the
+ file called LICENSE.
+ */
+
+#include "qhybase.h"
+#include "stdint.h"
+
+#ifdef WIN32
+
+EXPORTC uint32_t STDCALL VirutalCamInit(qhyccd_handle *h);
+
+EXPORTC uint32_t STDCALL VirualCamRelease();
+
+EXPORTC uint32_t STDCALL VirualCamPlayVideoDevice(int32_t no);
+
+EXPORTC uint32_t STDCALL VirualCamPlayBuffer(uint8_t *buffer,uint32_t width,uint32_t height);
+
+EXPORTC uint32_t STDCALL VirualCamAddOverlay(bool on,uint8_t *buffer,uint32_t width,uint32_t height);
+
+EXPORTC uint32_t STDCALL VirualCamAddText(bool on,char *oltext,char *ftname,int32_t ftsize,int32_t ftstyle,int32_t ftcolor,int32_t bkcolor,int32_t px,int32_t py,int32_t bktype,int32_t whichone);
+
+EXPORTC uint32_t STDCALL VirualCamStopPlay();
+
+EXPORTC uint32_t STDCALL VirualCamChnageDefaultSettings(uint32_t fps,uint8_t videosize);
+
+EXPORTC uint32_t STDCALL VirtualCamGet_CurrentVideoDuration(uint32_t *duration);
+
+EXPORTC uint32_t STDCALL VirtualCamGet_CurrentVideoPosition(uint32_t *position);
+
+EXPORTC uint32_t STDCALL VirtualCamGet_IsPlaying(bool *isplaying);
+
+#endif
\ No newline at end of file diff --git a/include/qhy/vld.h b/include/qhy/vld.h new file mode 100644 index 0000000..2f574ad --- /dev/null +++ b/include/qhy/vld.h @@ -0,0 +1,346 @@ +////////////////////////////////////////////////////////////////////////////////
+//
+// Visual Leak Detector - Import Library Header
+// Copyright (c) 2005-2014 VLD Team
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+// See COPYING.txt for the full terms of the GNU Lesser General Public License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include "vld_def.h"
+
+typedef int VLD_BOOL;
+typedef unsigned int VLD_UINT;
+typedef size_t VLD_SIZET;
+typedef void* VLD_HMODULE;
+
+#if defined _DEBUG || defined VLD_FORCE_ENABLE
+
+#pragma comment(lib, "vld.lib")
+
+// Force a symbolic reference to the global VisualLeakDetector class object from
+// the DLL. This ensures that the DLL is loaded and linked with the program,
+// even if no code otherwise imports any of the DLL's exports.
+#pragma comment(linker, "/include:__imp_?g_vld@@3VVisualLeakDetector@@A")
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Visual Leak Detector APIs
+//
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+// VLDDisable - Disables Visual Leak Detector's memory leak detection at
+// runtime. If memory leak detection is already disabled, then calling this
+// function has no effect.
+//
+// Note: In multithreaded programs, this function operates on a per-thread
+// basis. In other words, if you call this function from one thread, then
+// memory leak detection is only disabled for that thread. If memory leak
+// detection is enabled for other threads, then it will remain enabled for
+// those other threads. It was designed to work this way to insulate you,
+// the programmer, from having to ensure thread synchronization when calling
+// VLDEnable() and VLDDisable(). Without this, calling these two functions
+// unsynchronized could result in unpredictable and unintended behavior.
+// But this also means that if you want to disable memory leak detection
+// process-wide, then you need to call this function from every thread in
+// the process.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDDisable ();
+
+// VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime.
+// If memory leak detection is already enabled, which it is by default, then
+// calling this function has no effect.
+//
+// Note: In multithreaded programs, this function operates on a per-thread
+// basis. In other words, if you call this function from one thread, then
+// memory leak detection is only enabled for that thread. If memory leak
+// detection is disabled for other threads, then it will remain disabled for
+// those other threads. It was designed to work this way to insulate you,
+// the programmer, from having to ensure thread synchronization when calling
+// VLDEnable() and VLDDisable(). Without this, calling these two functions
+// unsynchronized could result in unpredictable and unintended behavior.
+// But this also means that if you want to enable memory leak detection
+// process-wide, then you need to call this function from every thread in
+// the process.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDEnable ();
+
+// VLDRestore - Restore Visual Leak Detector's previous state.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDRestore ();
+
+// VLDGlobalDisable - Disables Visual Leak Detector's memory leak detection at
+// runtime in all threads. If memory leak detection is already disabled,
+// then calling this function has no effect.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDGlobalDisable ();
+
+// VLDGlobalEnable - Enables Visual Leak Detector's memory leak detection
+// at runtime in all threads. If memory leak detection is already enabled,
+// which it is by default, then calling this function has no effect.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDGlobalEnable ();
+
+// VLDReportLeaks - Report leaks up to the execution point.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) VLD_UINT VLDReportLeaks ();
+
+// VLDReportThreadLeaks - Report thread leaks up to the execution point.
+//
+// threadId: thread Id.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) VLD_UINT VLDReportThreadLeaks (VLD_UINT threadId);
+
+// VLDGetLeaksCount - Return memory leaks count to the execution point.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) VLD_UINT VLDGetLeaksCount ();
+
+// VLDGetThreadLeaksCount - Return thread memory leaks count to the execution point.
+//
+// threadId: thread Id.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) VLD_UINT VLDGetThreadLeaksCount (VLD_UINT threadId);
+
+// VLDMarkAllLeaksAsReported - Mark all leaks as reported.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDMarkAllLeaksAsReported ();
+
+// VLDMarkThreadLeaksAsReported - Mark thread leaks as reported.
+//
+// threadId: thread Id.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDMarkThreadLeaksAsReported (VLD_UINT threadId);
+
+
+// VLDRefreshModules - Look for recently loaded DLLs and patch them if necessary.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDRefreshModules();
+
+
+// VLDEnableModule - Enable Memory leak checking on the specified module.
+//
+// module: module handle.
+//
+// Return Value:
+//
+// None.
+//
+
+__declspec(dllimport) void VLDEnableModule(VLD_HMODULE module);
+
+
+// VLDDisableModule - Disable Memory leak checking on the specified module.
+//
+// module: module handle.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDDisableModule(VLD_HMODULE module);
+
+// VLDGetOptions - Return all current options.
+//
+// Return Value:
+//
+// Mask of current options.
+//
+__declspec(dllimport) VLD_UINT VLDGetOptions();
+
+// VLDGetReportFilename - Return current report filename.
+//
+// filename: current report filename (max characters - MAX_PATH).
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDGetReportFilename(wchar_t *filename);
+
+// VLDSetOptions - Update the report options via function call rather than INI file.
+//
+// option_mask: Only the following flags are checked
+// VLD_OPT_AGGREGATE_DUPLICATES
+// VLD_OPT_MODULE_LIST_INCLUDE
+// VLD_OPT_SAFE_STACK_WALK
+// VLD_OPT_SLOW_DEBUGGER_DUMP
+// VLD_OPT_TRACE_INTERNAL_FRAMES
+// VLD_OPT_START_DISABLED
+// VLD_OPT_SKIP_HEAPFREE_LEAKS
+// VLD_OPT_VALIDATE_HEAPFREE
+//
+// maxDataDump: maximum number of user-data bytes to dump for each leaked block.
+//
+// maxTraceFrames: maximum number of frames per stack trace for each leaked block.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDSetOptions(VLD_UINT option_mask, VLD_SIZET maxDataDump, VLD_UINT maxTraceFrames);
+
+// VLDSetModulesList - Set list of modules included/excluded in leak detection
+// depending on parameter "includeModules".
+//
+// modules: list of modules to be forcefully included/excluded in leak detection.
+//
+// includeModules: include or exclude that modules.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDSetModulesList(const wchar_t *modules, VLD_BOOL includeModules);
+
+// VLDGetModulesList - Return current list of included/excluded modules
+// depending on flag VLD_OPT_TRACE_INTERNAL_FRAMES.
+//
+// modules: destination string for list of included/excluded modules (maximum length 512 characters).
+//
+// size: maximum string size.
+//
+// Return Value:
+//
+// VLD_BOOL: TRUE if include modules, otherwise FALSE.
+//
+__declspec(dllimport) VLD_BOOL VLDGetModulesList(wchar_t *modules, VLD_UINT size);
+
+// VLDSetReportOptions - Update the report options via function call rather than INI file.
+//
+// Only the following flags are checked
+// VLD_OPT_REPORT_TO_DEBUGGER
+// VLD_OPT_REPORT_TO_FILE
+// VLD_OPT_REPORT_TO_STDOUT
+// VLD_OPT_UNICODE_REPORT
+//
+// filename is optional and can be NULL.
+//
+// Return Value:
+//
+// None.
+//
+__declspec(dllimport) void VLDSetReportOptions(VLD_UINT option_mask, const wchar_t *filename);
+
+// VLDSetReportHook - Installs or uninstalls a client-defined reporting function by hooking it
+// into the C run-time debug reporting process (debug version only).
+//
+// mode: The action to take: VLD_RPTHOOK_INSTALL or VLD_RPTHOOK_REMOVE.
+//
+// pfnNewHook: Report hook to install or remove.
+//
+// Return Value:
+//
+// int: 0 if success.
+//
+__declspec(dllimport) int VLDSetReportHook(int mode, VLD_REPORT_HOOK pfnNewHook);
+
+// VLDResolveCallstacks - Performs symbol resolution for all saved extent CallStack's that have
+// been tracked by Visual Leak Detector. This function is necessary for applications that
+// dynamically load and unload modules, and through which memory leaks might be included.
+// If this is NOT called, stack traces may have stack frames with no symbol information. This
+// happens because the symbol API's cannot look up symbols for a binary / module that has been unloaded
+// from the process.
+//
+// Return Value:
+//
+// int: 0 if successfully resolved all callstacks.
+//
+__declspec(dllexport) int VLDResolveCallstacks();
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#else // !_DEBUG
+
+#define VLDEnable()
+#define VLDDisable()
+#define VLDRestore()
+#define VLDGlobalDisable()
+#define VLDGlobalEnable()
+#define VLDReportLeaks() (0)
+#define VLDReportThreadLeaks() (0)
+#define VLDGetLeaksCount() (0)
+#define VLDGetThreadLeaksCount() (0)
+#define VLDMarkAllLeaksAsReported()
+#define VLDMarkThreadLeaksAsReported(a)
+#define VLDRefreshModules()
+#define VLDEnableModule(a)
+#define VLDDisableModule(b)
+#define VLDGetOptions() (0)
+#define VLDGetReportFilename(a)
+#define VLDSetOptions(a, b, c)
+#define VLDSetReportHook(a, b)
+#define VLDSetModulesList(a)
+#define VLDGetModulesList(a, b) (FALSE)
+#define VLDSetReportOptions(a, b)
+#define VLDResolveCallstacks() (0)
+
+#endif // _DEBUG
diff --git a/include/qhy/vld_def.h b/include/qhy/vld_def.h new file mode 100644 index 0000000..a8d0a67 --- /dev/null +++ b/include/qhy/vld_def.h @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////////////////////////////////
+//
+// Visual Leak Detector - Import Library Header
+// Copyright (c) 2005-2014 VLD Team
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+// See COPYING.txt for the full terms of the GNU Lesser General Public License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include <wchar.h>
+
+#define VLD_OPT_AGGREGATE_DUPLICATES 0x0001 // If set, aggregate duplicate leaks in the leak report.
+#define VLD_OPT_MODULE_LIST_INCLUDE 0x0002 // If set, modules in the module list are included, all others are excluded.
+#define VLD_OPT_REPORT_TO_DEBUGGER 0x0004 // If set, the memory leak report is sent to the debugger.
+#define VLD_OPT_REPORT_TO_FILE 0x0008 // If set, the memory leak report is sent to a file.
+#define VLD_OPT_SAFE_STACK_WALK 0x0010 // If set, the stack is walked using the "safe" method (StackWalk64).
+#define VLD_OPT_SELF_TEST 0x0020 // If set, perform a self-test to verify memory leak self-checking.
+#define VLD_OPT_SLOW_DEBUGGER_DUMP 0x0040 // If set, inserts a slight delay between sending output to the debugger.
+#define VLD_OPT_START_DISABLED 0x0080 // If set, memory leak detection will initially disabled.
+#define VLD_OPT_TRACE_INTERNAL_FRAMES 0x0100 // If set, include useless frames (e.g. internal to VLD) in call stacks.
+#define VLD_OPT_UNICODE_REPORT 0x0200 // If set, the leak report will be encoded UTF-16 instead of ASCII.
+#define VLD_OPT_VLDOFF 0x0400 // If set, VLD will be completely deactivated. It will not attach to any modules.
+#define VLD_OPT_REPORT_TO_STDOUT 0x0800 // If set, the memory leak report is sent to stdout.
+#define VLD_OPT_SKIP_HEAPFREE_LEAKS 0x1000 // If set, VLD skip HeapFree memory leaks.
+#define VLD_OPT_VALIDATE_HEAPFREE 0x2000 // If set, VLD verifies and reports heap consistency for HeapFree calls.
+#define VLD_OPT_SKIP_CRTSTARTUP_LEAKS 0x4000 // If set, VLD skip crt srtartup memory leaks.
+
+#define VLD_RPTHOOK_INSTALL 0
+#define VLD_RPTHOOK_REMOVE 1
+
+typedef int (__cdecl * VLD_REPORT_HOOK)(int reportType, wchar_t *message, int *returnValue);
diff --git a/include/qhy/winusb.h b/include/qhy/winusb.h new file mode 100644 index 0000000..0c8db70 --- /dev/null +++ b/include/qhy/winusb.h @@ -0,0 +1,253 @@ +/*++
+
+Copyright (c) 2002 Microsoft Corporation
+
+Module Name:
+
+ wusb.h
+
+Abstract:
+
+ Public interface to winusb.dll
+
+Environment:
+
+ Kernel Mode Only
+
+Notes:
+
+ THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
+ PURPOSE.
+
+ Copyright (c) 2001 Microsoft Corporation. All Rights Reserved.
+
+
+Revision History:
+
+ 11/19/2002 : created
+
+Authors:
+
+--*/
+
+#ifndef __WUSB_H__
+#define __WUSB_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if(NTDDI_VERSION >= NTDDI_WINXP)
+
+#include "winusbio.h"
+
+
+typedef PVOID WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE;
+
+
+#pragma pack(1)
+
+typedef struct _WINUSB_SETUP_PACKET {
+ UCHAR RequestType;
+ UCHAR Request;
+ USHORT Value;
+ USHORT Index;
+ USHORT Length;
+} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET;
+
+#pragma pack()
+
+
+
+BOOL __stdcall
+WinUsb_Initialize(
+ __in HANDLE DeviceHandle,
+ __out PWINUSB_INTERFACE_HANDLE InterfaceHandle
+ );
+
+
+BOOL __stdcall
+WinUsb_Free(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle
+ );
+
+
+BOOL __stdcall
+WinUsb_GetAssociatedInterface(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR AssociatedInterfaceIndex,
+ __out PWINUSB_INTERFACE_HANDLE AssociatedInterfaceHandle
+ );
+
+
+
+BOOL __stdcall
+WinUsb_GetDescriptor(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR DescriptorType,
+ __in UCHAR Index,
+ __in USHORT LanguageID,
+ __out_bcount_part_opt(BufferLength, *LengthTransferred) PUCHAR Buffer,
+ __in ULONG BufferLength,
+ __out PULONG LengthTransferred
+ );
+
+BOOL __stdcall
+WinUsb_QueryInterfaceSettings(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR AlternateInterfaceNumber,
+ __out PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor
+ );
+
+BOOL __stdcall
+WinUsb_QueryDeviceInformation(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in ULONG InformationType,
+ __inout PULONG BufferLength,
+ __out_bcount(*BufferLength) PVOID Buffer
+ );
+
+BOOL __stdcall
+WinUsb_SetCurrentAlternateSetting(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR SettingNumber
+ );
+
+BOOL __stdcall
+WinUsb_GetCurrentAlternateSetting(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __out PUCHAR SettingNumber
+ );
+
+
+BOOL __stdcall
+WinUsb_QueryPipe(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR AlternateInterfaceNumber,
+ __in UCHAR PipeIndex,
+ __out PWINUSB_PIPE_INFORMATION PipeInformation
+ );
+
+
+BOOL __stdcall
+WinUsb_SetPipePolicy(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID,
+ __in ULONG PolicyType,
+ __in ULONG ValueLength,
+ __in_bcount(ValueLength) PVOID Value
+ );
+
+BOOL __stdcall
+WinUsb_GetPipePolicy(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID,
+ __in ULONG PolicyType,
+ __inout PULONG ValueLength,
+ __out_bcount(*ValueLength) PVOID Value
+ );
+
+BOOL __stdcall
+WinUsb_ReadPipe(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID,
+ __out_bcount_part_opt(BufferLength,*LengthTransferred) PUCHAR Buffer,
+ __in ULONG BufferLength,
+ __out_opt PULONG LengthTransferred,
+ __in_opt LPOVERLAPPED Overlapped
+ );
+
+BOOL __stdcall
+WinUsb_WritePipe(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID,
+ __in_bcount(BufferLength) PUCHAR Buffer,
+ __in ULONG BufferLength,
+ __out_opt PULONG LengthTransferred,
+ __in_opt LPOVERLAPPED Overlapped
+ );
+
+BOOL __stdcall
+WinUsb_ControlTransfer(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in WINUSB_SETUP_PACKET SetupPacket,
+ __out_bcount_part_opt(BufferLength, *LengthTransferred) PUCHAR Buffer,
+ __in ULONG BufferLength,
+ __out_opt PULONG LengthTransferred,
+ __in_opt LPOVERLAPPED Overlapped
+ );
+
+BOOL __stdcall
+WinUsb_ResetPipe(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID
+ );
+
+BOOL __stdcall
+WinUsb_AbortPipe(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID
+ );
+
+BOOL __stdcall
+WinUsb_FlushPipe(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in UCHAR PipeID
+ );
+
+BOOL __stdcall
+WinUsb_SetPowerPolicy(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in ULONG PolicyType,
+ __in ULONG ValueLength,
+ __in_bcount(ValueLength) PVOID Value
+ );
+
+BOOL __stdcall
+WinUsb_GetPowerPolicy(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in ULONG PolicyType,
+ __inout PULONG ValueLength,
+ __out_bcount(*ValueLength) PVOID Value
+ );
+
+BOOL __stdcall
+WinUsb_GetOverlappedResult(
+ __in WINUSB_INTERFACE_HANDLE InterfaceHandle,
+ __in LPOVERLAPPED lpOverlapped,
+ __out LPDWORD lpNumberOfBytesTransferred,
+ __in BOOL bWait
+ );
+
+
+PUSB_INTERFACE_DESCRIPTOR __stdcall
+WinUsb_ParseConfigurationDescriptor(
+ __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
+ __in PVOID StartPosition,
+ __in LONG InterfaceNumber,
+ __in LONG AlternateSetting,
+ __in LONG InterfaceClass,
+ __in LONG InterfaceSubClass,
+ __in LONG InterfaceProtocol
+ );
+
+PUSB_COMMON_DESCRIPTOR __stdcall
+WinUsb_ParseDescriptors(
+ __in_bcount(TotalLength) PVOID DescriptorBuffer,
+ __in ULONG TotalLength,
+ __in PVOID StartPosition,
+ __in LONG DescriptorType
+ );
+
+
+#endif // (NTDDI_VERSION >= NTDDI_WINXP)
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif //__WUSB_H__
+
diff --git a/include/qhy/winusbio.h b/include/qhy/winusbio.h new file mode 100644 index 0000000..6c10fc4 --- /dev/null +++ b/include/qhy/winusbio.h @@ -0,0 +1,85 @@ +/***************************************************************************
+
+Copyright (c) 2002 Microsoft Corporation
+
+Module Name:
+
+ wusbio.h
+
+Abstract:
+
+ Public header for WINUSB
+
+Environment:
+
+ User and Kernel Mode
+
+Notes:
+
+ THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
+ PURPOSE.
+
+ Copyright (c) 2001 Microsoft Corporation. All Rights Reserved.
+
+
+Revision History:
+
+ 11/12/2002 : created
+
+
+****************************************************************************/
+
+#ifndef __WUSBIO_H__
+#define __WUSBIO_H__
+
+#if(NTDDI_VERSION >= NTDDI_WINXP)
+
+#include "usb.h"
+
+// Pipe policy types
+#define SHORT_PACKET_TERMINATE 0x01
+#define AUTO_CLEAR_STALL 0x02
+#define PIPE_TRANSFER_TIMEOUT 0x03
+#define IGNORE_SHORT_PACKETS 0x04
+#define ALLOW_PARTIAL_READS 0x05
+#define AUTO_FLUSH 0x06
+#define RAW_IO 0x07
+#define MAXIMUM_TRANSFER_SIZE 0x08
+#define RESET_PIPE_ON_RESUME 0x09
+
+// Power policy types
+//
+// Add 0x80 for Power policy types in order to prevent overlap with
+// Pipe policy types to prevent "accidentally" setting the wrong value for the
+// wrong type.
+//
+#define AUTO_SUSPEND 0x81
+#define SUSPEND_DELAY 0x83
+
+// Device Information types
+#define DEVICE_SPEED 0x01
+
+// Device Speeds
+#define LowSpeed 0x01
+#define FullSpeed 0x02
+#define HighSpeed 0x03
+
+// {DA812BFF-12C3-46a2-8E2B-DBD3B7834C43}
+#include <initguid.h>
+DEFINE_GUID(WinUSB_TestGuid, 0xda812bff, 0x12c3, 0x46a2, 0x8e, 0x2b, 0xdb, 0xd3, 0xb7, 0x83, 0x4c, 0x43);
+
+
+typedef struct _WINUSB_PIPE_INFORMATION {
+ USBD_PIPE_TYPE PipeType;
+ UCHAR PipeId;
+ USHORT MaximumPacketSize;
+ UCHAR Interval;
+} WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION;
+
+#endif // (NTDDI_VERSION >= NTDDI_WINXP)
+
+#endif // __WUSBIO_H__
+
+
|