2 * Copyright (C) 2014 Intel Corporation.
5 #ifndef __CALIBRATION_H__
6 #define __CALIBRATION_H__
10 #define MAGN_DS_SIZE 32
12 struct compass_cal_t {
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;
29 float bias_x, bias_y, bias_z;
31 float min_x, min_y, min_z;
32 float max_x, max_y, max_z;
35 typedef double mat_input_t[MAGN_DS_SIZE][3];
37 void calibrate_compass (struct sensors_event_t* event, struct sensor_info_t* info);
38 void compass_read_data (struct sensor_info_t* info);
39 void compass_store_data (struct sensor_info_t* info);
41 void calibrate_gyro(struct sensors_event_t* event, struct sensor_info_t* info);
42 void gyro_cal_init(struct sensor_info_t* info);
43 void gyro_store_data (struct sensor_info_t* info);