Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
somanet_drive.h File Reference
#include <array>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <expected>
#include <nlohmann/json_fwd.hpp>
#include <optional>
#include <span>
#include <stop_token>
#include <string>
#include <string_view>
#include <variant>
#include <vector>
#include "node/cia402_drive.h"
#include "node/firmware_package.h"
Include dependency graph for somanet_drive.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mm::node::OsCommandResponse
 A completed OS command's response — the decoded form of 0x1023:03. More...
 
struct  mm::node::OsCommandFsBuffer
 An OS command's fs-buffer transfer — the data that does not fit in the 8 command bytes. More...
 
struct  mm::node::OsCommandConfig
 Timing and cancellation for SomanetDrive::runOsCommand. More...
 
struct  mm::node::ObjectDictionaryValue
 One object dictionary entry, as OS command 21 delivered it. More...
 
struct  mm::node::ObjectDictionaryValues
 Every object dictionary value the drive holds, read in one transfer by OS command 21. More...
 
struct  mm::node::BrakeState
 The brake's configuration and its current state — one read of the parts of 0x2004 that decide what a release or engage will actually do. More...
 
struct  mm::node::EncoderRegisterResult
 What one encoder register access did — the result of both a read and a write, since the drive answers a write by echoing back the register's value. More...
 
struct  mm::node::DeviceFile
 One file stored on a device, as its file list reports it. More...
 
struct  mm::node::HrdEncoderSample
 One sample of somanet::HrdData::kEncoderRawData. More...
 
struct  mm::node::HrdSystemIdentificationSample
 One sample of somanet::HrdData::kSystemIdentificationData. More...
 
struct  mm::node::HrdRecording
 One high resolution data recording, read back from the drive's files and decoded. More...
 
struct  mm::node::OpenPhaseResult
 What open phase detection found. More...
 
struct  mm::node::MotorPhaseOrderResult
 What motor phase order detection (command 4) found. More...
 
struct  mm::node::CommutationOffsetResult
 What commutation offset measurement (command 5) measured. More...
 
struct  mm::node::PolePairResult
 What pole pair detection (command 7) found. More...
 
struct  mm::node::PhaseResistanceResult
 What phase resistance measurement (command 8) measured. More...
 
struct  mm::node::PhaseInductanceResult
 What phase inductance measurement (command 9) measured. More...
 
struct  mm::node::TorqueConstantResult
 What torque constant measurement (command 10) measured. More...
 
struct  mm::node::SkippedCyclesResult
 What the skipped cycles counter (command 13) reported for one control loop. More...
 
struct  mm::node::TriggerErrorResult
 What one trigger-error run did (command 16). More...
 
struct  mm::node::KueblerRegisterResult
 What one Kübler register access produced (command 19). More...
 
struct  mm::node::FirmwareLatencyResult
 The maximum one firmware latency reached, as command 22 reported it. More...
 
class  mm::node::SomanetDrive
 Borrowed view of a SOMANET drive — a CiA402 drive plus Synapticon-specific object-dictionary access (encoder/motor configuration, custom OS commands, etc.). More...
 

Namespaces

namespace  mm
 
namespace  mm::node
 
namespace  mm::node::somanet
 Pure SOMANET (Synapticon manufacturer-specific) vocabulary — object indices, sub-entry numbers and enumerations, with no dependency on Device.
 

Typedefs

using mm::node::HrdSamples = std::variant< std::vector< HrdEncoderSample >, std::vector< HrdSystemIdentificationSample > >
 A decoded recording's samples: exactly one vector, whichever the data selection implies.
 

Enumerations

enum  mm::node::somanet::Object : uint16_t {
  mm::node::somanet::kCommutationAngleOffset = 0x2001 , mm::node::somanet::kMotorSpecificSettings = 0x2003 , mm::node::somanet::kBrakeOptions = 0x2004 , mm::node::somanet::kCommutationOffsetDetection = 0x2009 ,
  mm::node::somanet::kErrorReport = 0x203F
}
 Manufacturer-specific object indices (the 0x2000-0x5FFF vendor range). More...
 
