1 /* include/linux/af7133.h - AF7133 compass driver
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program 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
11 * GNU General Public License for more details.
16 * Definitions for af7133 compass chip.
21 #include <linux/ioctl.h>
23 #define AF7133_I2C_ADDRESS 0x1E //7-bit address
24 #define AF7133_BUFSIZE 6
27 /*AF7133 register address*/
28 #define AF7133_REG_DATA 0x00
29 #define AF7133_REG_STATUS 0x06
30 #define AF7133_REG_MODE 0x0B
31 #define AF7133_REG_HF 0x10
32 #define AF7133_REG_PCODE 0x16
33 #define AF7133_REG_POR 0x18
34 #define AF7133_REG_RATE 0x19
35 #define AF7133_REG_CHIPID 0x1C
39 #define AF7133_MODE_IDLE 0x00
40 #define AF7133_MODE_WAKE 0x01
41 #define AF7133_MODE_SINGLE 0x02
43 #define AF7133_HF_ENABLE 0x80
44 #define AF7133_HF_DISABLE 0x00
46 #define AF7133_PCODE_VALUE 0x48
48 #define AF7133_POR_RESET 0x01
50 #define AF7133_RATE_10HZ 0x0C
51 #define AF7133_RATE_25HZ 0x05
52 #define AF7133_RATE_30HZ 0x04
54 // conversion of magnetic data (for AF7133) to uT units
56 #define CONVERT_M_DIV 100
58 // conversion of orientation data to degree units
60 #define CONVERT_O_DIV 1