| Flemmard | fb6d1e4 | 2013-05-23 15:18:38 -0700 | [diff] [blame] | 1 | /******************** (C) COPYRIGHT 2011 STMicroelectronics ******************** | 
|  | 2 | * | 
|  | 3 | * File Name		: r3gd20.h | 
|  | 4 | * Authors		: MH - C&I BU - Application Team | 
|  | 5 | *			: Carmine Iascone (carmine.iascone@st.com) | 
|  | 6 | *			: Matteo Dameno (matteo.dameno@st.com) | 
|  | 7 | *			: Both authors are willing to be considered the contact | 
|  | 8 | *			: and update points for the driver. | 
|  | 9 | * Version		: V 1.1.5 sysfs | 
|  | 10 | * Date			: 2011/Sep/24 | 
|  | 11 | * Description		: R3GD20 digital output gyroscope sensor API | 
|  | 12 | * | 
|  | 13 | ******************************************************************************** | 
|  | 14 | * | 
|  | 15 | * This program is free software; you can redistribute it and/or modify | 
|  | 16 | * it under the terms of the GNU General Public License version 2 as | 
|  | 17 | * published by the Free Software Foundation. | 
|  | 18 | * | 
|  | 19 | * THE PRESENT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES | 
|  | 20 | * OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, FOR THE SOLE | 
|  | 21 | * PURPOSE TO SUPPORT YOUR APPLICATION DEVELOPMENT. | 
|  | 22 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, | 
|  | 23 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE | 
|  | 24 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING | 
|  | 25 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. | 
|  | 26 | * | 
|  | 27 | ******************************************************************************** | 
|  | 28 | * REVISON HISTORY | 
|  | 29 | * | 
|  | 30 | * VERSION	| DATE		| AUTHORS		| DESCRIPTION | 
|  | 31 | * 1.0		| 2010/May/02	| Carmine Iascone	| First Release | 
|  | 32 | * 1.1.3		| 2011/Jun/24	| Matteo Dameno		| Corrects ODR Bug | 
|  | 33 | * 1.1.4		| 2011/Sep/02	| Matteo Dameno		| SMB Bus Mng, | 
|  | 34 | * 		|		|			| forces BDU setting | 
|  | 35 | * 1.1.5		| 2011/Sep/24	| Matteo Dameno		| Introduces FIFO Feat. | 
|  | 36 | * 1.1.5.1 | 2011/Nov/6  | Morris Chen     | change name from l3g to r3g | 
|  | 37 | *                                         | change default FS to 2000DPS | 
|  | 38 | *                                         | change default poll_rate to 50ms | 
|  | 39 | *                                         | chage the attribute of sysfs file as 666 | 
|  | 40 | *******************************************************************************/ | 
|  | 41 |  | 
|  | 42 | #ifndef __R3GD20_H__ | 
|  | 43 | #define __R3GD20_H__ | 
|  | 44 |  | 
|  | 45 |  | 
|  | 46 | #define R3GD20_MIN_POLL_PERIOD_MS	2 | 
|  | 47 |  | 
|  | 48 | #define SAD0L				0x00 | 
|  | 49 | #define SAD0H				0x01 | 
|  | 50 | #define R3GD20_GYR_I2C_SADROOT		0x6A | 
|  | 51 | #define R3GD20_GYR_I2C_SAD_L		((R3GD20_GYR_I2C_SADROOT<<1)|SAD0L) | 
|  | 52 | #define R3GD20_GYR_I2C_SAD_H		((R3GD20_GYR_I2C_SADROOT<<1)|SAD0H) | 
|  | 53 |  | 
|  | 54 | #define R3GD20_GYR_DEV_NAME		"r3gd20_gyr" | 
|  | 55 |  | 
|  | 56 | #define R3GD20_GYR_FS_250DPS	0x00 | 
|  | 57 | #define R3GD20_GYR_FS_500DPS	0x10 | 
|  | 58 | #define R3GD20_GYR_FS_2000DPS	0x30 | 
|  | 59 |  | 
|  | 60 | #define R3GD20_GYR_ENABLED	1 | 
|  | 61 | #define R3GD20_GYR_DISABLED	0 | 
|  | 62 |  | 
|  | 63 | extern unsigned char gyro_gsensor_kvalue[37]; | 
|  | 64 |  | 
|  | 65 | #ifdef __KERNEL__ | 
|  | 66 | struct r3gd20_gyr_platform_data { | 
|  | 67 | int (*init)(void); | 
|  | 68 | void (*exit)(void); | 
|  | 69 | int (*power_on)(void); | 
|  | 70 | int (*power_off)(void); | 
|  | 71 | unsigned int poll_interval; | 
|  | 72 | unsigned int min_interval; | 
|  | 73 |  | 
|  | 74 | u8 fs_range; | 
|  | 75 |  | 
|  | 76 |  | 
|  | 77 | u8 watermark; | 
|  | 78 | u8 fifomode; | 
|  | 79 |  | 
|  | 80 |  | 
|  | 81 | int gpio_int1; | 
|  | 82 | int gpio_int2; | 
|  | 83 |  | 
|  | 84 |  | 
|  | 85 | u8 axis_map_x; | 
|  | 86 | u8 axis_map_y; | 
|  | 87 | u8 axis_map_z; | 
|  | 88 |  | 
|  | 89 | u8 negate_x; | 
|  | 90 | u8 negate_y; | 
|  | 91 | u8 negate_z; | 
|  | 92 |  | 
|  | 93 | int (*power_LPM)(int on); | 
|  | 94 | }; | 
|  | 95 | #endif | 
|  | 96 |  | 
|  | 97 | #endif |