30 lines
690 B
C
30 lines
690 B
C
#pragma once
|
|
#ifndef __ELITE_DEVICE_CORRECTION_H__
|
|
#define __ELITE_DEVICE_CORRECTION_H__
|
|
|
|
#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);
|
|
|
|
#endif // !__ELITE_DEVICE_CORRECTION_H__
|