Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
205 Nick666 1
 
2
 
3
typedef struct
4
{
226 Nick666 5
        uint8_t STATE;
205 Nick666 6
        unsigned int DRDY;
226 Nick666 7
        uint8_t AXIS;
205 Nick666 8
        signed int x_axis;
9
        signed int y_axis;
10
        signed int z_axis;
226 Nick666 11
        signed int NickGrad;
12
        signed int RollGrad;
205 Nick666 13
}MM3_struct;
14
 
15
extern MM3_struct MM3; 
16
 
17
void init_spi(void);
18
void MM3_timer0(void);
226 Nick666 19
signed int MM3_heading(void);
205 Nick666 20
 
226 Nick666 21
#define Int2Grad_Faktor         1024
22
 
23
// Die Werte der Statemachine
205 Nick666 24
#define MM3_RESET                       0
25
#define MM3_START_TRANSFER      1
26
#define MM3_WAIT_DRDY           2
27
#define MM3_DRDY                        3
28
#define MM3_X_BYTE2                     4
29
#define MM3_Y_BYTE2                     5
30
#define MM3_Z_BYTE2                     6
31
#define MM3_X                           7
32
#define MM3_Y                           8
33
#define MM3_Z                           9
34
#define MM3_IDLE                        255
35
 
226 Nick666 36
 
37
// Die Werte der Kompasskalibrierung
233 Nick666 38
 
39
// RANGE: Maximaler Wert - minimaler Wert
226 Nick666 40
#define RANGE_X 1161
41
#define RANGE_Y 1209
42
#define RANGE_Z 1276
43
 
234 Nick666 44
// OFFSET: (Maximaler Wert + minimaler Wert) / 2
226 Nick666 45
#define OFF_X   -46
46
#define OFF_Y   52
47
#define OFF_Z   25
48
 
233 Nick666 49
// z. Z. nicht verwendet
228 Nick666 50
#define GAIN_X  16
226 Nick666 51
#define GAIN_Y  15
228 Nick666 52
#define GAIN_Z  15