enum  mm::node::somanet::ErrorReportEntry : uint8_t { mm::node::somanet::kErrorReportDescription = 1 }
 Sub-entries of 0x203F (error report). The enum value is the subindex. More...
 
enum  mm::node::somanet::MotorSetting : uint8_t {
  mm::node::somanet::kMotorPolePairs = 1 , mm::node::somanet::kMotorTorqueConstant = 2 , mm::node::somanet::kMotorPhaseResistance = 3 , mm::node::somanet::kMotorPhaseInductance = 4 ,
  mm::node::somanet::kMotorPhasesInverted = 5
}
 Sub-entries of 0x2003 (motor specific settings). The enum value is the subindex. More...
 
enum  mm::node::somanet::CommutationOffsetSetting : uint8_t {
  mm::node::somanet::kCommutationOffsetState = 1 , mm::node::somanet::kCommutationOffsetAppliedTorquePercent = 2 , mm::node::somanet::kCommutationOffsetMethod = 3 , mm::node::somanet::kCommutationOffsetKp = 4 ,
  mm::node::somanet::kCommutationOffsetKi = 5 , mm::node::somanet::kCommutationOffsetKd = 6
}
 Sub-entries of 0x2009 (commutation offset detection). The enum value is the subindex. More...
 
enum class  mm::node::somanet::CommutationOffsetMethod : uint8_t { mm::node::somanet::kRotating = 0 , mm::node::somanet::kRotatingTuned = 1 , mm::node::somanet::kStationary = 2 }
 How commutation offset measurement (command 5) is performed (0x2009:03). More...
 
enum class  mm::node::somanet::EncoderOrdinal : uint8_t { mm::node::somanet::kEncoder1 = 1 , mm::node::somanet::kEncoder2 = 2 }
 Which of a drive's two encoders a command addresses. The enum value is the ordinal the firmware expects. More...
 
enum class  mm::node::somanet::IcMuCalibrationMode : uint8_t { mm::node::somanet::kConfiguration = 0 , mm::node::somanet::kRaw = 1 , mm::node::somanet::kStandard = 2 }
 How the BiSS service clocks and interprets an iC-MU encoder (OS command 1). The enum value is the "mode enable" field the firmware expects. More...
 
enum class  mm::node::somanet::FirmwareService : uint8_t { mm::node::somanet::kDriveControl = 0 , mm::node::somanet::kMotionControl = 1 }
 One of the drive's two independently-scheduled control loops, as the firmware's FirmwareServiceId names them. The enum value is the byte the command carries. More...
 
enum class  mm::node::somanet::KueblerRegisterFault : uint8_t {
  mm::node::somanet::kAsyncInProgress = 0 , mm::node::somanet::kInvalidRegisterLength = 1 , mm::node::somanet::kEncoderTimeout = 2 , mm::node::somanet::kWrongByteCount = 3 ,
  mm::node::somanet::kEncoderBusy = 4
}
 What the Kübler encoder reported when a register access failed (OS command 19). More...
 
enum class  mm::node::somanet::VelocitySource : uint8_t { mm::node::somanet::kFirmware = 0 , mm::node::somanet::kEncoder = 1 }
 Where the velocity control loop takes its feedback from (OS command 18). The enum value is the trigger bit the command carries. More...
 
enum class  mm::node::somanet::FirmwareLatency : uint8_t { mm::node::somanet::kSetpoint = 0 , mm::node::somanet::kFeedback = 1 }
 Which internal firmware latency OS command 22 measures. The enum value is the latency index byte the command carries. More...
 
