2 * Copyright (C) 2014 Intel Corporation.
5 #ifndef __CALIBRATION_H__
6 #define __CALIBRATION_H__
10 #define MAGN_DS_SIZE 32
13 /* hard iron offsets */
16 /* soft iron matrix */
17 double w_invert[3][3];
19 /* geomagnetic strength */
23 float sample[MAGN_DS_SIZE][3];
24 unsigned int sample_count;
28 float bias_x, bias_y, bias_z;
30 float min_x, min_y, min_z;
31 float max_x, max_y, max_z;
34 typedef double mat_input_t[MAGN_DS_SIZE][3];
36 void calibrate_compass (struct sensors_event_t* event, struct sensor_info_t* info);
37 void compass_read_data (struct sensor_info_t* info);
38 void compass_store_data (struct sensor_info_t* info);
40 void calibrate_gyro(struct sensors_event_t* event, struct sensor_info_t* info);
41 void gyro_cal_init(struct sensor_info_t* info);
42 void gyro_store_data (struct sensor_info_t* info);