diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteInstruction.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteInstruction.h index 7f4795130..3fb92e1f0 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteInstruction.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteInstruction.h @@ -115,6 +115,10 @@ struct HEADSTAGE_INSTRUCTION { bool output_5v_en0; bool output_5v_en1; + /** trigger mode enable **/ + bool trig0_en; + bool trig1_en; + } INSTRUCTION = {0}; /********************************************************************* 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 63336576c..4eab8f58a 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 @@ -260,7 +260,7 @@ static void WorkModeLED() { case VT_CURVE: case IT_CURVE: case ADC_TEST:{ - SET_LED_CHAN(chan_en, WORKING); + SET_LED_CHAN(TRC.chan_en, WORKING); break; } case CYCLIC_VOLTAMMETRY: @@ -400,22 +400,22 @@ static void SET_LED_CHAN(bool *chan_en, uint16_t modeStatus){ uint8_t trig_chan = 0; for (int i=0; i> 4); INSTRUCTION.tri_d0 = (bool) (ins[3] & 0x0F); @@ -1083,25 +1089,25 @@ static void update_ZM_instruction(uint8 *ins) { INSTRUCTION.tri_d1 = 0; } - chan_en[0] = INSTRUCTION.tri_pr0; - chan_en[1] = INSTRUCTION.tri_d0; - chan_en[2] = INSTRUCTION.tri_a0; - chan_en[3] = INSTRUCTION.tri_a2; - chan_en[4] = INSTRUCTION.tri_a3; - chan_en[5] = INSTRUCTION.tri_a1; - chan_en[6] = INSTRUCTION.tri_d1; - chan_en[7] = INSTRUCTION.tri_pr1; - chan_en[8] = INSTRUCTION.output_5v_en0; - chan_en[9] = INSTRUCTION.output_5v_en1; + TRC.chan_en[0] = INSTRUCTION.tri_pr0; + TRC.chan_en[1] = INSTRUCTION.tri_d0; + TRC.chan_en[2] = INSTRUCTION.tri_a0; + TRC.chan_en[3] = INSTRUCTION.tri_a2; + TRC.chan_en[4] = INSTRUCTION.tri_a3; + TRC.chan_en[5] = INSTRUCTION.tri_a1; + TRC.chan_en[6] = INSTRUCTION.tri_d1; + TRC.chan_en[7] = INSTRUCTION.tri_pr1; + TRC.chan_en[8] = INSTRUCTION.output_5v_en0; + TRC.chan_en[9] = INSTRUCTION.output_5v_en1; - SET_LED_CHAN(chan_en, NO_EVENT); -// set_output_enable(chan_en); + SET_LED_CHAN(TRC.chan_en, NO_EVENT); +// set_output_enable(TRC.chan_en); break; } case ADC_TEST: { // 0x91 INSTRUCTION.eliteFxn = ADC_TEST; - set_output_enable(chan_en); + set_output_enable(TRC.chan_en); // int32_t ADCRealValue = 0; uint8_t CIS_buf[9] = {0}; uint16_t ADCValueAVG_RAW = 0; @@ -1284,14 +1290,14 @@ static void update_ZM_instruction(uint8 *ins) { } break; } - +*/ case PULSE_MODE: { - INSTRUCTION.VoutGainLevel = VOUT_GAIN_240K; +// INSTRUCTION.VoutGainLevel = VOUT_GAIN_240K; INSTRUCTION.sampleRate = 15; INSTRUCTION.notifyRate = 100; INSTRUCTION.VoViSwitch = 0x01; if (ins[3] == PARA_1) { - PIN15_setOutputValue(HIGH_Z_MODE, 1); // 1 => close high_z mode +// PIN15_setOutputValue(HIGH_Z_MODE, 1); // 1 => close high_z mode // no HIGH_Z for TRIG01 INSTRUCTION.sti_t1 = (int32_t)(ins[4]) << 24 | (int32_t)(ins[5]) << 16 | (int32_t)(ins[6]) << 8 | (int32_t)(ins[7]); INSTRUCTION.sti_t2 = (int32_t)(ins[8]) << 24 | (int32_t)(ins[9]) << 16 | (int32_t)(ins[10]) << 8 | (int32_t)(ins[11]); @@ -1299,7 +1305,7 @@ static void update_ZM_instruction(uint8 *ins) { INSTRUCTION.sti_t4 = (int32_t)(ins[16]) << 24 | (int32_t)(ins[17]) << 16 | (int32_t)(ins[18]) << 8 | (int32_t)(ins[19]); } else if (ins[3] == PARA_2) { INSTRUCTION.sti_t5 = (int32_t)(ins[4]) << 24 | (int32_t)(ins[5]) << 16 | (int32_t)(ins[6]) << 8 | (int32_t)(ins[7]); - INSTRUCTION.sti_v1 = 25000; //8~11 + INSTRUCTION.sti_v1 = 25000; //8~11 INSTRUCTION.sti_v2 = 50000; //12~15 //41406.43161. INSTRUCTION.sti_v3 = 25000; //16~19 } else if (ins[3] == PARA_3) { @@ -1322,11 +1328,12 @@ static void update_ZM_instruction(uint8 *ins) { megaStiEnable = true; } else if (ins[3] == PARA_17) { INSTRUCTION.eliteFxn = PULSE_MODE; - ModeLED(WORKING); + set_output_enable(TRC.chan_en); +// ModeLED(WORKING); + ModeLED(TRIG01_WORK); } break; } -*/ default: { /** **/ break; @@ -1413,6 +1420,13 @@ static void update_ZM_instruction(uint8 *ins) { break; } + case VIS_TRIG_EN: { // 0x41 + INSTRUCTION.trig0_en = (bool) ((ins[2] & 0xF0) >> 4); + INSTRUCTION.trig1_en = (bool) (ins[2] & 0x0F); + trig_en_check(); + break; + } + default: { 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 ea11ad556..8f8660fda 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 @@ -47,6 +47,7 @@ static void ZM_init() { // initialize pin_handle = PIN_open(&ZM_rst, BLE_IO); InitLED(); + InitTrigChan(); Init_Elite15_PIN(); ELITE15_SPI_HOLD(); diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c index 2863685aa..f6fc9675d 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c @@ -640,11 +640,11 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) { EliteOn = TurnOnElite(key); } - FLT_sense(); trig_sense(); if (trig_PeriodicEvent) { - trig_PeriodicEvent = false; + trig_PeriodicEvent = false; + PeriodicEvent = true; } }