esp_efuse_rtc_calib.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2020 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at",
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License
  14. #include <esp_types.h>
  15. #include <esp_err.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * @brief Get the RTC calibration efuse version
  21. *
  22. * @return Version of the stored efuse
  23. */
  24. int esp_efuse_rtc_calib_get_ver(void);
  25. /**
  26. * @brief Get the init code in the efuse, for the corresponding attenuation.
  27. *
  28. * @param version Version of the stored efuse
  29. * @param atten Attenuation of the init code
  30. * @return The init code stored in efuse
  31. */
  32. uint16_t esp_efuse_rtc_calib_get_init_code(int version, int atten);
  33. /**
  34. * @brief Get the calibration digits stored in the efuse, and the corresponding voltage.
  35. *
  36. * @param version Version of the stored efuse
  37. * @param atten Attenuation to use
  38. * @param out_digi Output buffer of the digits
  39. * @param out_vol_mv Output of the voltage, in mV
  40. * @return
  41. * - ESP_ERR_INVALID_ARG: If efuse version or attenuation is invalid
  42. * - ESP_OK: if success
  43. */
  44. esp_err_t esp_efuse_rtc_calib_get_cal_voltage(int version, int atten, uint32_t* out_digi, uint32_t* out_vol_mv);
  45. /**
  46. * @brief Get the temperature sensor calibration number delta_T stored in the efuse.
  47. *
  48. * @param version Version of the stored efuse
  49. *
  50. * @return The specification of temperature sensor calibration number in efuse.
  51. */
  52. float esp_efuse_rtc_calib_get_cal_temp(int version);
  53. #ifdef __cplusplus
  54. }
  55. #endif