/* Enables gyroscope digital high-pass filter. The filter is enabled only if the gyro is in HP mode..  */
int32_t lsm6dso_gy_hp_path_internal_set(lsm6dso_ctx_t *ctx, lsm6dso_hpm_g_t val)
/* Enables gyroscope digital high-pass filter. The filter is enabled only if the gyro is in HP mode..  */
int32_t lsm6dso_gy_hp_path_internal_set(lsm6dso_ctx_t *ctx, lsm6dso_hpm_g_t val)
{
  lsm6dso_ctrl7_g_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t*)&reg, 1);
  if (ret == 0) {
    reg.hp_en_g = ((uint8_t)val & 0x80U) >> 7;
    reg.hpm_g = (uint8_t)val & 0x03U;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t*)&reg, 1);
  }
  return ret;
}