37 lines
729 B
C
37 lines
729 B
C
#ifndef __ELITE_CORRECTION_H__
|
|
#define __ELITE_CORRECTION_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
|
|
#define BOARD_EE_EF 1
|
|
|
|
struct formula_ctx_t
|
|
{
|
|
long long coeff;
|
|
long long offset;
|
|
};
|
|
|
|
struct correction_ctx_t
|
|
{
|
|
struct formula_ctx_t ADC_volt[3];
|
|
struct formula_ctx_t ADC_current[4];
|
|
struct formula_ctx_t Usercode2DAC[2];
|
|
struct formula_ctx_t ADC_Vout_volt[1];
|
|
uint16_t Gain0Boundary[2];
|
|
uint16_t Gain1Boundary[4];
|
|
uint16_t Gain2Boundary[2];
|
|
};
|
|
|
|
int32_t DecodeADCValue(uint8_t adc_gain, uint8_t adc_channel, uint16_t adc_rxbuf);
|
|
uint16_t Usercode_Correction_to_DAC(uint8_t dac_gain, uint16_t usercode);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ! __ELITE_CORRECTION_H__ */
|