/* Duration to go in sleep mode. 1 LSb = 512 / ODR.  */
int32_t lsm6dso_act_sleep_dur_get(lsm6dso_ctx_t *ctx, uint8_t *val)
/* Duration to go in sleep mode. 1 LSb = 512 / ODR.  */
int32_t lsm6dso_act_sleep_dur_get(lsm6dso_ctx_t *ctx, uint8_t *val)
{
  lsm6dso_wake_up_dur_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t*)&reg, 1);
  *val = reg.sleep_dur;
  return ret;
}