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
|
SCPI helper header file. More...
Go to the source code of this file.
Classes | |
struct | _SCPI_choice_def_t |
Defines a structure for SCPI choice options. More... | |
Typedefs | |
typedef struct _SCPI_choice_def_t | SCPI_choice_def_t |
Functions | |
uint8_t | ScpiParamString (SCPI_P ¶meters, String ¶m) |
Extracts a string parameter from the SCPI parameter list. | |
uint8_t | ScpiParamUInt8 (SCPI_P ¶meters, uint8_t ¶m) |
Extracts an unsigned 8-bit integer parameter from the SCPI parameter list. | |
uint8_t | ScpiParamUInt32 (SCPI_P ¶meters, uint32_t ¶m) |
Extracts an unsigned 32-bit integer parameter from the SCPI parameter list. | |
uint8_t | ScpiParamDouble (SCPI_P ¶meters, double ¶m) |
Extracts a double-precision floating-point parameter from the SCPI parameter list. | |
uint8_t | ScpiParamBool (SCPI_P ¶meters, bool ¶m) |
Extracts a boolean parameter ('ON', '1', 'OFF', or '0') from the SCPI parameter list. | |
uint8_t | ScpiParamInt8 (SCPI_P ¶meters, int8_t ¶m) |
uint8_t | ScpiParamChoice (SCPI_P ¶meters, const SCPI_choice_def_t *options, size_t optionsSize, uint8_t ¶m) |
Extracts a choice parameter from the SCPI parameter list and maps it to a numerical tag. | |
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.
This header file declares a set of helper functions designed to simplify the process of extracting and converting parameters from the SCPI parser and mapping choice values to their string representations. These functions are intended to be used in the implementation of SCPI commands.
Definition in file scpi_helper.h.
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.
This function iterates through the provided list of valid choices and compares the input numerical tag with the tag of each choice. If a match is found, the stem and suffix of the corresponding choice are concatenated and stored in the output string.
options | A pointer to an array of SCPI_choice_def_t structures defining the valid choices. |
optionsSize | The number of elements in the options array. |
value | The numerical tag to convert to a string. |
name | A reference to a String variable where the string representation of the tag will be stored. |
Definition at line 172 of file scpi_helper.cpp.
uint8_t ScpiParamBool | ( | SCPI_P & | parameters, |
bool & | param ) |
Extracts a boolean parameter ('ON', '1', 'OFF', or '0') from the SCPI parameter list.
This function checks if there are any parameters available. If so, it pops the last parameter from the list, converts it to uppercase, and checks if it matches "ON", "1" (for true) or "OFF", "0" (for false).
parameters | A reference to the SCPI parameter list. |
param | A reference to a bool variable where the extracted parameter will be stored. |
Definition at line 109 of file scpi_helper.cpp.
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.
This function first extracts a string parameter. If successful, it iterates through the provided list of valid choices and compares the extracted string (case-insensitively) with the stem or the full stem and suffix of each choice. If a match is found, the corresponding numerical tag is stored in the output parameter.
parameters | A reference to the SCPI parameter list. |
options | A pointer to an array of SCPI_choice_def_t structures defining the valid choices. |
optionsSize | The number of elements in the options array. |
param | A reference to a uint8_t variable where the numerical tag of the matched choice will be stored. |
Definition at line 139 of file scpi_helper.cpp.
uint8_t ScpiParamDouble | ( | SCPI_P & | parameters, |
double & | param ) |
Extracts a double-precision floating-point parameter from the SCPI parameter list.
This function checks if there are any parameters available. If so, it pops the last parameter from the list and converts it to a double.
parameters | A reference to the SCPI parameter list. |
param | A reference to a double variable where the extracted parameter will be stored. |
Definition at line 90 of file scpi_helper.cpp.
uint8_t ScpiParamString | ( | SCPI_P & | parameters, |
String & | param ) |
Extracts a string parameter from the SCPI parameter list.
This function checks if there are any parameters available. If so, it pops the last parameter from the list and converts it to a String.
parameters | A reference to the SCPI parameter list. |
param | A reference to a String variable where the extracted parameter will be stored. |
Definition at line 36 of file scpi_helper.cpp.
uint8_t ScpiParamUInt32 | ( | SCPI_P & | parameters, |
uint32_t & | param ) |
Extracts an unsigned 32-bit integer parameter from the SCPI parameter list.
This function checks if there are any parameters available. If so, it pops the last parameter from the list and converts it to an unsigned 32-bit integer.
parameters | A reference to the SCPI parameter list. |
param | A reference to a uint32_t variable where the extracted parameter will be stored. |
Definition at line 72 of file scpi_helper.cpp.
uint8_t ScpiParamUInt8 | ( | SCPI_P & | parameters, |
uint8_t & | param ) |
Extracts an unsigned 8-bit integer parameter from the SCPI parameter list.
This function checks if there are any parameters available. If so, it pops the last parameter from the list and converts it to an unsigned 8-bit integer.
parameters | A reference to the SCPI parameter list. |
param | A reference to a uint8_t variable where the extracted parameter will be stored. |
Definition at line 54 of file scpi_helper.cpp.