cancel
Showing results for 
Search instead for 
Did you mean: 

Can we have wakeup recognition and single-tap recognition in the same time ?

CSo.1
Associate II

To set the wakeup thershold, I use WAKE_UP_THS and for single-tap I use the same functions as the example (https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lis2dw12_STdC/example/lis2dw12_tap_single.c). Morever, I set 0x01100000 in CTRL4_INT1_PAD_CTRL, to enable wakeup and single tap interrupts. And when I do that, the bit SINGLE_TAP in STATUS is never at 1, but when I set 0x01000000, it works.

11 REPLIES 11

Hi Cassandre @CSo.1​ ,

I'm sorry, you are right. So the fix was to set the LIR bit of register CTRL3 to have latched interrupt and adjust the wake up threshold.

regarding the libraries, the lis2dw12.c/h can be considered a wrapping of the most commonly used functions of lis2dw12_reg.c/h.

for example, I usually use functions from lis2dw12.c/h (or the ones from the sensor I'm working with) while programming and use general register writing/reading functions when I want to do something else.

Niccolò

p.s. if you select a "best answer" you can help future users with similar problems =)

Hi,

Ok thank you :)

Cassandre

p.s. ok it's done