summaryrefslogtreecommitdiffstats
path: root/watch-library
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-02-19 14:03:10 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2022-02-19 14:05:38 -0500
commit09f79f782faaf2383fb7eeb1845701675a4439c8 (patch)
tree08f6c0611291e92aa60c78d353a3b31ae5c8e587 /watch-library
parentee60d97d25737af6e8c26415390c6a485dbf2ea0 (diff)
downloadSensor-Watch-09f79f782faaf2383fb7eeb1845701675a4439c8.tar.gz
Sensor-Watch-09f79f782faaf2383fb7eeb1845701675a4439c8.tar.bz2
Sensor-Watch-09f79f782faaf2383fb7eeb1845701675a4439c8.zip
lis2dw: reasonable defaults when initializing
Diffstat (limited to 'watch-library')
-rw-r--r--watch-library/shared/driver/lis2dw.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/watch-library/shared/driver/lis2dw.c b/watch-library/shared/driver/lis2dw.c
index f273fab3..0b788fca 100644
--- a/watch-library/shared/driver/lis2dw.c
+++ b/watch-library/shared/driver/lis2dw.c
@@ -31,12 +31,8 @@ bool lis2dw_begin(void) {
}
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL2, LIS2DW_CTRL2_VAL_BOOT);
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL2, LIS2DW_CTRL2_VAL_SOFT_RESET);
- // Start at lowest possible data rate and lowest possible power mode
- watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL1, LIS2DW_CTRL1_VAL_ODR_LOWEST | LIS2DW_CTRL1_VAL_MODE_LOW_POWER | LIS2DW_CTRL1_VAL_LPMODE_1);
// Enable block data update (output registers not updated until MSB and LSB have been read) and address autoincrement
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL2, LIS2DW_CTRL2_VAL_BDU | LIS2DW_CTRL2_VAL_IF_ADD_INC);
- // Set range to ±2G
- watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL6, LIS2DW_CTRL6_VAL_RANGE_2G);
return true;
}