/* The Reference pressure value is a 16-bit data expressed as 2’s complement. The value is used when AUTOZERO or AUTORIFP function is enabled..  */
int32_t lps22hh_pressure_ref_set(stmdev_ctx_t *ctx, int16_t val)
/* The Reference pressure value is a 16-bit data expressed as 2’s complement. The value is used when AUTOZERO or AUTORIFP function is enabled..  */
int32_t lps22hh_pressure_ref_set(stmdev_ctx_t *ctx, int16_t val)
{
  uint8_t buff[2];
  int32_t ret;
  buff[1] = (uint8_t) ((uint16_t)val / 256U);
  buff[0] = (uint8_t) ((uint16_t)val - (buff[1] * 256U));
  ret = lps22hh_write_reg(ctx, LPS22HH_REF_P_L, buff, 2);
  return ret;
}