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;
341 Nick666 9
        signed int x_axis_old;
205 Nick666 10
        signed int y_axis;
341 Nick666 11
        signed int y_axis_old;
205 Nick666 12
        signed int z_axis;
341 Nick666 13
        signed int z_axis_old;
226 Nick666 14
        signed int NickGrad;
15
        signed int RollGrad;
205 Nick666 16
}MM3_struct;
17
 
341 Nick666 18
extern MM3_struct MM3;
19
extern int8_t X_off, Y_off, Z_off;     
205 Nick666 20
 
342 Nick666 21
void MM3_init(void);
205 Nick666 22
void MM3_timer0(void);
341 Nick666 23
void MM3_calib(void);
226 Nick666 24
signed int MM3_heading(void);
205 Nick666 25
 
341 Nick666 26
#define Max_Axis_Value          500
226 Nick666 27
 
28
// Die Werte der Statemachine
205 Nick666 29
#define MM3_RESET                       0
30
#define MM3_START_TRANSFER      1
31
#define MM3_WAIT_DRDY           2
280 Nick666 32
#define MM3_DRDY                        4
33
#define MM3_BYTE2                       8
34
#define MM3_X                           16
35
#define MM3_Y                           32
36
#define MM3_Z                           64
37
#define MM3_TILT                        128