Skip to content

Commit

Permalink
simulator UART put
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jun 26, 2021
1 parent a0731ce commit fc17c35
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/eez/modules/psu/scpi/simu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,19 @@ scpi_result_t scpi_cmd_simulatorDigitalDataByte(scpi_t *context) {
return SCPI_RES_OK;
}

scpi_result_t scpi_cmd_simulatorUart(scpi_t *context) {
const char *text;
size_t textLen;

if (!SCPI_ParamCharacters(context, &text, &textLen, true)) {
return SCPI_RES_ERR;
}

uart::simulatorPut(text, textLen);

return SCPI_RES_OK;
}

} // namespace scpi
} // namespace psu
} // namespace eez
Expand Down Expand Up @@ -506,6 +519,11 @@ scpi_result_t scpi_cmd_simulatorDigitalDataByte(scpi_t *context) {
return SCPI_RES_ERR;
}

scpi_result_t scpi_cmd_simulatorUart(scpi_t *context) {
SCPI_ErrorPush(context, SCPI_ERROR_UNDEFINED_HEADER);
return SCPI_RES_ERR;
}

} // namespace scpi
} // namespace psu
} // namespace eez
Expand Down
1 change: 1 addition & 0 deletions src/eez/scpi/commands_simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@
SCPI_COMMAND("SIMUlator:VOLTage:PROGram:EXTernal", scpi_cmd_simulatorVoltageProgramExternal) \
SCPI_COMMAND("SIMUlator:VOLTage:PROGram:EXTernal?", scpi_cmd_simulatorVoltageProgramExternalQ) \
SCPI_COMMAND("SIMUlator:DIGital:DATA[:BYTE]", scpi_cmd_simulatorDigitalDataByte) \
SCPI_COMMAND("SIMUlator:UART", scpi_cmd_simulatorUart) \
SCPI_COMMAND("DEBUg", scpi_cmd_debug) \
SCPI_COMMAND("DEBUg:ONTime?", scpi_cmd_debugOntimeQ) \
SCPI_COMMAND("DEBUg:VOLTage", scpi_cmd_debugVoltage) \
Expand Down
1 change: 1 addition & 0 deletions src/eez/scpi/commands_stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@
SCPI_COMMAND("SIMUlator:VOLTage:PROGram:EXTernal", scpi_cmd_simulatorVoltageProgramExternal) \
SCPI_COMMAND("SIMUlator:VOLTage:PROGram:EXTernal?", scpi_cmd_simulatorVoltageProgramExternalQ) \
SCPI_COMMAND("SIMUlator:DIGital:DATA[:BYTE]", scpi_cmd_simulatorDigitalDataByte) \
SCPI_COMMAND("SIMUlator:UART", scpi_cmd_simulatorUart) \
SCPI_COMMAND("DEBUg", scpi_cmd_debug) \
SCPI_COMMAND("DEBUg:ONTime?", scpi_cmd_debugOntimeQ) \
SCPI_COMMAND("DEBUg:VOLTage", scpi_cmd_debugVoltage) \
Expand Down

0 comments on commit fc17c35

Please sign in to comment.