/* Accelerometer analog chain bandwidth selection (only for accelerometer ODR ≥ 1.67 kHz)..  */
int32_t lsm6dsl_xl_filter_analog_set(stmdev_ctx_t *ctx, lsm6dsl_bw0_xl_t val)
/* Accelerometer analog chain bandwidth selection (only for accelerometer ODR ≥ 1.67 kHz)..  */
int32_t lsm6dsl_xl_filter_analog_set(stmdev_ctx_t *ctx, lsm6dsl_bw0_xl_t val)
{
  lsm6dsl_ctrl1_xl_t ctrl1_xl;
  int32_t ret;
  ret = lsm6dsl_read_reg(ctx, LSM6DSL_CTRL1_XL, (uint8_t*)&ctrl1_xl, 1);
  if(ret == 0){
    ctrl1_xl.bw0_xl = (uint8_t) val;
    ret = lsm6dsl_write_reg(ctx, LSM6DSL_CTRL1_XL, (uint8_t*)&ctrl1_xl, 1);
  }
  return ret;
}