/* Sensing chain FIFO stop values memorization at threshold level..  */
int32_t lsm6dso_fifo_stop_on_wtm_set(lsm6dso_ctx_t *ctx, uint8_t val)
/* Sensing chain FIFO stop values memorization at threshold level..  */
int32_t lsm6dso_fifo_stop_on_wtm_set(lsm6dso_ctx_t *ctx, uint8_t val)
{
  lsm6dso_fifo_ctrl2_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t*)&reg, 1);
  if (ret == 0) {
    reg.stop_on_wtm = val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t*)&reg, 1);
  }
  return ret;
}