48 #define MAGREG_CRB 0x01
49 #define MAGREG_MR 0x02
50 #define MAGREG_XH 0x03
52 #define MAG_NORMALIZE 1000
78 if ((r <= 0) || (r >= 8)) {
110 int16_t x = *(int8_t *)(&xh);
114 int16_t y = *(int8_t *)(&yh);
118 int16_t z = *(int8_t *)(&zh);
124 v->
x = (((double)x) * 1.3 / MAG_NORMALIZE);
125 v->
y = (((double)y) * 1.3 / MAG_NORMALIZE);
126 v->
z = (((double)z) * 1.3 / MAG_NORMALIZE);
129 v->
x = (((double)x) * 1.9 / MAG_NORMALIZE);
130 v->
y = (((double)y) * 1.9 / MAG_NORMALIZE);
131 v->
z = (((double)z) * 1.9 / MAG_NORMALIZE);
134 v->
x = (((double)x) * 2.5 / MAG_NORMALIZE);
135 v->
y = (((double)y) * 2.5 / MAG_NORMALIZE);
136 v->
z = (((double)z) * 2.5 / MAG_NORMALIZE);
139 v->
x = (((double)x) * 4.0 / MAG_NORMALIZE);
140 v->
y = (((double)y) * 4.0 / MAG_NORMALIZE);
141 v->
z = (((double)z) * 4.0 / MAG_NORMALIZE);
144 v->
x = (((double)x) * 4.7 / MAG_NORMALIZE);
145 v->
y = (((double)y) * 4.7 / MAG_NORMALIZE);
146 v->
z = (((double)z) * 4.7 / MAG_NORMALIZE);
149 v->
x = (((double)x) * 5.6 / MAG_NORMALIZE);
150 v->
y = (((double)y) * 5.6 / MAG_NORMALIZE);
151 v->
z = (((double)z) * 5.6 / MAG_NORMALIZE);
154 v->
x = (((double)x) * 8.1 / MAG_NORMALIZE);
155 v->
y = (((double)y) * 8.1 / MAG_NORMALIZE);
156 v->
z = (((double)z) * 8.1 / MAG_NORMALIZE);