curve_fitting_coefficients.h 922 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include "esp_adc/adc_cali_scheme.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef struct {
  13. uint8_t term_num; ///< Term number of the algorithm formula
  14. const uint64_t (*coeff)[2]; ///< Coeff of each term. See `adc_error_coef_atten` for details (and the magic number 2)
  15. const int32_t (*sign); ///< Sign of each term
  16. } cali_chars_second_step_t;
  17. /**
  18. * @brief Assign the second step coefficients for curve calibration
  19. *
  20. * @param config the curve fitting configuration
  21. * @param ctx the context pointer of the second step configuration structure
  22. */
  23. void curve_fitting_get_second_step_coeff(const adc_cali_curve_fitting_config_t *config, cali_chars_second_step_t *ctx);
  24. #ifdef __cplusplus
  25. }
  26. #endif