/* Measures the analog voltage or thermistor temperature from the Si7013 sensor  */
sl_status_t sl_si7013_measure_analog_voltage(sl_i2cspm_t *i2cspm, uint8_t addr, int32_t *vData)
/* Measures the analog voltage or thermistor temperature from the Si7013 sensor  */
sl_status_t sl_si7013_measure_analog_voltage(sl_i2cspm_t *i2cspm, uint8_t addr, int32_t *vData)
{
  sl_status_t retval;
  uint8_t device_id;
  sl_si70xx_present(i2cspm, addr, &device_id);
  if (device_id != SI7013_DEVICE_ID) {
    return SL_STATUS_FAIL;
  }
  sl_si70xx_write_user_register_2(i2cspm, addr, 0x0e);
  retval = sl_si70xx_send_command(i2cspm, addr, (uint32_t *) vData, SI7013_READ_VIN);
  if (retval != SL_STATUS_OK) {
    return retval;
  }
  sl_si70xx_write_user_register_2(i2cspm, addr, 0x09);
  return retval;
}