2 // Copyright (c) 2015 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef __DESCRIPTION_H__
18 #define __DESCRIPTION_H__
22 #define QUIRK_ALREADY_DECODED 0x01 /* Sensor quirks have been read */
23 #define QUIRK_INITIAL_RATE 0x02 /* Force initial sensor sampling rate */
24 #define QUIRK_FIELD_ORDERING 0x04 /* Do field remapping for this sensor */
25 #define QUIRK_TERSE_DRIVER 0x08 /* Force duplicate events generation */
26 #define QUIRK_NOISY 0x10 /* High noise level on readings */
27 #define QUIRK_FORCE_CONTINUOUS 0x20 /* Force usage of continuous trigger */
28 #define QUIRK_BIASED 0x40 /* Biased sensor, requires compensation */
29 #define QUIRK_SPOTTY 0x80 /* Driver may lose events */
30 #define QUIRK_NO_EVENT_MODE 0x100 /* Disable event mode */
31 #define QUIRK_NO_TRIG_MODE 0x200 /* Disable trigger mode */
32 #define QUIRK_NO_POLL_MODE 0x400 /* Disable poll mode */
33 #define QUIRK_MOUNTING_MATRIX 0x800 /* Mounting information present */
34 #define QUIRK_HRTIMER 0x1000 /* We may use a hrtimer if there is no other trigger */
35 #define QUIRK_SECONDARY 0x2000 /* List after other sensors of the same type */
38 typedef uint64_t flag_t;
39 typedef int64_t max_delay_t;
41 typedef uint32_t flag_t;
42 typedef int32_t max_delay_t;
45 char* sensor_get_name (int s);
46 char* sensor_get_vendor (int s);
47 int sensor_get_version (int s);
48 float sensor_get_max_range (int s);
49 void sensor_update_max_range (int s);
50 float sensor_get_resolution (int s);
51 float sensor_get_power (int s);
52 flag_t sensor_get_flags (int s);
53 int32_t sensor_get_min_delay (int s);
54 max_delay_t sensor_get_max_delay (int s);
55 float sensor_get_illumincalib (int s);
56 uint32_t sensor_get_quirks (int s);
57 int sensor_get_prop (int s, const char* sel, int* val);
58 int sensor_get_fl_prop (int s, const char* sel, float* val);
59 int sensor_get_order (int s,unsigned char map[MAX_CHANNELS]);
60 int sensor_get_mounting_matrix(int s,float mounting_matrix[9]);
61 int sensor_get_available_frequencies(int s);
62 int sensor_get_cal_steps (int s);
63 char* sensor_get_string_type (int s);
64 int sensor_get_st_prop (int s, const char* sel, char val[MAX_NAME_SIZE]);