2022-07-15 00:52:44 -04:00
|
|
|
/*
|
2023-06-21 01:31:16 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
|
2022-07-15 00:52:44 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
2023-06-21 01:31:16 -04:00
|
|
|
#include "esp_adc/adc_cali_scheme.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2022-07-15 00:52:44 -04:00
|
|
|
|
2023-06-21 01:31:16 -04:00
|
|
|
typedef struct {
|
|
|
|
uint8_t term_num; ///< Term number of the algorithm formula
|
2023-06-25 23:52:25 -04:00
|
|
|
const uint64_t (*coeff)[2]; ///< Coeff of each term. See `adc_error_coef_atten` for details (and the magic number 2)
|
|
|
|
const int32_t (*sign); ///< Sign of each term
|
2023-06-21 01:31:16 -04:00
|
|
|
} cali_chars_second_step_t;
|
|
|
|
|
2022-07-15 00:52:44 -04:00
|
|
|
/**
|
2023-06-21 01:31:16 -04:00
|
|
|
* @brief Assign the second step coefficients for curve calibration
|
2022-07-15 00:52:44 -04:00
|
|
|
*
|
2023-06-21 01:31:16 -04:00
|
|
|
* @param config the curve fitting configuration
|
|
|
|
* @param ctx the context pointer of the second step configuration structure
|
2022-07-15 00:52:44 -04:00
|
|
|
*/
|
2023-06-21 01:31:16 -04:00
|
|
|
void curve_fitting_get_second_step_coeff(const adc_cali_curve_fitting_config_t *config, cali_chars_second_step_t *ctx);
|
2022-07-15 00:52:44 -04:00
|
|
|
|
2023-06-21 01:31:16 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|