Magnetometer and Proximity new evens
[adaptation/intel_mfld/sensor-plugins-mfld-blackbay.git] / inc / compassprocessor.h
1 /* Medfield sensor plugins
2  * Copyright (C) 2013 Intel Corporation
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; version 2.1.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301USA
16  */
17
18 #ifndef COMPASSPROCESSOR_H
19 #define COMPASSPROCESSOR_H
20 #define AXES 3
21 #define TWO_PI 6.283185307179586476925286766559
22 #define RADIAN_MULTIPLIER 57.295779513082320876798154814105
23 #define ROTATION_180 180
24
25 #include "baseprocessor.h"
26
27 class CompassProcessor : public BaseProcessor {
28 public:
29      CompassProcessor();
30      virtual bool fill_values(unsigned int type, int &count,
31                               data_unit_idx_t &unit, data_accuracy &accuracy);
32
33      virtual int get_property(unsigned int property_level,
34                               base_property_struct &result);
35      virtual void process_input_events(const std::vector <input_event *> &events);
36      double min_xyz[AXES];
37      double max_xyz[AXES];
38      double offset[AXES];
39      double mgval[AXES];
40      double head[AXES];
41 };
42
43 #endif // COMPASSPROCESSOR_H