-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdata_struct.h
76 lines (63 loc) · 1.5 KB
/
data_struct.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
67
68
69
70
71
72
73
74
75
76
#ifndef DATA_STRUCT_H
#define DATA_STRUCT_H
#include <QtGlobal>
#define PKG_SIZE 512 /*In bytes*/
#define CodeVERSION 1
//sizeof(struct DSPmem_t)
//sizeof(struct DSPmem_t)
#include "global_defines.h"
struct lowspeed_t{
float temp;
qint32 reserved1; // Replace with real signal
qint32 reserved2;
qint32 reserved3;
qint32 reserved4;
qint32 reserved5;
qint32 reserved6;
qint32 reserved7;
qint32 reserved8;
qint32 reserved9;
qint32 reserved10;
};
struct midspeed_vecotr_t{
qint32 pos[PKG_SIZE/32];
qint32 vel[PKG_SIZE/32];
qint32 perror[PKG_SIZE/32];
qint32 reserved1[PKG_SIZE/32];
qint32 reserved2[PKG_SIZE/32];
qint32 reserved3[PKG_SIZE/32];
qint32 reserved4[PKG_SIZE/32];
};
struct blockC_t{
quint64 checknumber; //1-2
quint32 version; //3
quint32 index; //4
float temp; //5
qint32 states; //6;
qint32 DSPload; //6;
quint32 reserved[16-7]; // UPDATE if new line is inserted
};
//512 bytes
union block_t{
blockC_t lowSpeed;
qint32 samples[PKG_SIZE/4];
};
struct hispeed_vector_t{
qint32 IA[PKG_SIZE/4];
qint32 IC[PKG_SIZE/4];
qint32 QE[PKG_SIZE/4];
qint32 Torque[PKG_SIZE/4];
qint32 Flux[PKG_SIZE/4];
qint32 U[PKG_SIZE/4];
qint32 angle[PKG_SIZE/4];
};
struct USBmem_t{
quint64 checknumber; //2
quint32 version; //3
quint32 index; //4
float temp; //5
quint32 reserved[16-5];
struct midspeed_vecotr_t mid;
struct hispeed_vector_t fast;
};
#endif // DATA_STRUCT_H