-
Notifications
You must be signed in to change notification settings - Fork 1
/
cp2112.h
66 lines (55 loc) · 1.24 KB
/
cp2112.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
63
64
65
66
#ifndef CP2112_H
#define CP2112_H
#include "types.h"
#include "Library\Windows\SLABCP2112.h"
#include "qglobal.h"
#include <QString>
#include <QVariant>
#define VID 0x10C4
#define PID 0xEA90
enum STATUS
{
STATUS_FAIL,
STATUS_OK,
DEVICE_READY,
DEVICE_NOT_ANWERED,
TRANSFER_IN_PROGRESS,
TRANSFER_COMPLETED,
};
enum CONDITION
{
CONNECTED,
SERIAL,
MANUFACTURER,
PRODUCT,
SPEED
};
//Объявим структуру для параметров
struct config
{
QVariant defaultData;
QVariant userData;
};
enum
{
Bitrate,
ACK_Address,
Auto_Respond,
Write_Timeout,
Read_Timeout,
Transfer_Retries,
SCL_Low_Timeout,
Response_Timeout,
RX_TX_Leds_On,
};
//Сделаем видимым для остальных массив, который инициализирован в cp2112.cpp
extern config cp2112config[];
extern quint8 numcp2112config;
STATUS CP2112_Init(HID_SMBUS_DEVICE *device, QString cond[]);
quint8 CP2112_Close(HID_SMBUS_DEVICE device, QString *str);
QString CP2112_Error_Handler (HID_SMBUS_STATUS status);
void CP2112_Clear_Condition(QString cond[]);
void readINI ();
void writeINI ();
QVariant getDataFromString (QString str, bool *ok);
#endif // CP2112_H