From f69fd4a40f090aa73dd1c21b18ee19c00953285a Mon Sep 17 00:00:00 2001 From: yichin Date: Fri, 24 May 2019 16:29:32 +0800 Subject: [PATCH] save --- python_test_code/devlib/main.py | 16 ++++++++--- .../cc26xx/app/headstage/headstage_sti.h | 27 ++++--------------- .../cc26xx/app/headstage/sti/headstage_pin.h | 2 +- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/python_test_code/devlib/main.py b/python_test_code/devlib/main.py index 66abcd6ce..b8abc146b 100644 --- a/python_test_code/devlib/main.py +++ b/python_test_code/devlib/main.py @@ -1,5 +1,15 @@ from devlib.util import print_instruction +STI_WAVEFORM_POS = 0x00 +STI_WAVEFORM_NEG = 0x01 +STI_WAVEFORM_P2N = 0x02 +STI_WAVEFORM_N2P = 0x03 + +STI_PRECISION_10 = 0 +STI_PRECISION_01 = 1 + +STI_NUM_INFINITE = 1000 + STI_INSTRUCTION = { 'GLOBAL': '3b001#header#;1b0;12bCURRENT', 'LOCAL': '3b010#header;1b0;4b>CHANNEL;3b>STI_MODE;1b>PRECISION;12b>STI_FREQ;10b>STI_PW;10b>STI_PW_IPI;10b>STI_NUM' @@ -8,12 +18,12 @@ STI_INSTRUCTION = { STI_PARAMETER = { 'CURRENT': 10, # uA 'CHANNEL': 0, - 'STI_MODE': 3, - 'PRECISION': 0, + 'STI_MODE': STI_WAVEFORM_POS, + 'PRECISION': STI_PRECISION_10, 'STI_FREQ': 10, # Hz 'STI_PW': 10, # us 'STI_PW_IPI': 10, # us - 'STI_NUM': 1000, + 'STI_NUM': STI_NUM_INFINITE, } print_instruction(STI_INSTRUCTION['GLOBAL'], STI_PARAMETER) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti.h index e2211e153..f77bed28e 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti.h @@ -316,30 +316,16 @@ static uint8_t headstage_debug_instruction(uint8_t *ins_buf) { ins[1] = 0x0A; headstage_update_ris_instruction(2, ins); ins[0] = 0x40; - ins[1] = 0x60; + ins[1] = 0x00; ins[2] = 0x0A; ins[3] = 0x02; ins[4] = 0x80; ins[5] = 0xAF; ins[6] = 0xA0; headstage_update_ris_instruction(7, ins); - - headstage_sti_gptimer_init(CHANNEL_STI_0); - - NeuLiveStiChanelState * s = &(INSTRUCTION.state[CHANNEL_STI_0]); - - ins_buf[0] = s->pol; - ins_buf[1] = s->pon; - ins_buf[2] = s->polv; - ins_buf[3] = s->ponv; - ins_buf[4] = 0; - - return 5; - } - - case 0x01: { headstage_update_vis_instruction(VIS_STI); - break; + + return; } case DEBUG_INS_TIMES: @@ -542,9 +528,6 @@ static void headstage_gptimer_perd_callback(GPTimerCC26XX_Handle handle, GPTimer p->times--; } - headstage_debug_buffer[1] = debug_counter++; - headstage_set_debug_information(); - // stage = 0 s->stage = 0; uint16_t timeout_us = s->timeout_us[0]; @@ -571,7 +554,7 @@ static void headstage_gptimer_perd_callback(GPTimerCC26XX_Handle handle, GPTimer return; } else if (timeout_us <= LIMIT_TIMEOUT_US) { // use cpu delay instead - headstage_cpu_delay_us(timeout_us); + headstage_cpu_delay_us(timeout_us - 4); s->stage = 2; } else { headstage_gptimer_set_load_value(g, s->load_value[1]); @@ -588,7 +571,7 @@ static void headstage_gptimer_perd_callback(GPTimerCC26XX_Handle handle, GPTimer return; } else if (timeout_us <= LIMIT_TIMEOUT_US) { // use cpu delay instead - headstage_cpu_delay_us(timeout_us); + headstage_cpu_delay_us(timeout_us - 4); s->stage = 3; } else { headstage_gptimer_set_load_value(g, s->load_value[2]); diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/sti/headstage_pin.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/sti/headstage_pin.h index 3d921b873..c158714a9 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/sti/headstage_pin.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/sti/headstage_pin.h @@ -44,4 +44,4 @@ static PIN_Config headstage_pin_configuration[] = { // // PIN_TERMINATE}; -#endif // HEADSTAGE_PIN_STI_H \ No newline at end of file +#endif // HEADSTAGE_PIN_STI_H