LPTIA ADC notify okay; LPTIA gain control function no no, still need to figure out...
This commit is contained in:
+4
-4
@@ -141,8 +141,8 @@ static void HS_cali_config (void)
|
||||
|
||||
select_REG(DE0RESCON); //20F8 //DE0's gain
|
||||
w32_REG(0x000000FF);
|
||||
select_REG(HSRTIACON);
|
||||
w32_REG(0x00000200); //4pF + 200R
|
||||
// select_REG(HSRTIACON);
|
||||
// w32_REG(0x00000200); //4pF + 200R
|
||||
|
||||
select_REG(ADCCON); //21A8
|
||||
w32_REG(0x00000101);
|
||||
@@ -191,9 +191,9 @@ static void LP_cali_config (void)
|
||||
select_REG(LPDACSW0); //LPDACSW0
|
||||
w32_REG(0x0000003E);
|
||||
select_REG(LPTIASW0); //LPTIASW0
|
||||
w32_REG(0x00008034); // SW2 | SW4 | SW5
|
||||
w32_REG(0x000002B4); // SW2 | SW4 | SW5
|
||||
select_REG(LPTIACON0); //LPTIACON0
|
||||
w32_REG(0x00000038); //RF 0 | RTIA 200R | Rload 0 | High Current Mode
|
||||
w32_REG(0x00002038); //RF 0 | RTIA 200R | Rload 0 | High Current Mode
|
||||
select_REG(LPDACCON0); //LPDACCON0
|
||||
w32_REG(0x00000001);
|
||||
|
||||
|
||||
+1
-1
@@ -227,7 +227,7 @@ static void LPTIAGainCtrl(uint8_t ret){
|
||||
|
||||
mask = (31 << 5); //mask bit[9:5]
|
||||
|
||||
select_REG(0x20EC); //LPTIACON0
|
||||
select_REG(LPTIACON0); //LPTIACON0
|
||||
code = r32_REG();
|
||||
|
||||
if (ret == LPRTIA_200R) {
|
||||
|
||||
+6
-6
@@ -39,13 +39,13 @@ enum all_mode_e {
|
||||
CURVE_EIS_CV = 0xD2,
|
||||
|
||||
CURVE_CALI_DAC = 0xF0, //0x93,
|
||||
CURVE_CALI_ADC = 0xF1, // Cali ADC - test //0x92,
|
||||
// CURVE_CALI_ADC = 0x92, // Cali ADC - test //0x92,
|
||||
// CURVE_CALI_ADC = 0xF1, // Cali ADC - test //0x92,
|
||||
CURVE_CALI_ADC = 0x92, // Cali ADC - test //0x92,
|
||||
|
||||
SET_SAMPLE_RATE = 0xE0, //0x70,
|
||||
// SET_SAMPLE_RATE = 0x70, //0x70,
|
||||
SET_ADC_DAC_GAIN = 0xE1, //0x80,
|
||||
// SET_ADC_DAC_GAIN = 0x80, //0x80,
|
||||
// SET_SAMPLE_RATE = 0xE0, //0x70,
|
||||
SET_SAMPLE_RATE = 0x70, //0x70,
|
||||
// SET_ADC_DAC_GAIN = 0xE1, //0x80,
|
||||
SET_ADC_DAC_GAIN = 0x80, //0x80,
|
||||
};
|
||||
|
||||
// CIS (control instruction)
|
||||
|
||||
+23
-16
@@ -654,7 +654,6 @@ static void cali_IT_plot(void) {
|
||||
static uint8_t ADC_cnt = 0;
|
||||
static uint8_t rec_cnt = 0;
|
||||
static uint16_t cali_count_max = 5000;
|
||||
static uint8_t gain = 0;
|
||||
int32_t ADCValueAVG = 0;
|
||||
int32_t temp = 0;
|
||||
|
||||
@@ -670,19 +669,26 @@ static void cali_IT_plot(void) {
|
||||
temp = (ReadRawADC() & 0x0000FFFF);
|
||||
}
|
||||
|
||||
if (instru.AdcChannel == EIS_HSTIA) {
|
||||
gain = instru.HSTIAGainLv;
|
||||
if (instru.HSTIAGainLv == 0) {
|
||||
cali_count_max = 5000;
|
||||
} else {
|
||||
cali_count_max = 1000;
|
||||
switch (instru.AdcChannel) {
|
||||
case EIS_HSTIA: {
|
||||
if (instru.HSTIAGainLv == 0) {
|
||||
cali_count_max = 5000;
|
||||
} else {
|
||||
cali_count_max = 1000;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (instru.AdcChannel == EIS_LPTIA) {
|
||||
gain = instru.LPTIAGainLv;
|
||||
if (instru.LPTIAGainLv == 0) {
|
||||
cali_count_max = 5000;
|
||||
} else {
|
||||
case EIS_LPTIA: {
|
||||
if (instru.LPTIAGainLv == 0) {
|
||||
cali_count_max = 5000;
|
||||
} else {
|
||||
cali_count_max = 1000;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
cali_count_max = 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,6 +699,7 @@ static void cali_IT_plot(void) {
|
||||
ADCValueAVG = ADCValueSUM / cali_count;
|
||||
|
||||
InputNotify(NOTIFY_CURRENT, ADCValueAVG);
|
||||
InputNotify(NOTIFY_VOLT, ADCValueAVG);
|
||||
SendNotify();
|
||||
|
||||
uint8_t CIS_buf[9] = {0};
|
||||
@@ -700,7 +707,7 @@ static void cali_IT_plot(void) {
|
||||
CIS_buf[1] = (uint8_t) ((ADCValueAVG & 0xFF00) >> 8);
|
||||
CIS_buf[2] = (uint8_t) (ADCValueAVG & 0x00FF);
|
||||
CIS_buf[3] = 0x00;
|
||||
CIS_buf[4] = gain;
|
||||
CIS_buf[4] = instru.HSTIAGainLv;
|
||||
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, 9, CIS_buf);
|
||||
|
||||
PeriodicEvent = false;
|
||||
@@ -710,9 +717,9 @@ static void cali_IT_plot(void) {
|
||||
} else {
|
||||
cali_count++;
|
||||
ADCValueSUM = ADCValueSUM + temp;
|
||||
InputNotify(NOTIFY_CURRENT, temp);
|
||||
InputNotify(NOTIFY_VOLT, ADCValueSUM);
|
||||
InputNotify(NOTIFY_IMPEDANCE, (int32_t)cali_count);
|
||||
InputNotify(NOTIFY_CURRENT, temp);
|
||||
InputNotify(NOTIFY_VOLT, temp);
|
||||
// InputNotify(NOTIFY_IMPEDANCE, (int32_t)cali_count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -440,9 +440,9 @@ characteristic change event
|
||||
// product information
|
||||
#define DEVICE_NAME "Elite"
|
||||
#define MAJOR_PRODUCT_NUMBER 0 //0:Elite ,1:Neulive
|
||||
#define MINOR_PRODUCT_NUMBER 4 //1:Elite_legacy(Ori_Neulive) 2:Elite_zm 3:Elite_bat 4:Elite_EIS
|
||||
#define MINOR_PRODUCT_NUMBER 2 //1:Elite_legacy(Ori_Neulive) 2:Elite_zm 3:Elite_bat 4:Elite_EIS
|
||||
#define MAJOR_VERSION_NUMBER 1
|
||||
#define MINOR_VERSION_NUMBER 0
|
||||
#define MINOR_VERSION_NUMBER 6
|
||||
#define ELITE_VERSION_EIS
|
||||
//#define ELITE_VERSION_1_4
|
||||
//#define ELITE_VERSION_1_3
|
||||
|
||||
Reference in New Issue
Block a user