diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/AD5940.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/AD5940.h index e617db3ca..065dd19f9 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/AD5940.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/AD5940.h @@ -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); diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h index 104e2b37e..39769e6b5 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h @@ -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) { diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_def.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_def.h index c3ed62379..8b172caf9 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_def.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_def.h @@ -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) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h index 6e91d0f9c..2bb17cce0 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h @@ -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); } } diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h index fbfd21241..90c63a42e 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h @@ -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