libscpi/inc/scpi/scpi-def.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
libscpi/inc/scpi/types.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
libscpi/src/ieee488.c | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
libscpi/inc/scpi/scpi-def.h
@@ -46,10 +46,10 @@ */ #define SCPI_INPUT_BUFFER_LENGTH 256 #define SCPI_ERROR_QUEUE_SIZE 17 #define SCPI_IDN1 "MANUFACTURE" #define SCPI_IDN2 "INSTR2013" #define SCPI_IDN1 "MANUFACTURE\n" #define SCPI_IDN2 "INSTR2013\n" #define SCPI_IDN3 NULL #define SCPI_IDN4 "01-02" #define SCPI_IDN4 "01-02\n" extern const scpi_command_t scpi_commands[]; extern scpi_interface_t scpi_interface; libscpi/inc/scpi/types.h
@@ -427,7 +427,7 @@ scpi_buffer_t buffer; //解析命令的参数列表 scpi_param_list_t param_list; //SCPI的硬件接口,刷新 重置 写入 报错 //SCPI的外部接口,刷新 重置 写入 报错 scpi_interface_t * interface; //输出数据的个数 int_fast16_t output_count; @@ -455,6 +455,9 @@ const char * idn[4]; //剩余待传输的字节 size_t arbitrary_remaining; //output为自增字段,保存返回结果,提供给程序响应内部输出 char outPut[1024]; }; enum _scpi_array_format_t { libscpi/src/ieee488.c
@@ -174,10 +174,12 @@ if (stb & sre) { ptrans = ((old_val ^ val) & val); context->registers[SCPI_REG_STB] |= STB_SRQ; if (ptrans & val) { if (ptrans & val) { writeControl(context, SCPI_CTRL_SRQ, context->registers[SCPI_REG_STB]); } } else { } else { context->registers[SCPI_REG_STB] &= ~STB_SRQ; } break; @@ -322,8 +324,13 @@ */ scpi_result_t SCPI_CoreIdnQ(scpi_t * context) { int i; for (i = 0; i < 4; i++) { if (context->idn[i]) { for (i = 0; i < 4; i++) { if (context->idn[i]) { char* outPut = "IDNS响应"; memcpy(context->outPut,outPut,strlen(outPut)); context->interface->write(context,context->idn[i],0); SCPI_ResultMnemonic(context, context->idn[i]); } else { SCPI_ResultMnemonic(context, "0"); @@ -384,8 +391,14 @@ * @param context * @return */ scpi_result_t SCPI_CoreSreQ(scpi_t * context) { SCPI_ResultInt32(context, SCPI_RegGet(context, SCPI_REG_SRE)); scpi_result_t SCPI_CoreSreQ(scpi_t * context) { context->interface->write(context,"Registers request start",0); for(int i =0;i<SCPI_REG_COUNT;i++) { context->interface->write(context,(char*)context->registers[i],0); } context->interface->write(context,"Registers request end",0); return SCPI_RES_OK; }