OSDN Git Service

Fix type of recently introduced semi arbitrated sampling rate
[android-x86/hardware-intel-libsensors.git] / calibration.h
1 /*
2  * Copyright (C) 2014-2015 Intel Corporation.
3  */
4
5 #ifndef __CALIBRATION_H__
6 #define __CALIBRATION_H__
7
8 #include "common.h"
9
10 #define MAGN_DS_SIZE 32
11
12
13 typedef struct {
14     /* hard iron offsets */
15     double offset[3][1];
16
17     /* soft iron matrix */
18     double w_invert[3][3];
19
20     /* geomagnetic strength */
21     double bfield;
22
23     /* selection data */
24     float sample[MAGN_DS_SIZE][3];
25     unsigned int sample_count;
26     float average[3];
27 }
28 compass_cal_t;
29
30
31 typedef struct {
32     float bias_x, bias_y, bias_z;
33     int count;
34     float min_x, min_y, min_z;
35     float max_x, max_y, max_z;
36 }
37 gyro_cal_t;
38
39
40 typedef double mat_input_t[MAGN_DS_SIZE][3];
41
42
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);
46
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);
50
51 #endif