Subversion Repositories FlightCtrl

Rev

Blame | Last modification | View Log | RSS feed



typedef struct
{
        uint8_t STATE;
        unsigned int DRDY;
        uint8_t AXIS;
        signed int x_axis;
        signed int x_axis_old;
        signed int y_axis;
        signed int y_axis_old;
        signed int z_axis;
        signed int z_axis_old;
        signed int NickGrad;
        signed int RollGrad;
}MM3_working_struct;


typedef struct
{
        int8_t X_off;
        int8_t Y_off;
        int8_t Z_off;
}MM3_calib_struct;

extern MM3_working_struct MM3;
extern MM3_calib_struct MM3_calib;

void MM3_init(void);
void MM3_timer0(void);
void calib_MM3(void);
signed int MM3_heading(void);

#define Max_Axis_Value          500

// Die Werte der Statemachine
#define MM3_RESET                       0
#define MM3_START_TRANSFER      1
#define MM3_WAIT_DRDY           2
#define MM3_DRDY                        4
#define MM3_BYTE2                       8
#define MM3_X                           16
#define MM3_Y                           32
#define MM3_Z                           64
#define MM3_TILT                        128