forked from amintronic/opticalFlowLK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quad_board.h
65 lines (39 loc) · 865 Bytes
/
quad_board.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
#ifndef QUAD_BOARD_H
#define QUAD_BOARD_H
#ifndef QUAD_BOARD
#define QUAD_BOARD
#include <QObject>
#include "QSerialPort"
#include "QSerialPortInfo"
class Quad_Board : public QObject
{
Q_OBJECT
public:
explicit Quad_Board(QObject *parent = 0);
~Quad_Board();
void decode(uchar data);
void Empty_Data();
void Fill_Data(uchar num , ... );
void Send_Data();
union _ch2int
{
int16_t real;
char byte[2];
};
typedef union _ch2int ch2int;
private:
bool ready;
char decode_stage;
char sum;
char received_packet_length;
int integer_received_counter;
int data_num;
int data_recieved[32];
QByteArray data_send;
uchar Num;
uchar check_Sum;
QSerialPort *serial_port;
ch2int conv;
};
#endif // QUAD_BOARD
#endif // QUAD_BOARD_H