esp_efuse_rtc_calib.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <esp_types.h>
  7. #include <esp_err.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /**
  12. * @brief Get the RTC calibration efuse version
  13. *
  14. * @return Version of the stored efuse
  15. */
  16. int esp_efuse_rtc_calib_get_ver(void);
  17. /**
  18. * @brief Get the init code in the efuse, for the corresponding attenuation.
  19. *
  20. * @param version Version of the stored efuse
  21. * @param atten Attenuation of the init code
  22. * @return The init code stored in efuse
  23. */
  24. uint16_t esp_efuse_rtc_calib_get_init_code(int version, int atten);
  25. /**
  26. * @brief Get the calibration digits stored in the efuse, and the corresponding voltage.
  27. *
  28. * @param version Version of the stored efuse
  29. * @param atten Attenuation to use
  30. * @param out_digi Output buffer of the digits
  31. * @param out_vol_mv Output of the voltage, in mV
  32. * @return
  33. * - ESP_ERR_INVALID_ARG: If efuse version or attenuation is invalid
  34. * - ESP_OK: if success
  35. */
  36. esp_err_t esp_efuse_rtc_calib_get_cal_voltage(int version, int atten, uint32_t* out_digi, uint32_t* out_vol_mv);
  37. /**
  38. * @brief Get the temperature sensor calibration number delta_T stored in the efuse.
  39. *
  40. * @param tsens_cal Pointer of the specification of temperature sensor calibration number in efuse.
  41. *
  42. * @return ESP_OK if get the calibration value successfully.
  43. * ESP_ERR_INVALID_ARG if can't get the calibration value.
  44. */
  45. esp_err_t esp_efuse_rtc_calib_get_tsens_val(float* tsens_cal);
  46. #ifdef __cplusplus
  47. }
  48. #endif