-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathftdii2cinterface.h
62 lines (46 loc) · 1.33 KB
/
ftdii2cinterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef FTDII2CINTERFACE_H
#define FTDII2CINTERFACE_H
#include <QWaitCondition>
#include <QMutex>
#include <QByteArray>
#include <QStringList>
#include "i2cportinterface.h"
#include "ftdiinterfaceprovider.h"
class FtdiI2cInterface : public I2cPortInterface
{
QByteArray inputBuffer;
FtdiInterfaceProvider* prov;
QString reasonText;
public:
FtdiI2cInterface(FtdiInterfaceProvider* prov);
bool open();
void close();
void checkAsk(bool a);
void writeNow (unsigned char adr,QByteArray data);
QByteArray readNow (unsigned char adr,unsigned int size);
QByteArray writeReadNow (unsigned char adr,QByteArray data ,unsigned int size);
bool isOk();
void addWrite (unsigned char adr,QByteArray data) {};
void addRead (unsigned char adr,unsigned int size) {};
void addStop() {};
void addWait(int time) {};
bool preform() {};
int getBufferLength() {};
QByteArray getBuffer() {};
virtual bool isAvable()
{
return true;
}
virtual QString name() {return "FTDII2C";}
virtual QString description() {return QObject::tr("I2C over FTDI chip");}
virtual QString reason()
{
return reasonText;
}
bool load();
void unload();
void setPortName(QString n);
QString getPortName();
QStringList getPortList();
};
#endif // FTDII2CINTERFACE_H