enum class  mm::node::somanet::FirmwareErrorType : uint8_t {
  mm::node::somanet::kLinkError = 0 , mm::node::somanet::kIllegalPc = 1 , mm::node::somanet::kIllegalInstruction = 2 , mm::node::somanet::kIllegalResource = 3 ,
  mm::node::somanet::kLoadStore = 4 , mm::node::somanet::kIllegalPs = 5 , mm::node::somanet::kArithmetic = 6 , mm::node::somanet::kEcall = 7 ,
  mm::node::somanet::kResourceDependency = 8 , mm::node::somanet::kKcall = 9 , mm::node::somanet::kEndlessLoop = 10 , mm::node::somanet::kResettableFirmwareError = 11
}
 The errors OS command 16 can provoke in a firmware service. The enum value is the error-type byte the command carries. More...
 
enum class  mm::node::somanet::FirmwareErrorEffect : uint8_t { mm::node::somanet::kNotImplemented , mm::node::somanet::kStopsService , mm::node::somanet::kRaisesResettableError }
 What a firmware error type actually does on this firmware — which is not what every one of them is named after. More...
 
enum class  mm::node::somanet::SystemIdentificationParameter : uint8_t {
  mm::node::somanet::kStartFrequency = 0 , mm::node::somanet::kTargetFrequency = 1 , mm::node::somanet::kTargetAmplitude = 2 , mm::node::somanet::kTransitionTime = 3 ,
  mm::node::somanet::kSignalType = 4 , mm::node::somanet::kStartProcedure = 5
}
 The settings of the system-identification chirp (OS command 15). The enum value is the parameter index the command carries in byte 1. More...
 
enum class  mm::node::somanet::ChirpSignalType : uint8_t { mm::node::somanet::kLogarithmic = 0 , mm::node::somanet::kLinear = 1 }
 Which excitation the system-identification run sweeps with (parameter 4). More...
 
enum class  mm::node::somanet::SystemIdentificationStart : uint8_t { mm::node::somanet::kNone = 0 , mm::node::somanet::kImmediately = 1 , mm::node::somanet::kAfterHrdStreamStart = 2 }
 What writing parameter 5 does — arm the run, and on what trigger. More...
 
enum class  mm::node::somanet::EncoderRegisterFault : uint8_t { mm::node::somanet::kInvalidResponse = 0 , mm::node::somanet::kRegisterNotAllowed = 1 }
 The faults encoder register communication (command 0) reports as its command-specific OS error code. More...
 
enum class  mm::node::somanet::HrdData : uint8_t { mm::node::somanet::kEncoderRawData = 0 , mm::node::somanet::kSystemIdentificationData = 1 }
 Which signal a high resolution data (HRD) stream records — OS command 3's data index. The enum value is the index the firmware expects. More...
 
enum class  mm::node::somanet::HrdStreamFault : uint8_t {
  mm::node::somanet::kInitialization = 0 , mm::node::somanet::kStreaming = 1 , mm::node::somanet::kDuration = 2 , mm::node::somanet::kDataIndex = 3 ,
  mm::node::somanet::kAction = 4
}
 The faults HRD streaming (command 3) reports as its command-specific OS error code. More...
 
enum  mm::node::somanet::BrakeOption : uint8_t {
  mm::node::somanet::kBrakePullVoltage = 1 , mm::node::somanet::kBrakeHoldVoltage = 2 , mm::node::somanet::kBrakePullTime = 3 , mm::node::somanet::kBrakeReleaseStrategy = 4 ,
  mm::node::somanet::kBrakeControllerDisableDelay = 5 , mm::node::somanet::kBrakeDcBusVoltage = 6 , mm::node::somanet::kBrakeStatus = 7 , mm::node::somanet::kBrakeMinimumDisplacement = 8 ,
  mm::node::somanet::kBrakePinCurrentPercent = 9 , mm::node::somanet::kBrakeOutputVoltage = 10 , mm::node::somanet::kBrakeSwitchingFrequency = 11 , mm::node::somanet::kBrakePinInitialDirection = 12
}
 Sub-entries of 0x2004 (brake options). The enum value is the subindex. More...
 
