2021-05-31 00:43:23 -04:00
|
|
|
/*
|
2022-03-04 05:04:20 -05:00
|
|
|
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
2021-05-31 00:43:23 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-12-22 23:29:57 -05:00
|
|
|
|
|
|
|
#include <esp_types.h>
|
|
|
|
#include <esp_err.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-12-15 01:15:32 -05:00
|
|
|
//This is the ADC calibration value version burnt in efuse
|
|
|
|
#define ESP_EFUSE_ADC_CALIB_VER 1
|
|
|
|
|
2020-12-22 23:29:57 -05:00
|
|
|
/**
|
|
|
|
* @brief Get the RTC calibration efuse version
|
|
|
|
*
|
|
|
|
* @return Version of the stored efuse
|
|
|
|
*/
|
|
|
|
int esp_efuse_rtc_calib_get_ver(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the init code in the efuse, for the corresponding attenuation.
|
|
|
|
*
|
2021-12-15 01:15:32 -05:00
|
|
|
* @param version Version of the stored efuse
|
|
|
|
* @param adc_unit ADC unit. Not used, for compatibility. On esp32c3, for calibration v1, both ADC units use the same init code (calibrated by ADC1)
|
|
|
|
* @param atten Attenuation of the init code
|
2020-12-22 23:29:57 -05:00
|
|
|
* @return The init code stored in efuse
|
|
|
|
*/
|
2021-12-15 01:15:32 -05:00
|
|
|
uint32_t esp_efuse_rtc_calib_get_init_code(int version, uint32_t adc_unit, int atten);
|
2020-12-22 23:29:57 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the calibration digits stored in the efuse, and the corresponding voltage.
|
|
|
|
*
|
|
|
|
* @param version Version of the stored efuse
|
|
|
|
* @param atten Attenuation to use
|
|
|
|
* @param out_digi Output buffer of the digits
|
|
|
|
* @param out_vol_mv Output of the voltage, in mV
|
|
|
|
* @return
|
|
|
|
* - ESP_ERR_INVALID_ARG: If efuse version or attenuation is invalid
|
|
|
|
* - ESP_OK: if success
|
|
|
|
*/
|
|
|
|
esp_err_t esp_efuse_rtc_calib_get_cal_voltage(int version, int atten, uint32_t* out_digi, uint32_t* out_vol_mv);
|
|
|
|
|
2021-01-13 08:23:08 -05:00
|
|
|
/**
|
|
|
|
* @brief Get the temperature sensor calibration number delta_T stored in the efuse.
|
|
|
|
*
|
2022-03-04 05:04:20 -05:00
|
|
|
* @param tsens_cal Pointer of the specification of temperature sensor calibration number in efuse.
|
2021-01-13 08:23:08 -05:00
|
|
|
*
|
2022-03-04 05:04:20 -05:00
|
|
|
* @return ESP_OK if get the calibration value successfully.
|
|
|
|
* ESP_ERR_INVALID_ARG if can't get the calibration value.
|
2021-01-13 08:23:08 -05:00
|
|
|
*/
|
2022-03-04 05:04:20 -05:00
|
|
|
esp_err_t esp_efuse_rtc_calib_get_tsens_val(float* tsens_cal);
|
2021-01-13 08:23:08 -05:00
|
|
|
|
2020-12-22 23:29:57 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|