JY901.h
Go to the documentation of this file.
1 #ifndef JY901_h
2 #define JY901_h
3 #include <time.h>
4 
5 #define SAVE 0x00
6 #define CALSW 0x01
7 #define RSW 0x02
8 #define RRATE 0x03
9 #define BAUD 0x04
10 #define AXOFFSET 0x05
11 #define AYOFFSET 0x06
12 #define AZOFFSET 0x07
13 #define GXOFFSET 0x08
14 #define GYOFFSET 0x09
15 #define GZOFFSET 0x0a
16 #define HXOFFSET 0x0b
17 #define HYOFFSET 0x0c
18 #define HZOFFSET 0x0d
19 #define D0MODE 0x0e
20 #define D1MODE 0x0f
21 #define D2MODE 0x10
22 #define D3MODE 0x11
23 #define D0PWMH 0x12
24 #define D1PWMH 0x13
25 #define D2PWMH 0x14
26 #define D3PWMH 0x15
27 #define D0PWMT 0x16
28 #define D1PWMT 0x17
29 #define D2PWMT 0x18
30 #define D3PWMT 0x19
31 #define IICADDR 0x1a
32 #define LEDOFF 0x1b
33 #define GPSBAUD 0x1c
34 
35 #define YYMM 0x30
36 #define DDHH 0x31
37 #define MMSS 0x32
38 #define MS 0x33
39 #define AX 0x34
40 #define AY 0x35
41 #define AZ 0x36
42 #define GX 0x37
43 #define GY 0x38
44 #define GZ 0x39
45 #define HX 0x3a
46 #define HY 0x3b
47 #define HZ 0x3c
48 #define Roll 0x3d
49 #define Pitch 0x3e
50 #define Yaw 0x3f
51 #define TEMP 0x40
52 #define D0Status 0x41
53 #define D1Status 0x42
54 #define D2Status 0x43
55 #define D3Status 0x44
56 #define PressureL 0x45
57 #define PressureH 0x46
58 #define HeightL 0x47
59 #define HeightH 0x48
60 #define LonL 0x49
61 #define LonH 0x4a
62 #define LatL 0x4b
63 #define LatH 0x4c
64 #define GPSHeight 0x4d
65 #define GPSYAW 0x4e
66 #define GPSVL 0x4f
67 #define GPSVH 0x50
68 
69 #define DIO_MODE_AIN 0
70 #define DIO_MODE_DIN 1
71 #define DIO_MODE_DOH 2
72 #define DIO_MODE_DOL 3
73 #define DIO_MODE_DOPWM 4
74 #define DIO_MODE_GPS 5
75 
76 struct S_Time
77 {
78  unsigned char ucYear;
79  unsigned char ucMonth;
80  unsigned char ucDay;
81  unsigned char ucHour;
82  unsigned char ucMinute;
83  unsigned char ucSecond;
84  unsigned short usMiliSecond;
85 };
86 
87 struct S_Acc
88 {
89  short a[3];
90  short T;
91 };
92 
93 struct S_Gyro
94 {
95  short w[3];
96  short T;
97 };
98 
99 struct S_Angle
100 {
101  short Angle[3];
102  short T;
103 };
104 
105 struct S_Mag
106 {
107  short h[3];
108  short T;
109 };
110 
111 // struct SDStatus
112 // {
113 // short sDStatus[4];
114 // };
115 
116 // struct SPress
117 // {
118 // long lPressure;
119 // long lAltitude;
120 // };
121 
122 // struct SLonLat
123 // {
124 // unsigned long lLon;
125 // unsigned long lLat;
126 // };
127 
128 // struct SGPSV
129 // {
130 // short sGPSHeight;
131 // short sGPSYaw;
132 // long lGPSVelocity;
133 // };
134 
135 struct S_Quat
136 {
137  short q[4];
138 };
139 
140 struct Time
141 {
142  int year;
143  int month;
144  int day;
145  int hour;
146  int min;
147  int sec;
148  time_t utc;
149 };
150 
151 struct Acc
152 {
153  double x;
154  double y;
155  double z;
156 };
157 
158 struct Gyro
159 {
160  double x;
161  double y;
162  double z;
163 };
164 
165 struct Angle
166 {
167  double r;
168  double p;
169  double y;
170 };
171 
172 struct Mag
173 {
174  double x;
175  double y;
176  double z;
177 };
178 
179 struct Quat
180 {
181  double x;
182  double y;
183  double z;
184  double w;
185 };
186 
187 class CJY901
188 {
189 public:
190  struct Time time;
191  struct Acc acc;
196 
197  CJY901();
198  void FetchData(char *data, int usLength);
199 
200 private:
201  struct S_Time stcTime;
202  struct S_Acc stcAcc;
203  struct S_Gyro stcGyro;
204  struct S_Angle stcAngle;
205  struct S_Mag stcMag;
206  // struct SDStatus stcDStatus;
207  // struct SPress stcPress;
208  // struct SLonLat stcLonLat;
209  // struct SGPSV stcGPSV;
210  struct S_Quat stcQuat;
211 };
212 #endif
Gyro gyro
Definition: JY901.h:192
Angle angle
Definition: JY901.h:193
double z
Definition: JY901.h:162
short T
Definition: JY901.h:102
double z
Definition: JY901.h:155
unsigned char ucHour
Definition: JY901.h:81
Definition: JY901.h:135
unsigned char ucMonth
Definition: JY901.h:79
Definition: JY901.h:99
int sec
Definition: JY901.h:147
unsigned char ucDay
Definition: JY901.h:80
int min
Definition: JY901.h:146
double p
Definition: JY901.h:168
double x
Definition: JY901.h:174
double x
Definition: JY901.h:153
double z
Definition: JY901.h:176
Definition: JY901.h:105
unsigned short usMiliSecond
Definition: JY901.h:84
unsigned char ucYear
Definition: JY901.h:78
Definition: JY901.h:158
unsigned char ucMinute
Definition: JY901.h:82
int hour
Definition: JY901.h:145
double y
Definition: JY901.h:182
double w
Definition: JY901.h:184
int year
Definition: JY901.h:142
double y
Definition: JY901.h:175
double x
Definition: JY901.h:181
short T
Definition: JY901.h:108
short T
Definition: JY901.h:96
double z
Definition: JY901.h:183
double x
Definition: JY901.h:160
double y
Definition: JY901.h:161
Definition: JY901.h:151
time_t utc
Definition: JY901.h:148
double r
Definition: JY901.h:167
Mag mag
Definition: JY901.h:194
Definition: JY901.h:93
Definition: JY901.h:76
Definition: JY901.h:165
Definition: JY901.h:179
Quat quat
Definition: JY901.h:195
int month
Definition: JY901.h:143
short T
Definition: JY901.h:90
double y
Definition: JY901.h:154
Definition: JY901.h:87
Definition: JY901.h:172
Definition: JY901.h:187
double y
Definition: JY901.h:169
Definition: JY901.h:140
int day
Definition: JY901.h:144
unsigned char ucSecond
Definition: JY901.h:83


wit-imu-driver
Author(s): Inspur Group, Penn Zhang
autogenerated on Thu Sep 10 2020 03:49:48