2024-03-08 01:31:19 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <esp_bit_defs.h>
|
|
|
|
#include "esp_efuse.h"
|
|
|
|
#include "esp_efuse_table.h"
|
|
|
|
#include "esp_efuse_rtc_calib.h"
|
|
|
|
#include "hal/efuse_hal.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the signed value by the raw data that read from eFuse
|
|
|
|
* @param data The raw data that read from eFuse
|
|
|
|
* @param sign_bit The index of the sign bit, start from 0
|
|
|
|
*/
|
|
|
|
#define RTC_CALIB_GET_SIGNED_VAL(data, sign_bit) ((data & BIT##sign_bit) ? -(int)(data & ~BIT##sign_bit) : (int)data)
|
|
|
|
|
|
|
|
int esp_efuse_rtc_calib_get_ver(void)
|
|
|
|
{
|
|
|
|
uint32_t cali_version = 0;
|
2024-03-13 16:51:44 -04:00
|
|
|
// TODO: [ESP32C61] IDF-9303
|
|
|
|
abort();
|
2024-03-08 01:31:19 -05:00
|
|
|
|
|
|
|
return cali_version;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t esp_efuse_rtc_calib_get_init_code(int version, uint32_t adc_unit, int atten)
|
|
|
|
{
|
2024-03-13 16:51:44 -04:00
|
|
|
// TODO: [ESP32C61] IDF-9303
|
|
|
|
abort();
|
|
|
|
return 0;
|
2024-03-08 01:31:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
int esp_efuse_rtc_calib_get_chan_compens(int version, uint32_t adc_unit, uint32_t adc_channel, int atten)
|
|
|
|
{
|
2024-03-13 16:51:44 -04:00
|
|
|
// TODO: [ESP32C61] IDF-9303
|
|
|
|
abort();
|
|
|
|
return 0;
|
2024-03-08 01:31:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2024-03-13 16:51:44 -04:00
|
|
|
// TODO: [ESP32C61] IDF-9303
|
|
|
|
abort();
|
2024-03-08 01:31:19 -05:00
|
|
|
return ESP_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
esp_err_t esp_efuse_rtc_calib_get_tsens_val(float* tsens_cal)
|
|
|
|
{
|
2024-03-13 16:51:44 -04:00
|
|
|
// TODO: [ESP32C61] IDF-9303
|
|
|
|
abort();
|
|
|
|
// Currently calibration is not supported on ESP32-C5, IDF-5236
|
2024-03-08 01:31:19 -05:00
|
|
|
*tsens_cal = 0;
|
|
|
|
return ESP_OK;
|
|
|
|
}
|