Rev 891 |
Blame |
Last modification |
View Log
| RSS feed
struct MM3_working_struct
{
uint8_t STATE;
uint8_t AXIS;
uint16_t DRDY;
int16_t x_axis;
int16_t y_axis;
int16_t z_axis;
};
struct MM3_calib_struct
{
int8_t X_off;
int8_t Y_off;
int8_t Z_off;
int16_t X_range;
int16_t Y_range;
int16_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);
int heading_MM3(void);
// MM3-Konfiguration
#define MM3_X_AXIS 0x01
#define MM3_Y_AXIS 0x02
#define MM3_Z_AXIS 0x03
#define MM3_PERIOD_32 0x00
#define MM3_PERIOD_64 0x10
#define MM3_PERIOD_128 0x20
#define MM3_PERIOD_256 0x30
#define MM3_PERIOD_512 0x40
#define MM3_PERIOD_1024 0x50
#define MM3_PERIOD_2048 0x60
#define MM3_PERIOD_4096 0x70
// Spikes Filtern
#define Max_Axis_Value 512
// 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