enum class  mm::node::somanet::BrakeReleaseStrategy : uint8_t { mm::node::somanet::kManualOutputVoltage = 0 , mm::node::somanet::kClutch = 1 , mm::node::somanet::kPin = 2 }
 How the brake is driven (0x2004:04). More...
 
enum class  mm::node::somanet::BrakeStatus : uint8_t { mm::node::somanet::kNotConfigured = 0 , mm::node::somanet::kEngaged = 1 , mm::node::somanet::kDisengaged = 2 }
 Brake state (0x2004:07), which both reports the brake and commands it when written. More...
 
enum class  mm::node::somanet::OsCommandId : uint8_t {
  mm::node::somanet::kEncoderRegisterCommunication = 0 , mm::node::somanet::kIcMuCalibrationMode = 1 , mm::node::somanet::kHrdStreaming = 3 , mm::node::somanet::kMotorPhaseOrderDetection = 4 ,
  mm::node::somanet::kCommutationOffsetMeasurement = 5 , mm::node::somanet::kOpenPhaseDetection = 6 , mm::node::somanet::kPolePairDetection = 7 , mm::node::somanet::kPhaseResistanceMeasurement = 8 ,
  mm::node::somanet::kPhaseInductanceMeasurement = 9 , mm::node::somanet::kTorqueConstantMeasurement = 10 , mm::node::somanet::kSkippedCyclesCounter = 13 , mm::node::somanet::kIgnoreBissStatusBits = 14 ,
  mm::node::somanet::kSystemIdentification = 15 , mm::node::somanet::kTriggerError = 16 , mm::node::somanet::kVelocitySource = 18 , mm::node::somanet::kKueblerRegisterCommunication = 19 ,
  mm::node::somanet::kReadObjectDictionary = 21 , mm::node::somanet::kMeasureFirmwareLatency = 22
}
 OS command IDs (byte 0 of 0x1023:01). More...
 
enum class  mm::node::somanet::OpenPhaseFault : uint8_t {
  mm::node::somanet::kOpenTerminalA = 0 , mm::node::somanet::kOpenTerminalB = 1 , mm::node::somanet::kOpenTerminalC = 2 , mm::node::somanet::kOpenFetAHigh = 3 ,
  mm::node::somanet::kOpenFetALow = 4 , mm::node::somanet::kOpenFetBHigh = 5 , mm::node::somanet::kOpenFetBLow = 6 , mm::node::somanet::kOpenFetCHigh = 7 ,
  mm::node::somanet::kOpenFetCLow = 8
}
 The faults open phase detection (command 6) reports, as its command-specific OS error code. More...
 
enum class  mm::node::somanet::MotorPhaseOrder : uint8_t { mm::node::somanet::kNormal = 0 , mm::node::somanet::kInverted = 1 }
 Which way round the motor's phases are wired, as motor phase order detection (command 4) reports it and as 0x2003:05 "Motor phases inverted" stores it. More...
 
enum class  mm::node::somanet::MotorMeasurementFault : uint8_t { mm::node::somanet::kCurrentAmplitudeError = 0 }
 The faults the current-injecting motor measurements report as their command-specific OS error code — pole pair (7), phase resistance (8) and phase inductance (9), which the firmware specification gives the same single-entry table. More...
 
enum class  mm::node::somanet::OperationMode : int8_t {
  mm::node::somanet::kImpedance = -6 , mm::node::somanet::kJointTorque = -5 , mm::node::somanet::kSystemIdentification = -4 , mm::node::somanet::kOpenLoopField = -3 ,
  mm::node::somanet::kDiagnostics = -2 , mm::node::somanet::kCoggingCompensationRecording = -1
}
 SOMANET's manufacturer-specific operation modes — the negative half of 0x6060, which CiA402 leaves to the vendor. More...
 
