diff options
| author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2019-03-14 15:52:30 -0700 | 
|---|---|---|
| committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2019-03-14 15:52:30 -0700 | 
| commit | 9a607474bdd66dd716635cfed7f2c832c39b4523 (patch) | |
| tree | c5f65b4cecd6376a3b99646679f9714d5f9213a2 /include/qhy/QUsb.h | |
| parent | ac7604616ab2e44ad12a9d8d5dd90dec15feb5cc (diff) | |
add qhy headers.........
Diffstat (limited to 'include/qhy/QUsb.h')
| -rw-r--r-- | include/qhy/QUsb.h | 75 | 
1 files changed, 75 insertions, 0 deletions
| 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
 | 
