From ba29ac9418a8a2ddf2014014e4a0d9e3fdfd4d64 Mon Sep 17 00:00:00 2001 From: JayC319 Date: Thu, 11 Aug 2022 10:46:15 +0800 Subject: [PATCH] [update] changes on DAC_VOUT --- .../cc26xx/app/headstage/EliteLED.h | 2 +- .../cc26xx/app/headstage/EliteWorkData.h | 2 +- .../cc26xx/app/headstage/Elite_def.h | 2 +- .../cc26xx/app/headstage/Elite_version.h | 6 ++-- .../cc26xx/app/headstage/headstage.h | 29 +++++++++++++++---- .../cc26xx/app/headstage/impedance_meter.h | 12 ++++---- 6 files changed, 35 insertions(+), 18 deletions(-) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteLED.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteLED.h index 2159fdb..c1dff0b 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteLED.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteLED.h @@ -94,7 +94,7 @@ static void WorkModeLED() led_color_set(LED_NB_MAX, LED_BR_LV1, LED_CLR_CYAN); break; - case CURVE_CALI_ADC: + case CURVE_CALI: if (instru.AdcChannel == RIS_ADC_IIN) { led_color_set(LED_NB_MAX, LED_BR_LV1, LED_CLR_RED); } else if (instru.AdcChannel == RIS_ADC_VIN) { diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteWorkData.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteWorkData.h index 082fdcd..11c53cd 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteWorkData.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteWorkData.h @@ -791,7 +791,7 @@ int wm_init(void) case CURVE_DPV_ADVANCE_SMPRATE: if (__dpv_advance_create()) return -2; break; - case CURVE_CALI_ADC: + case CURVE_CALI: if (__adc_cali_create()) return -2; break; 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 cb9e14b..bb5eeef 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 @@ -38,7 +38,7 @@ enum all_mode_e { CURVE_DPV_ADVANCE = 0x10, CURVE_DPV_ADVANCE_SMPRATE = 0x11, - CURVE_CALI_ADC = 0xF1, // 0xF1 + CURVE_CALI = 0xF1, // 0xF1 SET_SAMPLE_RATE = 0xE0, diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h index ebc3234..1deb89e 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h @@ -4,9 +4,9 @@ #define VERSION_DATE_YEAR 22 #define VERSION_DATE_MONTH 8 -#define VERSION_DATE_DAY 10 -#define VERSION_DATE_HOUR 18 -#define VERSION_DATE_MINUTE 08 +#define VERSION_DATE_DAY 11 +#define VERSION_DATE_HOUR 10 +#define VERSION_DATE_MINUTE 46 // this is NOT the version hash !! // it's the last version hash 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 d5a51e0..138de71 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 @@ -924,28 +924,45 @@ static void update_ZM_instruction(uint8 *ins) { break; } - case CURVE_CALI_ADC: { + case CURVE_CALI: { switch(ins[3]) { case RIS_ADC_IIN : { // 0x00 - instru.eliteFxn = CURVE_CALI_ADC; + instru.eliteFxn = CURVE_CALI; instru.AdcChannel = RIS_ADC_IIN; instru.notifyRate = 1000; ModeLED(WORKING); break; } case RIS_ADC_VIN : { // 0x01 - instru.eliteFxn = CURVE_CALI_ADC; + instru.eliteFxn = CURVE_CALI; instru.AdcChannel = RIS_ADC_VIN; instru.notifyRate = 1000; ModeLED(WORKING); break; } case RIS_DAC_VOUT : { // 0x02 - instru.eliteFxn = CURVE_CALI_ADC; + instru.eliteFxn = CURVE_CALI; instru.AdcChannel = RIS_DAC_VOUT; instru.notifyRate = 1000; - instru.VoltConstant = ( ((uint16_t)(ins[4])) << 8) | (uint16_t)(ins[5]); // output voltage - + + switch(ins[4]) { + case 0x00: { + instru.VoltConstant = 0x2710; + break; + } + case 0x01: { + instru.VoltConstant = 0x61A8; + break; + } + case 0x02: { + instru.VoltConstant = 0xC350; + break; + } + case 0x03: { + instru.VoltConstant = 0xEA60; + break; + } + } ModeLED(WORKING); break; } diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h index 39d2cc3..bb1bd5a 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h @@ -86,7 +86,7 @@ static void ZM_init() { (instru.eliteFxn == CURVE_CA) || \ (instru.eliteFxn == CURVE_VO) || \ (instru.eliteFxn == CURVE_OCP) || \ -(instru.eliteFxn == CURVE_CALI_ADC) \ +(instru.eliteFxn == CURVE_CALI) \ ) #define Ve1MatchVe2Mode() ( \ @@ -151,7 +151,7 @@ static void peri_mode(void) (instru.eliteFxn == CURVE_DPV_SMPRATE) || (instru.eliteFxn == CURVE_DPV_ADVANCE) || (instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) || - (instru.eliteFxn == CURVE_CALI_ADC)) { + (instru.eliteFxn == CURVE_CALI)) { batteryCheck_flag = false; tempCheck_flag = false; @@ -255,7 +255,7 @@ static void uni_pulse_mode(void) (instru.eliteFxn == CURVE_DPV_SMPRATE) || (instru.eliteFxn == CURVE_DPV_ADVANCE) || (instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) || - (instru.eliteFxn == CURVE_CALI_ADC)) { + (instru.eliteFxn == CURVE_CALI)) { batteryCheck_flag = false; tempCheck_flag = false; @@ -352,7 +352,7 @@ static void mode_init_set(void) IinADCGainCtrl(instru.IinADCGainLv); VoutGainControl(instru.VoutGainLv); - // if(instru.eliteFxn == CURVE_CALI_ADC) { + // if(instru.eliteFxn == CURVE_CALI) { // volt_rec_en = true; // curr_rec_en = true; // } @@ -560,7 +560,7 @@ static void EliteADCControl(uint32_t time) } break; - case CURVE_CALI_ADC: + case CURVE_CALI: if (instru.AdcChannel == RIS_ADC_IIN) { cali_IT_plot(); @@ -622,7 +622,7 @@ static void mode_done(void) (instru.eliteFxn == CURVE_DPV_SMPRATE) || (instru.eliteFxn == CURVE_DPV_ADVANCE) || (instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) || - (instru.eliteFxn == CURVE_CALI_ADC)) + (instru.eliteFxn == CURVE_CALI)) { if (!PeriodicEvent) { finishMode = true;