PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/libsensors/taos_common.h

http://github.com/CyanogenMod/android_device_zte_blade
C++ Header | 61 lines | 40 code | 3 blank | 18 comment | 0 complexity | 57b1b58b22d6d68f38bb3b8e91c5a6fe MD5 | raw file
 1/*******************************************************************************
 2*                                                                              *
 3*       File Name:      taos_common.h                                          *
 4*       Description:    Common file for ioctl and configuration definitions.   *
 5*       		Used by kernel driver and driver access applications.  *
 6*       		Please include this file, and <sys/ioctl.h> in your    * 
 7*                       driver access application program source.	       *
 8*       Author:         John Koshi                                             *
 9*       History:        09/16/2009 - Initial creation                          *
10*       		02/07/2010 - Add proximity			       *
11*                                                                              *
12********************************************************************************
13*       Proprietary to Taos Inc., 1001 Klein Road #300, Plano, TX 75074        *
14*******************************************************************************/
15// ioctl numbers
16#define TAOS_IOCTL_MAGIC        	0XCF
17#define TAOS_IOCTL_ALS_ON       	_IO(TAOS_IOCTL_MAGIC, 1)
18#define TAOS_IOCTL_ALS_OFF      	_IO(TAOS_IOCTL_MAGIC, 2)
19#define TAOS_IOCTL_ALS_DATA     	_IOR(TAOS_IOCTL_MAGIC, 3, short)
20#define TAOS_IOCTL_ALS_CALIBRATE	_IO(TAOS_IOCTL_MAGIC, 4)
21#define TAOS_IOCTL_CONFIG_GET   	_IOR(TAOS_IOCTL_MAGIC, 5, struct taos_cfg)
22#define TAOS_IOCTL_CONFIG_SET		_IOW(TAOS_IOCTL_MAGIC, 6, struct taos_cfg)
23#define TAOS_IOCTL_PROX_ON		_IO(TAOS_IOCTL_MAGIC, 7)
24#define TAOS_IOCTL_PROX_OFF		_IO(TAOS_IOCTL_MAGIC, 8)
25#define TAOS_IOCTL_PROX_DATA		_IOR(TAOS_IOCTL_MAGIC, 9, struct taos_prox_info)
26#define TAOS_IOCTL_PROX_EVENT           _IO(TAOS_IOCTL_MAGIC, 10)
27#define TAOS_IOCTL_PROX_CALIBRATE	_IO(TAOS_IOCTL_MAGIC, 11)
28#define TAOS_IOCTL_PROX_GET_ENABLED   	_IOR(TAOS_IOCTL_MAGIC, 12, int*)
29#define TAOS_IOCTL_ALS_GET_ENABLED   	_IOR(TAOS_IOCTL_MAGIC, 13, int*)
30//
31#define u32 unsigned int 
32#define u16 unsigned short  
33#define u8   unsigned char 
34
35// device configuration
36struct taos_cfg {
37	u32	calibrate_target;
38	u16	als_time;
39	u16	scale_factor;
40	u16	gain_trim;
41 	u8	filter_history;
42	u8	filter_count;
43	u8	gain;
44	u16	prox_threshold_hi;
45	u16	prox_threshold_lo;
46	u8	prox_int_time;
47	u8	prox_adc_time;
48	u8	prox_wait_time;
49	u8	prox_intr_filter;
50	u8	prox_config;
51	u8	prox_pulse_cnt;
52	u8	prox_gain;
53};
54
55// proximity data
56struct taos_prox_info {
57        u16 prox_clear;
58        u16 prox_data;
59        int prox_event;
60};
61