esp_efuse_rtc_calib.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * SPDX-FileCopyrightText: 2020-2021 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 version Version of the stored efuse
  41. *
  42. * @return The specification of temperature sensor calibration number in efuse.
  43. */
  44. float esp_efuse_rtc_calib_get_cal_temp(int version);
  45. #ifdef __cplusplus
  46. }
  47. #endif