/* Mask DRDY on pin (both XL & Gyro) until filter settling ends (XL and Gyro independently masked)..  */
int32_t lsm6dso_filter_settling_mask_set(stmdev_ctx_t *ctx, uint8_t val)
/* Mask DRDY on pin (both XL & Gyro) until filter settling ends (XL and Gyro independently masked)..  */
int32_t lsm6dso_filter_settling_mask_set(stmdev_ctx_t *ctx, uint8_t val)
{
  lsm6dso_ctrl4_c_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&reg, 1);
  if (ret == 0) {
    reg.drdy_mask = val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&reg, 1);
  }
  return ret;
}