enum class  mm::node::OsCommandStatus : uint8_t { mm::node::kCompleted = 0 , mm::node::kCompletedWithData = 1 , mm::node::kFailed = 2 , mm::node::kFailedWithData = 3 }
 Terminal OS command status — byte 0 of the response (0x1023:03), which the firmware mirrors from 0x1023:02. Only these four values end a command; 100-200 (executing, with percentage) and 255 (executing) are transient and never surface to a caller. More...
 
enum class  mm::node::OsCommandError : uint8_t {
  mm::node::kNotAllowed = 251 , mm::node::kAborted = 252 , mm::node::kTimeout = 253 , mm::node::kUnsupported = 254 ,
  mm::node::kReserved = 255
}
 The general OS error codes — the ones any command can report, counting down from 254. Command-specific codes count up from 0 and are named by the command that issued them, not here (open phase detection's 0 is "open terminal A", phase resistance's 0 is "current amplitude error", ...). More...
 
enum class  mm::node::FsBufferTransfer : uint8_t { mm::node::kNone , mm::node::kRead , mm::node::kWrite }
 Which way an OS command's fs-buffer transfer moves bytes. More...
 

Functions

constexpr std::string_view mm::node::somanet::toString (CommutationOffsetMethod method)
 Name of a commutation offset method (for logging / JSON). Never returns nullptr.
 
constexpr bool mm::node::somanet::requiresBrakeReleased (CommutationOffsetMethod method)
 Whether the method needs the brake released, as opposed to engaged.
 
constexpr std::string_view mm::node::somanet::toString (EncoderOrdinal encoder)
 Name of an encoder ordinal, as a message should render it. Never returns nullptr.
 
constexpr std::string_view mm::node::somanet::toString (IcMuCalibrationMode mode)
 Name of an iC-MU calibration mode (for logging / JSON). Never returns nullptr.
 
std::optional< IcMuCalibrationModemm::node::somanet::parseIcMuCalibrationMode (std::string_view token)
 Parses a mode token ("configuration" / "raw" / "standard") — the inverse of toString. Returns std::nullopt for any other token.
 
constexpr std::string_view mm::node::somanet::toString (FirmwareService service)
 Name of a firmware service (for logging / JSON). Never returns nullptr.
 
std::optional< FirmwareServicemm::node::somanet::parseFirmwareService (std::string_view token)
 Parses a service token ("drive-control" / "motion-control") — the inverse of toString. Returns std::nullopt for any other token.
 
constexpr std::string_view mm::node::somanet::toString (KueblerRegisterFault fault)
 Name of a Kübler register fault, as a message should render it. Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (VelocitySource source)
 Name of a velocity source (for logging / JSON). Never returns nullptr.
 
std::optional< VelocitySourcemm::node::somanet::parseVelocitySource (std::string_view token)
 Parses a velocity source token ("firmware" / "encoder"). std::nullopt otherwise.
 
constexpr std::string_view mm::node::somanet::toString (FirmwareLatency latency)
 Name of a firmware latency (for logging / JSON). Never returns nullptr.
 
std::optional< FirmwareLatencymm::node::somanet::parseFirmwareLatency (std::string_view token)
 Parses a firmware latency token ("setpoint" / "feedback"). std::nullopt otherwise.
 
constexpr FirmwareErrorEffect mm::node::somanet::effectOf (FirmwareErrorType type)
 What type does, from the firmware's own case bodies rather than from its name.
 
constexpr std::string_view mm::node::somanet::toString (FirmwareErrorType type)
 Name of a firmware error type (for logging / JSON). Never returns nullptr.
 
std::optional< FirmwareErrorTypemm::node::somanet::parseFirmwareErrorType (std::string_view token)
 Parses a firmware error type token — the inverse of toString.
 
constexpr std::string_view mm::node::somanet::toString (SystemIdentificationParameter parameter)
 Name of a system-identification parameter, as a message should render it. Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (ChirpSignalType type)
 Name of a chirp signal type (for logging / JSON). Never returns nullptr.
 
std::optional< ChirpSignalTypemm::node::somanet::parseChirpSignalType (std::string_view token)
 Parses a signal-type token ("logarithmic" / "linear"). std::nullopt for any other.
 
