Motor Driver Evaluation Kit NEVB-MTR1-t01-1.0.0
Firmware for NEVB-MTR1-KIT1 for trapezoidal control of BLDC motors using Hall-effect sensors
Loading...
Searching...
No Matches
scpi.cpp
Go to the documentation of this file.
1/* This file has been prepared for Doxygen automatic documentation generation.*/
27
28#include "scpi.h"
29#include "config.h"
30#include "scpi_config.h"
31#include "scpi_helper.h"
32
33// Forward declarations
34static void ScpiCoreIdnQ(SCPI_C commands, SCPI_P parameters, Stream &interface);
35static void ScpiSystemErrorCountQ(SCPI_C commands, SCPI_P parameters, Stream &interface);
36static void ScpiSystemErrorNextQ(SCPI_C commands, SCPI_P parameters, Stream &interface);
37static void GetMotorEnable(SCPI_C commands, SCPI_P parameters, Stream &interface);
38static void ConfigureMotorEnable(SCPI_C commands, SCPI_P parameters, Stream &interface);
39static void GetConfigureMotorDutyCycleSource(SCPI_C commands, SCPI_P parameters, Stream &interface);
40static void ConfigureMotorDutyCycle(SCPI_C commands, SCPI_P parameters, Stream &interface);
41static void ConfigureMotorFrequency(SCPI_C commands, SCPI_P parameters, Stream &interface);
42static void GetConfigureMotorFrequency(SCPI_C commands, SCPI_P parameters, Stream &interface);
43static void ConfigureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface);
44static void GetConfigureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface);
45static void MeasureMotorSpeed(SCPI_C commands, SCPI_P parameters, Stream &interface);
46static void MeasureMotorCurrentVBus(SCPI_C commands, SCPI_P parameters, Stream &interface);
47static void MeasureMotorCurrentPhaseU(SCPI_C commands, SCPI_P parameters, Stream &interface);
48static void MeasureMotorCurrentPhaseV(SCPI_C commands, SCPI_P parameters, Stream &interface);
49static void MeasureMotorCurrentPhaseW(SCPI_C commands, SCPI_P parameters, Stream &interface);
50static void MeasureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface);
51static void MeasureMotorVoltage(SCPI_C commands, SCPI_P parameters, Stream &interface);
52static void MeasureGateDutyCycle(SCPI_C commands, SCPI_P parameters, Stream &interface);
53#if (SPEED_CONTROL_METHOD == SPEED_CONTROL_OPEN_LOOP)
54static void ConfigureMotorDutyCycleSource(SCPI_C commands, SCPI_P parameters, Stream &interface);
55#elif (SPEED_CONTROL_METHOD == SPEED_CONTROL_CLOSED_LOOP)
56static void ConfigureMotorSpeedSource(SCPI_C commands, SCPI_P parameters, Stream &interface);
57static void GetMotorSpeedSource(SCPI_C commands, SCPI_P parameters, Stream &interface);
58static void ConfigureMotorSpeed(SCPI_C commands, SCPI_P parameters, Stream &interface);
59#endif
60
61// Instantiate the SCPI Parser
63
71void ScpiInit(void)
72{
73 /* IEEE Mandated Commands (SCPI std V1999.0 4.1.1) */
74 // "*CLS" and "*RST" are not supported
75 scpiParser.RegisterCommand(F("*IDN?"), &ScpiCoreIdnQ);
76
77 /* Required SCPI commands (SCPI std V1999.0 4.2.1) */
78 // "SYSTem:VERSion?" and "SYSTem:ERRor:NEXT?" are not supported
79 scpiParser.SetCommandTreeBase(F("SYSTem"));
80 scpiParser.RegisterCommand(F(":ERRor?"), &ScpiSystemErrorNextQ);
81 scpiParser.RegisterCommand(F(":ERRor:COUNt?"), &ScpiSystemErrorCountQ);
82
83 /* Motor Configuration Commands */
84 scpiParser.SetCommandTreeBase(F("CONFigure"));
85 scpiParser.RegisterCommand(F(":ENABle"), &ConfigureMotorEnable);
86 scpiParser.RegisterCommand(F(":ENABle?"), &GetMotorEnable);
87#if (SPEED_CONTROL_METHOD == SPEED_CONTROL_OPEN_LOOP)
88 scpiParser.RegisterCommand(F(":DUTYcycle:SOURce"), &ConfigureMotorDutyCycleSource);
89 scpiParser.RegisterCommand(F(":DUTYcycle:SOURce?"), &GetConfigureMotorDutyCycleSource);
90 scpiParser.RegisterCommand(F(":DUTYcycle"), &ConfigureMotorDutyCycle);
91#else
92 scpiParser.RegisterCommand(F(":SPEED:SOURce"), &ConfigureMotorSpeedSource);
93 scpiParser.RegisterCommand(F(":SPEED:SOURce?"), &GetMotorSpeedSource);
94 scpiParser.RegisterCommand(F(":SPEED"), &ConfigureMotorSpeed);
95#endif
96 scpiParser.RegisterCommand(F(":FREQuency"), &ConfigureMotorFrequency);
97 scpiParser.RegisterCommand(F(":FREQuency?"), &GetConfigureMotorFrequency);
98 // scpiParser.RegisterCommand(F("DEADtime"), &ConfigureMotorDeadTime);
99 // scpiParser.RegisterCommand(F("DEADtime?"), &GetConfigureMotorDeadTime);
100 scpiParser.RegisterCommand(F(":DIREction"), &ConfigureMotorDirection);
101 scpiParser.RegisterCommand(F(":DIREction?"), &GetConfigureMotorDirection);
102
103 /* Motor Measurement Commands */
104 scpiParser.SetCommandTreeBase(F("MEASure"));
105 scpiParser.RegisterCommand(F(":SPEEd?"), &MeasureMotorSpeed);
106 scpiParser.RegisterCommand(F(":CURRent:IBUS?"), &MeasureMotorCurrentVBus);
107 scpiParser.RegisterCommand(F(":CURRent:IPHU?"), &MeasureMotorCurrentPhaseU);
108 scpiParser.RegisterCommand(F(":CURRent:IPHV?"), &MeasureMotorCurrentPhaseV);
109 scpiParser.RegisterCommand(F(":CURRent:IPHW?"), &MeasureMotorCurrentPhaseW);
110 scpiParser.RegisterCommand(F(":VOLTage?"), &MeasureMotorVoltage);
111 scpiParser.RegisterCommand(F(":DIREction?"), &MeasureMotorDirection);
112 scpiParser.RegisterCommand(F(":DUTYcycle?"), &MeasureGateDutyCycle);
113}
114
124void ScpiInput(Stream &interface)
125{
126 scpiParser.ProcessInput(interface, "\n");
127}
128
140static void ScpiCoreIdnQ(SCPI_C commands, SCPI_P parameters, Stream &interface)
141{
142 interface.print(F(SCPI_IDN1));
143 interface.print(F(","));
144 interface.print(F(SCPI_IDN2));
145 interface.print(F(","));
146 if (SCPI_IDN3 != NULL && strlen(SCPI_IDN3) > 0)
147 {
148 interface.print(F(SCPI_IDN3));
149 interface.print(F(","));
150 }
151 interface.println(F(SCPI_IDN4));
152}
153
165static void ScpiSystemErrorCountQ(SCPI_C commands, SCPI_P parameters, Stream &interface)
166{
167 interface.println(scpiParser.last_error == ErrorCode::NoError ? 0 : 1);
168}
169
181static void ScpiSystemErrorNextQ(SCPI_C commands, SCPI_P parameters, Stream &interface)
182{
183 switch (scpiParser.last_error)
184 {
186 interface.println(F("Buffer overflow error"));
187 break;
189 interface.println(F("Communication timeout error"));
190 break;
192 interface.println(F("Unknown command received"));
193 break;
195 interface.println(F("No Error"));
196 break;
198 interface.println(F("Missing or invalid parameter"));
199 break;
200 default:
201 interface.println(F("Unknown error"));
202 }
203 scpiParser.last_error = ErrorCode::NoError;
204}
205
216static void GetMotorEnable(SCPI_C commands, SCPI_P parameters, Stream &interface)
217{
218 interface.println(motorFlags.enable);
219}
220
236static void ConfigureMotorEnable(SCPI_C commands, SCPI_P parameters, Stream &interface)
237{
238 bool param;
239 if (!ScpiParamBool(parameters, param))
240 {
242 return;
243 }
244 if (param)
245 {
246 // Set the enable pin
247 PORTD |= (1 << ENABLE_PIN);
248 }
249 else
250 {
251 // Clear the enable pin
252 PORTD &= ~(1 << ENABLE_PIN);
253 }
254
255 scpiParser.last_error = ErrorCode::NoError;
256}
257
269#if (SPEED_CONTROL_METHOD == SPEED_CONTROL_OPEN_LOOP)
270static void ConfigureMotorDutyCycleSource(SCPI_C commands, SCPI_P parameters, Stream &interface)
271#elif (SPEED_CONTROL_METHOD == SPEED_CONTROL_CLOSED_LOOP)
272static void ConfigureMotorSpeedSource(SCPI_C commands, SCPI_P parameters, Stream &interface)
273#endif
274{
275 uint8_t param;
276
277 // read first parameter if present
278 if (!ScpiParamChoice(parameters, inputSources, INPUT_SOURCE_OPTIONS, param))
279 {
281 return;
282 }
283
284 if (param == SPEED_INPUT_SOURCE_LOCAL)
285 {
286 motorConfigs.speedInputSource = SPEED_INPUT_SOURCE_LOCAL;
287 return;
288 }
289 else
290 {
291 motorConfigs.speedInputSource = SPEED_INPUT_SOURCE_REMOTE;
292 speedInput = 0;
293 return;
294 }
295 scpiParser.last_error = ErrorCode::NoError;
296}
297
298#if (SPEED_CONTROL_METHOD == SPEED_CONTROL_OPEN_LOOP)
309static void GetConfigureMotorDutyCycleSource(SCPI_C commands, SCPI_P parameters, Stream &interface)
310#elif (SPEED_CONTROL_METHOD == SPEED_CONTROL_CLOSED_LOOP)
321static void GetMotorSpeedSource(SCPI_C commands, SCPI_P parameters, Stream &interface)
322#endif
323{
324 String name;
326 interface.println(name);
327}
328
329#if (SPEED_CONTROL_METHOD == SPEED_CONTROL_OPEN_LOOP)
340static void ConfigureMotorDutyCycle(SCPI_C commands, SCPI_P parameters, Stream &interface)
341{
342 double param;
343 if (!ScpiParamDouble(parameters, param) || param < 0.0 || param > 100.0)
344 {
346 return;
347 }
348 speedInput = param;
349 scpiParser.last_error = ErrorCode::NoError;
350}
351#elif (SPEED_CONTROL_METHOD == SPEED_CONTROL_CLOSED_LOOP)
363static void ConfigureMotorSpeed(SCPI_C commands, SCPI_P parameters, Stream &interface)
364{
365 double param;
366 if (!ScpiParamDouble(parameters, param) || param > ((((uint32_t)SPEED_CONTROLLER_MAX_SPEED * 15) << 3) / MOTOR_POLES))
367 {
369 return;
370 }
371 speedInput = ((param * SPEED_CONTROLLER_MAX_INPUT * MOTOR_POLES) >> 3) / ((uint32_t)SPEED_CONTROLLER_MAX_SPEED * 15);
372 scpiParser.last_error = ErrorCode::NoError;
373}
374#endif
375
388static void ConfigureMotorFrequency(SCPI_C commands, SCPI_P parameters, Stream &interface)
389{
390 // Clear the enable pin to stop the motor before changing frequency
391 PORTD &= ~(1 << ENABLE_PIN);
392
393 uint32_t param;
394
395 // Read first parameter if present and within range
396 if (!ScpiParamUInt32(parameters, param) || param < 7183 || param > 100000)
397 {
399 return;
400 }
401
402 // Reload the configs
403 motorConfigs.tim4Freq = param;
404 motorConfigs.tim4Top = (uint16_t)TIM4_TOP(motorConfigs.tim4Freq);
405
406 // Wait until motor is stopped
407 while (faultFlags.motorStopped == FALSE)
408 {
409 ;
410 }
411
412 // Re-init timers with the new frequency
413 TimersInit();
414 scpiParser.last_error = ErrorCode::NoError;
415}
416
427static void GetConfigureMotorFrequency(SCPI_C commands, SCPI_P parameters, Stream &interface)
428{
429 interface.println(motorConfigs.tim4Freq);
430}
431
447static void ConfigureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface)
448{
449 uint8_t param;
450
451 // read first parameter if present
453 {
455 return;
456 }
457
458 if (param)
459 {
460 // Set the direction pin if param is 1 (DIRECTION_REVERSE)
461 PORTD |= (1 << DIRECTION_COMMAND_PIN);
462 }
463 else
464 {
465 // Clear the direction pin if param is 0 (DIRECTION_FORWARD)
466 PORTD &= ~(1 << DIRECTION_COMMAND_PIN);
467 }
468 scpiParser.last_error = ErrorCode::NoError;
469}
470
482static void GetConfigureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface)
483{
484 String name;
485 ScpiChoiceToName(motorDirections, MOTOR_DIRECTION_OPTIONS, motorFlags.desiredDirection, name);
486 interface.println(name);
487}
488
500static void MeasureMotorSpeed(SCPI_C commands, SCPI_P parameters, Stream &interface)
501{
502 if (lastCommutationTicks == 0xffff)
503 {
504 interface.println(0.0);
505 }
506 else
507 {
508 interface.println(
509 (motorConfigs.tim4Freq * 20.0) / (lastCommutationTicks * MOTOR_POLES));
510 }
511}
512
523static void MeasureMotorCurrentVBus(SCPI_C commands, SCPI_P parameters, Stream &interface)
524{
525 interface.println(((double)ibus * 5.0 * 1000000.0) / ((double)1023.0 * IBUS_GAIN * IBUS_SENSE_RESISTOR));
526}
527
539static void MeasureMotorCurrentPhaseU(SCPI_C commands, SCPI_P parameters, Stream &interface)
540{
541 interface.println(((double)(iphaseU - 511) * 5.0 * 1000000.0) / ((double)1023.0 * IPHASE_GAIN * IPHASE_SENSE_RESISTOR));
542}
543
555static void MeasureMotorCurrentPhaseV(SCPI_C commands, SCPI_P parameters, Stream &interface)
556{
557 interface.println(((double)(iphaseV - 511) * 5.0 * 1000000.0) / ((double)1023.0 * IPHASE_GAIN * IPHASE_SENSE_RESISTOR));
558}
559
571static void MeasureMotorCurrentPhaseW(SCPI_C commands, SCPI_P parameters, Stream &interface)
572{
573 interface.println(((double)(iphaseW - 511) * 5.0 * 1000000.0) / ((double)1023.0 * IPHASE_GAIN * IPHASE_SENSE_RESISTOR));
574}
575
587static void MeasureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface)
588{
589 if (motorFlags.actualDirection == DIRECTION_UNKNOWN)
590 {
591 interface.println(F("UNKN"));
592 }
593 else
594 {
595 String name;
596 ScpiChoiceToName(motorDirections, MOTOR_DIRECTION_OPTIONS, motorFlags.actualDirection, name);
597 interface.println(name);
598 }
599}
600
611static void MeasureMotorVoltage(SCPI_C commands, SCPI_P parameters, Stream &interface)
612{
613 interface.println(((double)vbusVref * 5.0 * (VBUS_RTOP + VBUS_RBOTTOM)) / ((double)1023.0 * VBUS_RBOTTOM));
614}
615
628static void MeasureGateDutyCycle(SCPI_C commands, SCPI_P parameters, Stream &interface)
629{
630 if (motorFlags.enable == TRUE)
631 {
632 // Reading 16 bit register so disabling interrupts for atomic operation
633 cli();
634 uint16_t duty = 0xff & OCR4A;
635 duty |= (0x03 & TC4H) << 8;
636 sei();
637
638 interface.println((double)duty / (double)motorConfigs.tim4Top * 100.0);
639 }
640 else
641 {
642 interface.println(0.0);
643 }
644}
645
654const SCPI_choice_def_t motorDirections[MOTOR_DIRECTION_OPTIONS] = {
655 {"FORW", "ard", DIRECTION_FORWARD},
656 {"REVE", "rse", DIRECTION_REVERSE},
657};
658
667const SCPI_choice_def_t inputSources[INPUT_SOURCE_OPTIONS] = {
668 {"LOCA", "l", SPEED_INPUT_SOURCE_LOCAL},
669 {"REMO", "te", SPEED_INPUT_SOURCE_REMOTE},
670};
SCPI Parser class.
Definition scpi_parser.h:55
Motor config header file.
#define TIM4_TOP(tim4Freq)
Definition config.h:1151
#define DIRECTION_FORWARD
Forward direction flag value.
Definition config.h:636
#define DIRECTION_COMMAND_PIN
Pin where direction command input is located.
Definition config.h:690
#define SPEED_INPUT_SOURCE_LOCAL
Speed input source - Local or speed input pin.
Definition config.h:698
#define SPEED_CONTROLLER_MAX_INPUT
Maximum Speed Reference Input.
Definition config.h:740
#define DIRECTION_REVERSE
Reverse direction flag value.
Definition config.h:638
#define ENABLE_PIN
Enable input pin.
Definition config.h:692
#define SPEED_INPUT_SOURCE_REMOTE
Speed input source - Remote input.
Definition config.h:700
#define TRUE
TRUE constant value, defined to be compatible with comparisons.
Definition config.h:598
#define FALSE
FALSE constant value.
Definition config.h:596
#define DIRECTION_UNKNOWN
Unknown direction flag value.
Definition config.h:640
#define IBUS_GAIN
Hi-side Current (IBUS) Gain for Current Measurement.
Definition config.h:281
#define IPHASE_SENSE_RESISTOR
Hi-side Current (IBUS) Sense Resistor Value.
Definition config.h:261
#define IBUS_SENSE_RESISTOR
Hi-side Current (IBUS) Sense Resistor Value.
Definition config.h:299
#define VBUS_RBOTTOM
Bottom resistor value in the VBUS voltage potential divider.
Definition config.h:573
#define MOTOR_POLES
Number of poles in the motor.
Definition config.h:85
#define SPEED_CONTROLLER_MAX_SPEED
Speed Controller Maximum Speed.
Definition config.h:457
#define IPHASE_GAIN
In-line Phase Current Gain for Current Measurement.
Definition config.h:243
#define VBUS_RTOP
Top resistor value in the VBUS voltage potential divider.
Definition config.h:553
volatile uint16_t vbusVref
VBUS voltage measurement (Register Value)
Definition main.ino:255
volatile uint8_t speedInput
The most recent "speed" input measurement.
Definition main.ino:101
volatile uint16_t ibus
Hi-side Current (IBUS) measurement (Register Value).
Definition main.ino:137
volatile motorconfigs_t motorConfigs
Motor Configs.
Definition main.ino:66
volatile int16_t iphaseW
In-line Phase W current current measurement (Register Value).
Definition main.ino:226
volatile uint16_t lastCommutationTicks
The number of 'ticks' between two hall sensor changes (store).
Definition main.ino:94
void TimersInit(void)
Initializes and synchronizes Timers.
Definition main.ino:457
volatile int16_t iphaseU
In-line Phase U current current measurement (Register Value).
Definition main.ino:167
volatile int16_t iphaseV
In-line Phase V current current measurement (Register Value).
Definition main.ino:196
static void GetConfigureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface)
Retrieves the configured direction of the motor.
Definition scpi.cpp:482
static void GetConfigureMotorDutyCycleSource(SCPI_C commands, SCPI_P parameters, Stream &interface)
Retrieves the configured motor's duty cycle source.
Definition scpi.cpp:309
static void MeasureMotorCurrentPhaseV(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and returns the motor's phase V current.
Definition scpi.cpp:555
static void ScpiSystemErrorNextQ(SCPI_C commands, SCPI_P parameters, Stream &interface)
Implements the SYSTem:ERRor? (System Error Next Query) command.
Definition scpi.cpp:181
static void MeasureMotorSpeed(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures the motor speed.
Definition scpi.cpp:500
static void MeasureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and reports the current direction of the motor.
Definition scpi.cpp:587
static void ScpiSystemErrorCountQ(SCPI_C commands, SCPI_P parameters, Stream &interface)
Implements the SYSTem:ERRor:COUNt? (System Error Count Query) command.
Definition scpi.cpp:165
static void MeasureMotorCurrentPhaseU(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and returns the motor's phase U current.
Definition scpi.cpp:539
static void MeasureMotorCurrentVBus(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and returns the motor's VBUS current.
Definition scpi.cpp:523
static void ConfigureMotorEnable(SCPI_C commands, SCPI_P parameters, Stream &interface)
Configures the motor's enable state.
Definition scpi.cpp:236
static void ScpiCoreIdnQ(SCPI_C commands, SCPI_P parameters, Stream &interface)
Implements the *IDN? (Identification Query) command.
Definition scpi.cpp:140
static void GetConfigureMotorFrequency(SCPI_C commands, SCPI_P parameters, Stream &interface)
Retrieves the configured motor frequency.
Definition scpi.cpp:427
static void ConfigureMotorDutyCycleSource(SCPI_C commands, SCPI_P parameters, Stream &interface)
Configures the motor's speed input source.
Definition scpi.cpp:270
static void GetMotorEnable(SCPI_C commands, SCPI_P parameters, Stream &interface)
Retrieves the current motor enable state.
Definition scpi.cpp:216
static void ConfigureMotorDutyCycle(SCPI_C commands, SCPI_P parameters, Stream &interface)
Configures the motor's speed input by setting the duty cycle.
Definition scpi.cpp:340
static void MeasureMotorCurrentPhaseW(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and returns the motor's phase W current.
Definition scpi.cpp:571
static void ConfigureMotorDirection(SCPI_C commands, SCPI_P parameters, Stream &interface)
Sets the motor's direction based on the input parameter.
Definition scpi.cpp:447
static void MeasureMotorVoltage(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and returns the VBUS voltage of the motor.
Definition scpi.cpp:611
void ScpiInput(Stream &interface)
Processes incoming data from a serial interface for SCPI commands.
Definition scpi.cpp:124
void ScpiInit(void)
Initializes the SCPI command parser and registers all supported commands.
Definition scpi.cpp:71
const SCPI_choice_def_t inputSources[2]
Array defining the possible input sources for speed/duty cycle control.
Definition scpi.cpp:667
SCPI_Parser scpiParser
Speed input source options array.
Definition scpi.cpp:62
static void MeasureGateDutyCycle(SCPI_C commands, SCPI_P parameters, Stream &interface)
Measures and returns the gate PWM duty cycle as a percentage.
Definition scpi.cpp:628
static void ConfigureMotorFrequency(SCPI_C commands, SCPI_P parameters, Stream &interface)
Configures the motor's operating frequency.
Definition scpi.cpp:388
const SCPI_choice_def_t motorDirections[2]
Array defining the possible motor directions for SCPI commands.
Definition scpi.cpp:654
SCPI implementation header file.
#define INPUT_SOURCE_OPTIONS
Motor direction options array.
Definition scpi.h:39
#define MOTOR_DIRECTION_OPTIONS
Motor direction options array.
Definition scpi.h:35
SCPI parser configuration header file.
#define SCPI_IDN4
Firmware version identification string for the *IDN? command.
#define SCPI_IDN1
Manufacturer identification string for the *IDN? command.
#define SCPI_IDN2
Model number identification string for the *IDN? command.
#define SCPI_IDN3
Revision level identification string for the *IDN? command (optional).
uint8_t ScpiParamChoice(SCPI_P &parameters, const SCPI_choice_def_t *options, size_t optionsSize, uint8_t &param)
Extracts a choice parameter from the SCPI parameter list and maps it to a numerical tag.
uint8_t ScpiParamBool(SCPI_P &parameters, bool &param)
Extracts a boolean parameter ('ON', '1', 'OFF', or '0') from the SCPI parameter list.
uint8_t ScpiParamUInt32(SCPI_P &parameters, uint32_t &param)
Extracts an unsigned 32-bit integer parameter from the SCPI parameter list.
uint8_t ScpiParamDouble(SCPI_P &parameters, double &param)
Extracts a double-precision floating-point parameter from the SCPI parameter list.
uint8_t ScpiChoiceToName(const SCPI_choice_def_t *options, size_t optionsSize, int8_t value, String &name)
Converts a numerical choice tag back to its string representation.
SCPI helper header file.
@ MissingOrInvalidParameter
A required parameter was missing or an invalid parameter was provided.
Definition scpi_types.h:132
@ BufferOverflow
The message buffer was exceeded during message reception.
Definition scpi_types.h:129
@ NoError
No error occurred.
Definition scpi_types.h:120
@ Timeout
A timeout occurred before receiving the expected termination characters.
Definition scpi_types.h:126
@ UnknownCommand
An unknown command was received that could not be matched to a known handler.
Definition scpi_types.h:123
SCPI_Parameters SCPI_P
Alias for SCPI_Parameters.
Definition scpi_types.h:106
SCPI_Commands SCPI_C
Alias for SCPI_Commands.
Definition scpi_types.h:102