From 9a607474bdd66dd716635cfed7f2c832c39b4523 Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Thu, 14 Mar 2019 15:52:30 -0700 Subject: add qhy headers......... --- include/qhy/QUsb.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 include/qhy/QUsb.h (limited to 'include/qhy/QUsb.h') 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 -- cgit v1.1