Files
Rennbahn/hardwaresetup.h

58 lines
1.1 KiB
C++

#ifndef HARDWARESETUP_H
#define HARDWARESETUP_H
#include <QtCore>
#include <memory>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#ifdef ATMEGA
#include <libusb.h>
#endif
struct TransStruct {
uint16_t time;
uint8_t id;
uint8_t update;
};
struct TransCheck {
char begin;
struct TransStruct data[6];
char end;
};
class HardwareSetup : public QThread {
Q_OBJECT
protected:
void run();
private:
bool shellBefore;
bool deaBefore;
#ifdef ATMEGA
libusb_device_handle * handle;
libusb_context * usbContext;
int usbGetDescriptorString(libusb_device_handle * dev, int index,
int langid, char * buf, int buflen);
libusb_device_handle * usbOpenDevice(int vendor, int product);
#endif
int fd;
void connectSTM32();
bool getShell();
bool getDea();
int * findBit(int * array, int zahl);
bool stop;
public:
void setStop();
~HardwareSetup();
HardwareSetup();
signals:
void Shell(int, int);
void Dea(int, int);
};
#endif // HARDWARESETUP_H