I am using the nrf9160dk and an ST lis2dw12 accelerometer. I want to be able to set up an interrupt to fire on an anymotion event. From what I understand from the nrf-connect-sdk fundamentals course, I need to configure my device tree overlay like this:
```cpp
&i2c2 {
lis2dw12: lis2dw12@19{
compatible = "st,lis2dw12";
status = "okay";
reg = < 0x19 >;
label="LIS2DW12";
irq-gpios=<&gpio0 15 GPIO_ACTIVE_HIGH>;
//was 1
int-pin=<2>;
range=<2>;
power-mode=<0>;
};
};
&gpio0 {
status = "okay";
//use SENSE for low power consumption on interrupt pin
sense-edge-mask = < (1 << 15) >;
};
```
I'm not quite sure how to set the interrupts correctly in the main program however. If I try to call `sensor_trigger_set(accelerometer, &trig, some_trigger_handler);`, where trig.type is SENSOR_TRIG_DELTA, I receive -88 as the return code (which corresponds to ENOSYS?)
Also, I am not sure how this SENSOR_TRIG_DELTA is measured. According to ST's datasheet, this can be done on the MEMS accelerometer itself (for low-power wakeup applications), but I am worried that the implementation may require constant polling.
Note: I am able to use sensor_sample_fetch and sensor_channel_get to measure the current acceleration values, so I2C works.