Rev 205 |
Blame |
Last modification |
View Log
| RSS feed
typedef struct
{
uint8_t STATE;
unsigned int DRDY;
uint8_t AXIS;
signed int x_axis;
signed int y_axis;
signed int z_axis;
signed int NickGrad;
signed int RollGrad;
}MM3_struct;
extern MM3_struct MM3;
void init_spi(void);
void MM3_timer0(void);
signed int MM3_heading(void);
#define Int2Grad_Faktor 1024
// Die Werte der Statemachine
#define MM3_RESET 0
#define MM3_START_TRANSFER 1
#define MM3_WAIT_DRDY 2
#define MM3_DRDY 3
#define MM3_X_BYTE2 4
#define MM3_Y_BYTE2 5
#define MM3_Z_BYTE2 6
#define MM3_X 7
#define MM3_Y 8
#define MM3_Z 9
#define MM3_IDLE 255
// Die Werte der Kompasskalibrierung
#define RANGE_X 1161
#define RANGE_Y 1209
#define RANGE_Z 1276
#define OFF_X -46
#define OFF_Y 52
#define OFF_Z 25
#define GAIN_X 14
#define GAIN_Y 15
#define GAIN_Z 16