2016-09-07 07:36:43 +01:00
|
|
|
#ifndef WINUSBDRIVER_H
|
|
|
|
#define WINUSBDRIVER_H
|
|
|
|
|
2016-10-20 02:54:05 +01:00
|
|
|
//libusbK includes
|
|
|
|
#include <windows.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <conio.h>
|
|
|
|
#include "libusbk.h"
|
|
|
|
|
2016-10-17 23:44:58 +01:00
|
|
|
#include "genericusbdriver.h"
|
2016-09-07 07:36:43 +01:00
|
|
|
|
2016-10-17 23:44:58 +01:00
|
|
|
class winUsbDriver : public genericUsbDriver
|
2016-09-07 07:36:43 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-10-17 02:53:44 +01:00
|
|
|
//Generic Functions
|
|
|
|
explicit winUsbDriver(QWidget *parent = 0);
|
|
|
|
~winUsbDriver();
|
2016-10-17 23:44:58 +01:00
|
|
|
void usbSendControl(int RequestType, int Request, int Value, int Index, int Length, unsigned char *LDATA);
|
|
|
|
char *isoRead(unsigned int *newLength);
|
2016-09-07 07:36:43 +01:00
|
|
|
private:
|
2016-10-17 02:53:44 +01:00
|
|
|
//USB Vars
|
|
|
|
KUSB_HANDLE handle = NULL;
|
|
|
|
unsigned char pipeID = 0x83;
|
|
|
|
//USBIso Vars
|
2016-10-13 23:17:00 +01:00
|
|
|
PKISO_CONTEXT isoCtx[NUM_FUTURE_CTX];
|
|
|
|
KOVL_HANDLE ovlkHandle[NUM_FUTURE_CTX];
|
|
|
|
KOVL_POOL_HANDLE ovlPool;
|
|
|
|
unsigned char dataBuffer[NUM_FUTURE_CTX][ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX];
|
|
|
|
QTimer *isoTimer;
|
2016-10-14 00:27:17 +01:00
|
|
|
unsigned char currentWriteBuffer = 0;
|
2016-10-13 23:17:00 +01:00
|
|
|
unsigned long timerCount = 0;
|
2016-10-17 02:53:44 +01:00
|
|
|
//Generic Functions
|
2016-10-20 02:54:05 +01:00
|
|
|
unsigned char usbInit(unsigned long VIDin, unsigned long PIDin);
|
2016-10-17 02:53:44 +01:00
|
|
|
unsigned char usbIsoInit(void);
|
2016-09-07 07:36:43 +01:00
|
|
|
signals:
|
|
|
|
public slots:
|
2016-10-13 23:17:00 +01:00
|
|
|
void isoTimerTick(void);
|
2016-09-07 07:36:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WINUSBDRIVER_H
|