DIfference between interrupt get and set
I was taking a look at this repository to get a bit used with the lis2dw12 accelerometer.
Trying to use the Activity example I've got the expected results but got a bit confused with the routing of the detection to the interrupt pin. From line 185 on it does the following:
/* Enable activity detection interrupt */
lis2dw12_pin_int1_route_get(&dev_ctx, &int_route.ctrl4_int1_pad_ctrl);
int_route.ctrl4_int1_pad_ctrl.int1_wu = PROPERTY_ENABLE;
lis2dw12_pin_int1_route_set(&dev_ctx, &int_route.ctrl4_int1_pad_ctrl);What is the difference between "lis2dw12_pin_int1_route_get" and "lis2dw12_pin_int1_route_set". In my understanting this part of the code is just routing the Wake up bit to the Ctrl4_Int1_pad_ctrl but what is the "route_get" command doing?
Looking inside the function it only reads the current state of the register, is there any particular reason for this?
int32_t lis2dw12_pin_int1_route_get(stmdev_ctx_t *ctx,
lis2dw12_ctrl4_int1_pad_ctrl_t *val)
{
int32_t ret;
ret = lis2dw12_read_reg(ctx, LIS2DW12_CTRL4_INT1_PAD_CTRL,
(uint8_t*) val, 1);
return ret;
}