]> git.earman.xyz Git - sensor-watch.git/commitdiff
accelerometer: clarify purpose of this bit
authorJoey Castillo <joeycastillo@utexas.edu>
Wed, 27 Nov 2024 16:09:47 +0000 (11:09 -0500)
committerJoey Castillo <joeycastillo@utexas.edu>
Wed, 27 Nov 2024 16:09:47 +0000 (11:09 -0500)
watch-library/shared/driver/lis2dw.c
watch-library/shared/driver/lis2dw.h

index 232f3ddd4c4782276f3c6566be4495398841cce8..d4c560707b3836cd9556dfb0b2842015164f4a1d 100644 (file)
@@ -233,14 +233,14 @@ void lis2dw_disable_stationary_motion_detection(void) {
     watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_DUR, configuration & ~LIS2DW_WAKE_UP_DUR_STATIONARY);
 }
 
-void lis2dw_enable_tap_detection(void) {
+void lis2dw_enable_double_tap_event(void) {
     uint8_t configuration = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS);
-    watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS, configuration | LIS2DW_WAKE_UP_THS_VAL_TAP_EVENT_ENABLED);
+    watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS, configuration | LIS2DW_WAKE_UP_THS_ENABLE_DOUBLE_TAP);
 }
 
-void lis2dw_disable_tap_detection(void) {
+void lis2dw_disable_double_tap_event(void) {
     uint8_t configuration = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS);
-    watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS, configuration & ~LIS2DW_WAKE_UP_THS_VAL_TAP_EVENT_ENABLED);
+    watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS, configuration & ~LIS2DW_WAKE_UP_THS_ENABLE_DOUBLE_TAP);
 }
 
 void lis2dw_configure_wakeup_threshold(uint8_t threshold) {
index 1869feb64fe1cf1499015ac2d6e21f9445bcc9fa..11e5c4f6ac03130df7ca4a561b99f978fd5754d2 100644 (file)
@@ -232,7 +232,7 @@ typedef enum {
 #define LIS2DW_REG_INT1_DUR 0x33
 
 #define LIS2DW_REG_WAKE_UP_THS 0x34
-#define LIS2DW_WAKE_UP_THS_VAL_TAP_EVENT_ENABLED 0b10000000
+#define LIS2DW_WAKE_UP_THS_ENABLE_DOUBLE_TAP     0b10000000 // by default, only single tap is enabled
 #define LIS2DW_WAKE_UP_THS_VAL_SLEEP_ON          0b01000000
 
 #define LIS2DW_REG_WAKE_UP_DUR 0x35