Rev 470 |
Blame |
Last modification |
View Log
| RSS feed
struct MM3_working_struct
{
uint8_t STATE;
unsigned int DRDY;
uint8_t AXIS;
volatile signed int x_axis;
volatile signed int y_axis;
volatile signed int z_axis;
};
struct MM3_calib_struct
{
int8_t X_off;
int8_t Y_off;
int8_t Z_off;
uint16_t X_range;
uint16_t Y_range;
uint16_t Z_range;
};
extern struct MM3_working_struct MM3;
extern struct MM3_calib_struct MM3_calib;
void init_MM3(void);
void timer0_MM3(void);
void calib_MM3(void);
signed int heading_MM3(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 3
#define MM3_BYTE2 4
#define MM3_X 5
#define MM3_Y 6
#define MM3_Z 7
#define MM3_TILT 8
#define MM3_IDLE 9