• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  $License:
3    Copyright 2011 InvenSense, Inc.
4 
5  Licensed under the Apache License, Version 2.0 (the "License");
6  you may not use this file except in compliance with the License.
7  You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16   $
17  */
18 /*******************************************************************************
19  *
20  * $Id: slave.h 5629 2011-06-11 03:13:08Z mcaramello $
21  *
22  *******************************************************************************/
23 
24 #ifndef SLAVE_H
25 #define SLAVE_H
26 
27 /**
28  *  @addtogroup SLAVEDL
29  *
30  *  @{
31  *      @file     slave.h
32  *      @brief    Top level descriptions for Accelerometer support
33  *
34  */
35 
36 #include "mltypes.h"
37 #include "mpu.h"
38 
39     /* ------------ */
40     /* - Defines. - */
41     /* ------------ */
42 
43 /*--- default accel support - selection ---*/
44 #define ACCEL_ST_LIS331                 0
45 #define ACCEL_KIONIX_KXTF9              1
46 #define ACCEL_BOSCH                     0
47 #define ACCEL_ADI                       0
48 
49 #define ACCEL_SLAVEADDR_INVALID         0x00
50 
51 #define ACCEL_SLAVEADDR_LIS331          0x18
52 #define ACCEL_SLAVEADDR_LSM303          0x18
53 #define ACCEL_SLAVEADDR_LIS3DH          0x18
54 #define ACCEL_SLAVEADDR_KXSD9           0x18
55 #define ACCEL_SLAVEADDR_KXTF9           0x0F
56 #define ACCEL_SLAVEADDR_BMA150          0x38
57 #define ACCEL_SLAVEADDR_BMA222          0x08
58 #define ACCEL_SLAVEADDR_BMA250          0x18
59 #define ACCEL_SLAVEADDR_ADXL34X         0x53
60 #define ACCEL_SLAVEADDR_ADXL34X_ALT     0x1D /* alternative addr */
61 #define ACCEL_SLAVEADDR_MMA8450         0x1C
62 #define ACCEL_SLAVEADDR_MMA845X         0x1C
63 
64 #define ACCEL_SLAVEADDR_INVENSENSE      0x68
65 /*
66     Define default accelerometer to use if no selection is made
67 */
68 #if ACCEL_ST_LIS331
69 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_LIS331
70 #define DEFAULT_ACCEL_ID                  ACCEL_ID_LIS331
71 #endif
72 
73 #if ACCEL_ST_LSM303
74 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_LSM303
75 #define DEFAULT_ACCEL_ID                  ACCEL_ID_LSM303A
76 #endif
77 
78 #if ACCEL_KIONIX_KXSD9
79 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_KXSD9
80 #define DEFAULT_ACCEL_ID                  ACCEL_ID_KXSD9
81 #endif
82 
83 #if ACCEL_KIONIX_KXTF9
84 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_KXTF9
85 #define DEFAULT_ACCEL_ID                  ACCEL_ID_KXTF9
86 #endif
87 
88 #if ACCEL_BOSCH
89 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_BMA150
90 #define DEFAULT_ACCEL_ID                  ACCEL_ID_BMA150
91 #endif
92 
93 #if ACCEL_BMA222
94 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_BMA222
95 #define DEFAULT_ACCEL_ID                  ACCEL_ID_BMA222
96 #endif
97 
98 #if ACCEL_BOSCH
99 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_BMA250
100 #define DEFAULT_ACCEL_ID                  ACCEL_ID_BMA250
101 #endif
102 
103 #if ACCEL_ADI
104 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_ADXL34X
105 #define DEFAULT_ACCEL_ID                  ACCEL_ID_ADXL34X
106 #endif
107 
108 #if ACCEL_MMA8450
109 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_MMA8450
110 #define DEFAULT_ACCEL_ID                  ACCEL_ID_MMA8450
111 #endif
112 
113 #if ACCEL_MMA845X
114 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_MMA845X
115 #define DEFAULT_ACCEL_ID                  ACCEL_ID_MMA845X
116 #endif
117 
118 /*--- if no default accelerometer was selected ---*/
119 #ifndef DEFAULT_ACCEL_SLAVEADDR
120 #define DEFAULT_ACCEL_SLAVEADDR           ACCEL_SLAVEADDR_INVALID
121 #endif
122 
123 #define USE_COMPASS_AICHI                  0
124 #define USE_COMPASS_AKM                    0
125 #define USE_COMPASS_YAS529                 0
126 #define USE_COMPASS_YAS530                 0
127 #define USE_COMPASS_HMC5883                0
128 #define USE_COMPASS_MMC314X                0
129 #define USE_COMPASS_HSCDTD002B             0
130 #define USE_COMPASS_HSCDTD004A             0
131 
132 #define COMPASS_SLAVEADDR_INVALID          0x00
133 #define COMPASS_SLAVEADDR_AKM_BASE         0x0C
134 #define COMPASS_SLAVEADDR_AKM              0x0E
135 #define COMPASS_SLAVEADDR_AMI304           0x0E
136 #define COMPASS_SLAVEADDR_AMI305           0x0F /*Slave address for AMI 305/306*/
137 #define COMPASS_SLAVEADDR_AMI306           0x0E /*Slave address for AMI 305/306*/
138 #define COMPASS_SLAVEADDR_YAS529           0x2E
139 #define COMPASS_SLAVEADDR_YAS530           0x2E
140 #define COMPASS_SLAVEADDR_HMC5883          0x1E
141 #define COMPASS_SLAVEADDR_MMC314X          0x30
142 #define COMPASS_SLAVEADDR_HSCDTD00XX       0x0C
143 
144 /*
145     Define default compass to use if no selection is made
146 */
147  #if USE_COMPASS_AKM
148  #define DEFAULT_COMPASS_TYPE              COMPASS_ID_AK8975
149  #endif
150 
151  #if USE_COMPASS_AICHI
152  #define DEFAULT_COMPASS_TYPE              COMPASS_ID_AMI30X
153  #endif
154 
155  #if USE_COMPASS_YAS529
156  #define DEFAULT_COMPASS_TYPE              COMPASS_ID_YAS529
157  #endif
158 
159  #if USE_COMPASS_YAS530
160  #define DEFAULT_COMPASS_TYPE              COMPASS_ID_YAS530
161  #endif
162 
163  #if USE_COMPASS_HMC5883
164  #define DEFAULT_COMPASS_TYPE              COMPASS_ID_HMC5883
165  #endif
166 
167 #if USE_COMPASS_MMC314X
168 #define DEFAULT_COMPASS_TYPE              COMPASS_ID_MMC314X
169 #endif
170 
171 #if USE_COMPASS_HSCDTD002B
172 #define DEFAULT_COMPASS_TYPE              COMPASS_ID_HSCDTD002B
173 #endif
174 
175 #if USE_COMPASS_HSCDTD004A
176 #define DEFAULT_COMPASS_TYPE              COMPASS_ID_HSCDTD004A
177 #endif
178 
179 #ifndef DEFAULT_COMPASS_TYPE
180 #define DEFAULT_COMPASS_TYPE               ID_INVALID
181 #endif
182 
183 
184 #endif // SLAVE_H
185 
186 /**
187  *  @}
188  */
189