constexpr std::string_view mm::node::somanet::toString (SystemIdentificationStart start)
 Name of a start trigger (for logging / JSON). Never returns nullptr.
 
std::optional< SystemIdentificationStartmm::node::somanet::parseSystemIdentificationStart (std::string_view token)
 Parses a start token ("none" / "immediately" / "after-hrd-stream-start").
 
constexpr std::string_view mm::node::somanet::toString (EncoderRegisterFault fault)
 Name of an encoder register fault, as the console and logs should render it. Never nullptr.
 
constexpr std::string_view mm::node::somanet::describe (EncoderRegisterFault fault)
 What an encoder register fault means, for a message a user has to act on. Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (HrdData data)
 Name of an HRD data selection, as it appears on the wire. Never returns nullptr.
 
std::optional< HrdDatamm::node::somanet::parseHrdData (std::string_view token)
 Parses an HRD data token ("encoder-raw" / "system-identification") — the inverse of toString. Returns std::nullopt for any other token.
 
constexpr size_t mm::node::somanet::hrdSampleSize (HrdData data)
 How many bytes one recorded sample of data occupies in the drive's files.
 
constexpr std::chrono::milliseconds mm::node::somanet::maxHrdStreamDuration (HrdData data)
 The longest stream the drive will record for data.
 
constexpr std::string_view mm::node::somanet::toString (HrdStreamFault fault)
 Name of an HRD streaming fault, as the console and logs should render it. Never nullptr.
 
constexpr std::string_view mm::node::somanet::describe (HrdStreamFault fault)
 What an HRD streaming fault means, for a message a user has to act on. Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (BrakeStatus status)
 Human-readable name of a brake status (for logging / JSON). Never returns nullptr.
 
constexpr std::string_view mm::node::somanet::toString (BrakeReleaseStrategy strategy)
 Human-readable name of a release strategy (for logging / JSON). Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (OpenPhaseFault fault)
 Name of an open-phase fault, as the console and logs should render it. Never nullptr.
 
constexpr std::string_view mm::node::somanet::describe (OpenPhaseFault fault)
 What an open-phase fault means, for a message a user has to act on. Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (MotorPhaseOrder order)
 Name of a motor phase order (for logging / JSON). Never returns nullptr.
 
constexpr std::string_view mm::node::somanet::toString (MotorMeasurementFault fault)
 Name of a motor-measurement fault, as the console and logs should render it. Never nullptr.
 
constexpr std::string_view mm::node::somanet::describe (MotorMeasurementFault fault)
 What a motor-measurement fault means, for a message a user has to act on. Never nullptr.
 
constexpr std::string_view mm::node::somanet::toString (OperationMode mode)
 Name of a SOMANET operation mode, in the same PascalCase spelling the standard modes use (cia402::toString), so the two halves of a mode list read alike. Never nullptr.
 
constexpr std::string_view mm::node::somanet::describe (OperationMode mode)
 The drive's own wording for a mode, as its ESI documents 0x6060. Never nullptr.
 
constexpr bool mm::node::somanet::isDeprecated (OperationMode mode)
 Whether the firmware marks mode as deprecated — true for system identification alone, which both the firmware header and the ESI label that way.
 
std::optional< std::string_view > mm::node::osCommandErrorName (uint8_t code)
 Names a general OS error code, or std::nullopt when code is command-specific.
 
constexpr std::string_view mm::node::toString (FsBufferTransfer transfer)
 Name of an fs-buffer direction, as a request and a response spell it.
 
std::optional< FsBufferTransfermm::node::parseFsBufferTransfer (std::string_view token)
 Reads an fs-buffer direction back from its name. std::nullopt if token names none.
 
void mm::node::to_json (nlohmann::json &j, const ObjectDictionaryValue &entry)
 
void mm::node::to_json (nlohmann::json &j, const ObjectDictionaryValues &values)
 
