@@ -153,23 +153,6 @@ THE SOFTWARE.
153
153
#define BMI160_LATCH_MODE_BIT 0
154
154
#define BMI160_LATCH_MODE_LEN 4
155
155
156
- #define BMI160_LATCH_MODE_NONE 0
157
- #define BMI160_LATCH_MODE_312_5_US 1
158
- #define BMI160_LATCH_MODE_625_US 2
159
- #define BMI160_LATCH_MODE_1_25_MS 3
160
- #define BMI160_LATCH_MODE_2_5_MS 4
161
- #define BMI160_LATCH_MODE_5_MS 5
162
- #define BMI160_LATCH_MODE_10_MS 6
163
- #define BMI160_LATCH_MODE_20_MS 7
164
- #define BMI160_LATCH_MODE_40_MS 8
165
- #define BMI160_LATCH_MODE_80_MS 9
166
- #define BMI160_LATCH_MODE_160_MS 10
167
- #define BMI160_LATCH_MODE_320_MS 11
168
- #define BMI160_LATCH_MODE_640_MS 12
169
- #define BMI160_LATCH_MODE_1_28_S 13
170
- #define BMI160_LATCH_MODE_2_56_S 14
171
- #define BMI160_LATCH_MODE_LATCH 15
172
-
173
156
#define BMI160_RA_INT_LATCH 0x54
174
157
#define BMI160_RA_INT_MAP_0 0x55
175
158
#define BMI160_RA_INT_MAP_1 0x56
@@ -251,60 +234,18 @@ THE SOFTWARE.
251
234
#define BMI160_GYRO_RANGE_SEL_BIT 0
252
235
#define BMI160_GYRO_RANGE_SEL_LEN 3
253
236
254
- /* Gyroscope Full-Scale Range Options */
255
- #define BMI160_GYRO_RANGE_125 0x04
256
- #define BMI160_GYRO_RANGE_250 0x03
257
- #define BMI160_GYRO_RANGE_500 0x02
258
- #define BMI160_GYRO_RANGE_1000 0x01
259
- #define BMI160_GYRO_RANGE_2000 0x00
260
-
261
237
#define BMI160_GYRO_RATE_SEL_BIT 0
262
238
#define BMI160_GYRO_RATE_SEL_LEN 4
263
239
264
- /* Gyroscope Output Data Rate Options */
265
- #define BMI160_GYRO_RATE_25HZ 0x06
266
- #define BMI160_GYRO_RATE_50HZ 0x07
267
- #define BMI160_GYRO_RATE_100HZ 0x08
268
- #define BMI160_GYRO_RATE_200HZ 0x09
269
- #define BMI160_GYRO_RATE_400HZ 0x0A
270
- #define BMI160_GYRO_RATE_800HZ 0x0B
271
- #define BMI160_GYRO_RATE_1600HZ 0x0C
272
- #define BMI160_GYRO_RATE_3200HZ 0x0D
273
-
274
240
#define BMI160_GYRO_DLPF_SEL_BIT 4
275
241
#define BMI160_GYRO_DLPF_SEL_LEN 2
276
242
277
243
#define BMI160_ACCEL_DLPF_SEL_BIT 4
278
244
#define BMI160_ACCEL_DLPF_SEL_LEN 3
279
245
280
- /* Gyroscope Digital Low-Pass Filter Mode Options */
281
- #define BMI160_DLPF_MODE_NORM 0x2
282
- #define BMI160_DLPF_MODE_OSR2 0x1
283
- #define BMI160_DLPF_MODE_OSR4 0x0
284
-
285
246
#define BMI160_ACCEL_RANGE_SEL_BIT 0
286
247
#define BMI160_ACCEL_RANGE_SEL_LEN 4
287
248
288
- /* Accelerometer Range Options */
289
- #define BMI160_ACCEL_RANGE_2G 0X03
290
- #define BMI160_ACCEL_RANGE_4G 0X05
291
- #define BMI160_ACCEL_RANGE_8G 0X08
292
- #define BMI160_ACCEL_RANGE_16G 0X0C
293
-
294
- /* Accelerometer Output Data Rate Options */
295
- #define BMI160_ACCEL_RATE_25_32HZ 0x01
296
- #define BMI160_ACCEL_RATE_25_16HZ 0x02
297
- #define BMI160_ACCEL_RATE_25_8HZ 0x03
298
- #define BMI160_ACCEL_RATE_25_4HZ 0x04
299
- #define BMI160_ACCEL_RATE_25_2HZ 0x05
300
- #define BMI160_ACCEL_RATE_25HZ 0x06
301
- #define BMI160_ACCEL_RATE_50HZ 0x07
302
- #define BMI160_ACCEL_RATE_100HZ 0x08
303
- #define BMI160_ACCEL_RATE_200HZ 0x09
304
- #define BMI160_ACCEL_RATE_400HZ 0x0A
305
- #define BMI160_ACCEL_RATE_800HZ 0x0B
306
- #define BMI160_ACCEL_RATE_1600HZ 0x0C
307
-
308
249
#define BMI160_CMD_START_FOC 0x03
309
250
#define BMI160_CMD_ACC_MODE_NORMAL 0x11
310
251
#define BMI160_CMD_GYR_MODE_NORMAL 0x15
@@ -315,22 +256,129 @@ THE SOFTWARE.
315
256
316
257
#define BMI160_RA_CMD 0x7E
317
258
259
+ /* *
260
+ * Interrupt Latch Mode options
261
+ * @see setInterruptLatch()
262
+ */
263
+ typedef enum {
264
+ BMI160_LATCH_MODE_NONE = 0 , /* *< Non-latched */
265
+ BMI160_LATCH_MODE_312_5_US, /* *< Temporary, 312.50 microseconds */
266
+ BMI160_LATCH_MODE_625_US, /* *< Temporary, 625.00 microseconds */
267
+ BMI160_LATCH_MODE_1_25_MS, /* *< Temporary, 1.25 milliseconds */
268
+ BMI160_LATCH_MODE_2_5_MS, /* *< Temporary, 2.50 milliseconds */
269
+ BMI160_LATCH_MODE_5_MS, /* *< Temporary, 5.00 milliseconds */
270
+ BMI160_LATCH_MODE_10_MS, /* *< Temporary, 10.00 milliseconds */
271
+ BMI160_LATCH_MODE_20_MS, /* *< Temporary, 20.00 milliseconds */
272
+ BMI160_LATCH_MODE_40_MS, /* *< Temporary, 40.00 milliseconds */
273
+ BMI160_LATCH_MODE_80_MS, /* *< Temporary, 80.00 milliseconds */
274
+ BMI160_LATCH_MODE_160_MS, /* *< Temporary, 160.00 milliseconds */
275
+ BMI160_LATCH_MODE_320_MS, /* *< Temporary, 320.00 milliseconds */
276
+ BMI160_LATCH_MODE_640_MS, /* *< Temporary, 640.00 milliseconds */
277
+ BMI160_LATCH_MODE_1_28_S, /* *< Temporary, 1.28 seconds */
278
+ BMI160_LATCH_MODE_2_56_S, /* *< Temporary, 2.56 seconds */
279
+ BMI160_LATCH_MODE_LATCH, /* *< Latched, @see resetInterrupt() */
280
+ } BMI160InterruptLatchMode;
281
+
282
+ /* *
283
+ * Digital Low-Pass Filter Mode options
284
+ * @see setGyroDLPFMode()
285
+ * @see setAccelDLPFMode()
286
+ */
287
+ typedef enum {
288
+ BMI160_DLPF_MODE_NORM = 0x2 ,
289
+ BMI160_DLPF_MODE_OSR2 = 0x1 ,
290
+ BMI160_DLPF_MODE_OSR4 = 0x0 ,
291
+ } BMI160DLPFMode;
292
+
293
+ /* *
294
+ * Accelerometer Sensitivity Range options
295
+ * @see setFullScaleAccelRange()
296
+ */
297
+ typedef enum {
298
+ BMI160_ACCEL_RANGE_2G = 0X03 , /* *< +/- 2g range */
299
+ BMI160_ACCEL_RANGE_4G = 0X05 , /* *< +/- 4g range */
300
+ BMI160_ACCEL_RANGE_8G = 0X08 , /* *< +/- 8g range */
301
+ BMI160_ACCEL_RANGE_16G = 0X0C , /* *< +/- 16g range */
302
+ } BMI160AccelRange;
303
+
304
+ /* *
305
+ * Gyroscope Sensitivity Range options
306
+ * @see setFullScaleGyroRange()
307
+ */
308
+ typedef enum {
309
+ BMI160_GYRO_RANGE_2000 = 0 , /* *< +/- 2000 degrees/second */
310
+ BMI160_GYRO_RANGE_1000, /* *< +/- 1000 degrees/second */
311
+ BMI160_GYRO_RANGE_500, /* *< +/- 500 degrees/second */
312
+ BMI160_GYRO_RANGE_250, /* *< +/- 250 degrees/second */
313
+ BMI160_GYRO_RANGE_125, /* *< +/- 125 degrees/second */
314
+ } BMI160GyroRange;
315
+
316
+ /* *
317
+ * Accelerometer Output Data Rate options
318
+ * @see setAccelRate()
319
+ */
320
+ typedef enum {
321
+ BMI160_ACCEL_RATE_25_32HZ = 1 , /* *< 25/32 Hz */
322
+ BMI160_ACCEL_RATE_25_16HZ, /* *< 25/16 Hz */
323
+ BMI160_ACCEL_RATE_25_8HZ, /* *< 25/8 Hz */
324
+ BMI160_ACCEL_RATE_25_4HZ, /* *< 25/4 Hz */
325
+ BMI160_ACCEL_RATE_25_2HZ, /* *< 25/2 Hz */
326
+ BMI160_ACCEL_RATE_25HZ, /* *< 25 Hz */
327
+ BMI160_ACCEL_RATE_50HZ, /* *< 50 Hz */
328
+ BMI160_ACCEL_RATE_100HZ, /* *< 100 Hz */
329
+ BMI160_ACCEL_RATE_200HZ, /* *< 200 Hz */
330
+ BMI160_ACCEL_RATE_400HZ, /* *< 400 Hz */
331
+ BMI160_ACCEL_RATE_800HZ, /* *< 800 Hz */
332
+ BMI160_ACCEL_RATE_1600HZ, /* *< 1600 Hz */
333
+ } BMI160AccelRate;
334
+
335
+ /* *
336
+ * Gyroscope Output Data Rate options
337
+ * @see setGyroRate()
338
+ */
339
+ typedef enum {
340
+ BMI160_GYRO_RATE_25HZ = 6 , /* *< 25 Hz */
341
+ BMI160_GYRO_RATE_50HZ, /* *< 50 Hz */
342
+ BMI160_GYRO_RATE_100HZ, /* *< 100 Hz */
343
+ BMI160_GYRO_RATE_200HZ, /* *< 200 Hz */
344
+ BMI160_GYRO_RATE_400HZ, /* *< 400 Hz */
345
+ BMI160_GYRO_RATE_800HZ, /* *< 800 Hz */
346
+ BMI160_GYRO_RATE_1600HZ, /* *< 1600 Hz */
347
+ BMI160_GYRO_RATE_3200HZ, /* *< 3200 Hz */
348
+ } BMI160GyroRate;
349
+
350
+ /* *
351
+ * Step Detection Mode options
352
+ * @see setStepDetectionMode()
353
+ */
318
354
typedef enum {
319
355
BMI160_STEP_MODE_NORMAL = 0 ,
320
356
BMI160_STEP_MODE_SENSITIVE,
321
357
BMI160_STEP_MODE_ROBUST,
322
358
} BMI160StepMode;
323
359
360
+ /* *
361
+ * Tap Detection Shock Duration options
362
+ * @see setTapShockDuration()
363
+ */
324
364
typedef enum {
325
365
BMI160_TAP_SHOCK_DURATION_50MS = 0 ,
326
366
BMI160_TAP_SHOCK_DURATION_75MS,
327
367
} BMI160TapShockDuration;
328
368
369
+ /* *
370
+ * Tap Detection Quiet Duration options
371
+ * @see setTapQuietDuration()
372
+ */
329
373
typedef enum {
330
374
BMI160_TAP_QUIET_DURATION_30MS = 0 ,
331
375
BMI160_TAP_QUIET_DURATION_20MS,
332
376
} BMI160TapQuietDuration;
333
377
378
+ /* *
379
+ * Double-Tap Detection Duration options
380
+ * @see setDoubleTapDetectionDuration()
381
+ */
334
382
typedef enum {
335
383
BMI160_DOUBLE_TAP_DURATION_50MS = 0 ,
336
384
BMI160_DOUBLE_TAP_DURATION_100MS,
@@ -517,9 +565,6 @@ class BMI160Class {
517
565
uint8_t getRegister (uint8_t reg);
518
566
void setRegister (uint8_t reg, uint8_t data);
519
567
520
- /* TODO - consider making these protected - not sure if we want to allow use from a sketch
521
- * except perhaps for the latch control functions
522
- */
523
568
bool getIntEnabled ();
524
569
void setIntEnabled (bool enabled);
525
570
bool getInterruptMode ();
0 commit comments