test sti instruction

This commit is contained in:
weiting2
2020-02-18 11:47:01 +08:00
parent 4194730f9c
commit 7cda4c4dec
@@ -377,7 +377,7 @@ static uint8_t get_sti_channel(uint8_t sti_channel) {
return sti_ch;
}
}
return 0xFFFF;
return 0xFF;
}
/**
@@ -916,92 +916,92 @@ static void headstage_data_append_notify_buffer(uint8_t* dat_buf) {}
/**
* @fn read_neu_ins_config
*/
static void read_neu_ins_config(uint8_t config_type, uint32_t* value) {
uint8_t opcode;
switch (config_type) {
case NEU_SET_STI_CUR: {
uint8_t channel = get_sti_channel(INSTRUCTION.sti_channel);
opcode = channel * 4 + 1;
*value = opcode << 16;
break;
}
case NEU_SET_STI_VOLT: {
opcode = 0x25;
*value = opcode << 16;
break;
}
case NEU_SET_POLARITY: {
opcode = 0x28;
*value = opcode << 16;
break;
}
case NEU_SET_STI_CHANNEL: {
opcode = 0x2A;
*value = opcode << 16;
break;
}
case NEU_SET_GENERAL_EN: {
opcode = 0x2F;
*value = opcode << 16;
break;
}
case NEU_SET_REC_CHANNEL: {
opcode = 0x30;
*value = opcode << 16;
break;
}
case NEU_SET_AMP_GAIN: {
opcode = 0x31;
*value = opcode << 16;
break;
}
case NEU_SET_SYS_CLK: {
opcode = 0x32;
*value = opcode << 16;
break;
}
case NEU_SET_ADC_CLK: {
opcode = 0x33;
*value = opcode << 16;
break;
}
case NEU_SET_STI_CLK: {
opcode = 0x34;
*value = opcode << 16;
break;
}
case NEU_SET_ARBITRARY: {
opcode = 0x36;
*value = opcode << 16;
break;
}
case NEU_SET_ARB_INDEX: {
opcode = 0x37;
*value = opcode << 16;
break;
}
case NEU_SET_STI_MODE: {
opcode = 0x38;
*value = opcode << 16;
break;
}
case NEU_SET_AMP_BIAS: {
opcode = 0x39;
*value = opcode << 16;
break;
}
case NEU_SET_CHOPPER: {
opcode = 0x3B;
*value = opcode << 16;
break;
}
default: {
opcode = 0x33;
*value = opcode << 16;
break;
}
}
}
//static void read_neu_ins_config(uint8_t config_type, uint32_t* value) {
// uint8_t opcode;
// switch (config_type) {
// case NEU_SET_STI_CUR: {
// uint8_t channel = get_sti_channel(INSTRUCTION.sti_channel);
// opcode = channel * 4 + 1;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_STI_VOLT: {
// opcode = 0x25;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_POLARITY: {
// opcode = 0x28;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_STI_CHANNEL: {
// opcode = 0x2A;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_GENERAL_EN: {
// opcode = 0x2F;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_REC_CHANNEL: {
// opcode = 0x30;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_AMP_GAIN: {
// opcode = 0x31;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_SYS_CLK: {
// opcode = 0x32;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_ADC_CLK: {
// opcode = 0x33;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_STI_CLK: {
// opcode = 0x34;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_ARBITRARY: {
// opcode = 0x36;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_ARB_INDEX: {
// opcode = 0x37;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_STI_MODE: {
// opcode = 0x38;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_AMP_BIAS: {
// opcode = 0x39;
// *value = opcode << 16;
// break;
// }
// case NEU_SET_CHOPPER: {
// opcode = 0x3B;
// *value = opcode << 16;
// break;
// }
// default: {
// opcode = 0x33;
// *value = opcode << 16;
// break;
// }
// }
//}
/**
* @fn build_neu_ins_config
@@ -1031,6 +1031,7 @@ static uint8_t build_neu_ins_config(uint8_t config_type, uint32_t* value) {
// set stimulate parameter
uint8_t sti_channel = get_sti_channel(INSTRUCTION.sti_channel);
done = build_sti_cur_instruction(sti_channel, value);
return NEU_SETUP_DONE;
if (done) {
INSTRUCTION.sti_channel = 0x01 << sti_channel;
return NEU_SET_STI_VOLT;