esp_efuse_rtc_calib.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 adc_unit ADC unit
  22. * @param atten Attenuation of the init code
  23. * @return The init code stored in efuse
  24. */
  25. uint16_t esp_efuse_rtc_calib_get_init_code(int version, uint32_t adc_unit, int atten);
  26. /**
  27. * @brief Get the calibration digits stored in the efuse, and the corresponding voltage.
  28. *
  29. * @param version Version of the stored efuse
  30. * @param adc_unit ADC unit
  31. * @param atten Attenuation to use
  32. * @param out_digi Output buffer of the digits
  33. * @param out_vol_mv Output of the voltage, in mV
  34. * @return
  35. * - ESP_ERR_INVALID_ARG: If efuse version or attenuation is invalid
  36. * - ESP_OK: if success
  37. */
  38. esp_err_t esp_efuse_rtc_calib_get_cal_voltage(int version, uint32_t adc_unit, int atten, uint32_t* out_digi, uint32_t* out_vol_mv);
  39. /**
  40. * @brief Get the temperature sensor calibration number delta_T stored in the efuse.
  41. *
  42. * @param version Version of the stored efuse
  43. *
  44. * @return The specification of temperature sensor calibration number in efuse.
  45. */
  46. float esp_efuse_rtc_calib_get_cal_temp(int version);
  47. #ifdef __cplusplus
  48. }
  49. #endif