std::expected< ObjectDictionaryValues, std::string > mm::node::decodeObjectDictionaryValues (std::span< const uint8_t > data, const std::vector< DeviceParameter > &definitions)
 Splits what OS command 21 sent into one value per entry of definitions.
 
void mm::node::to_json (nlohmann::json &j, const BrakeState &state)
 
void mm::node::to_json (nlohmann::json &j, const EncoderRegisterResult &result)
 
void mm::node::to_json (nlohmann::json &j, const DeviceFile &file)
 
std::vector< DeviceFilemm::node::parseDeviceFileList (std::string_view text)
 Parses the body of a fs-getlist read into one entry per line.
 
std::expected< void, std::string > mm::node::removeDeviceFile (Device &device, const std::string &filename)
 Deletes a file from a SOMANET drive's flash (FoE read of "fs-remove=<filename>").
 
void mm::node::to_json (nlohmann::json &j, const HrdRecording &recording)
 
std::string mm::node::toCsv (const HrdRecording &recording)
 Renders a recording as CSV: one header row of column names, then one row per sample.
 
std::vector< std::string_view > mm::node::hrdColumns (somanet::HrdData data)
 The column names of one decoded sample of data, in the order a row carries them.
 
HrdSamples mm::node::decodeHrdSamples (std::span< const uint8_t > bytes, somanet::HrdData data)
 Decodes the concatenated contents of a recording's files into samples.
 
void mm::node::to_json (nlohmann::json &j, const OpenPhaseResult &result)
 
void mm::node::to_json (nlohmann::json &j, const MotorPhaseOrderResult &result)
 
void mm::node::to_json (nlohmann::json &j, const CommutationOffsetResult &result)
 
void mm::node::to_json (nlohmann::json &j, const PolePairResult &result)
 
void mm::node::to_json (nlohmann::json &j, const PhaseResistanceResult &result)
 
void mm::node::to_json (nlohmann::json &j, const PhaseInductanceResult &result)
 
void mm::node::to_json (nlohmann::json &j, const TorqueConstantResult &result)
 
void mm::node::to_json (nlohmann::json &j, const SkippedCyclesResult &result)
 
void mm::node::to_json (nlohmann::json &j, const TriggerErrorResult &result)
 
void mm::node::to_json (nlohmann::json &j, const KueblerRegisterResult &result)
 
void mm::node::to_json (nlohmann::json &j, const FirmwareLatencyResult &result)
 
std::expected< SomanetDrive, std::string > mm::node::createSomanetDrive (Device &device)
 Validates that device is a SOMANET drive, then binds a view to it.
 

Variables

constexpr FirmwareErrorType mm::node::somanet::kFirmwareErrorTypes []
 Every firmware error type, ascending.
 
constexpr uint32_t mm::node::somanet::kMinChirpFrequencyMilliHz = 100
 The bounds the firmware enforces on a chirp configuration.
 
constexpr uint32_t mm::node::somanet::kMaxChirpFrequencyMilliHz = 1'000'000
 1000 Hz.
 
constexpr uint32_t mm::node::somanet::kMinChirpTransitionTimeMs = 1'000
 1 s.
 
constexpr uint32_t mm::node::somanet::kMaxChirpTransitionTimeMs = 20'000
 20 s.
 
constexpr OperationMode mm::node::somanet::kOperationModes []
 Every SOMANET operation mode, ascending — the manufacturer half of a mode list.
 
constexpr size_t mm::node::kOsCommandSize = 8
 Byte length of the OS command and response octet strings (0x1023:01 / 0x1023:03). Manufacturer-specific — the firmware specification allows it to grow, so read it from here rather than writing 8 at a call site.
 
constexpr std::string_view mm::node::kFsBufferFilename = "fs-buffer"
 The FoE filename that moves bulk data for an OS command.
 
constexpr std::array< uint32_t, 1 > mm::node::kObjectsOutsideOdValues
 The entries a SOMANET drive answers for over CoE that OS command 21 does not carry.