2 * Copyright (C) 2014 Intel Corporation.
5 #ifndef __CALIBRATION_H__
6 #define __CALIBRATION_H__
10 #define MAGN_DS_SIZE 32
14 /* hard iron offsets */
17 /* soft iron matrix */
18 double w_invert[3][3];
20 /* geomagnetic strength */
24 float sample[MAGN_DS_SIZE][3];
25 unsigned int sample_count;
32 float bias_x, bias_y, bias_z;
34 float min_x, min_y, min_z;
35 float max_x, max_y, max_z;
40 typedef double mat_input_t[MAGN_DS_SIZE][3];
43 void calibrate_compass (sensors_event_t* event, sensor_info_t* info);
44 void compass_read_data (sensor_info_t* info);
45 void compass_store_data (sensor_info_t* info);
47 void calibrate_gyro (sensors_event_t* event, sensor_info_t* info);
48 void gyro_cal_init (sensor_info_t* info);
49 void gyro_store_data (sensor_info_t* info);