|
HardFOC Vortex V1 HAL
Unified HAL API for the HardFOC Vortex motor-control platform (ESP32-C6, TMC9660)
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | ApplyOptions |
| How ApplyParameterImage() works. More... | |
| struct | ApplyResult |
| What ApplyParameterImage() did. More... | |
| struct | MotorDriveDiagnostics |
| The four TMC9660 status words, decoded (design §1.5). Raw words are kept for anything not named. More... | |
| struct | MotorTelemetrySnapshot |
| Caller-owned snapshot, refreshed in place by MotorController::ReadTelemetry(). More... | |
| struct | ParamAccess |
| One axis-parameter access in a batch (MCU- and transport-neutral copy of the driver's type). More... | |
| struct | ParamWrite |
| One entry of a parameter image (design §4.1, the TMC image). More... | |
Typedefs | |
| using | Param = tmc9660::tmcl::Parameters |
| using | ReplyCode = tmc9660::tmcl::ReplyCode |
Enumerations | |
| enum class | TelemetryField : uint8_t { ActualPosition = 0 , ActualVelocity , TorqueFluxActual , GeneralStatus , GeneralErrors , GateDriverErrors , AdcStatus , SupplyVoltage , ChipTemperature , ExternalTemperature , TotalMotorCurrent , RampVelocity , RampPosition , VoltageDqActual , Iit1Sum , Iit2Sum , Count } |
| The telemetry signals a snapshot carries (design §1.3, tiers C/F/S). More... | |
| enum class | TelemetrySet : uint8_t { Cyclic = 0 , Status , Full } |
| Which signals one ReadTelemetry() call fetches. More... | |
| enum class | DriveSeverity : uint8_t { Ok = 0 , Warning , Fault } |
| How serious the decoded status words are. More... | |
Functions | |
| template<typename Driver > | |
| size_t | BatchRead (Driver &driver, std::span< ParamAccess > items) noexcept |
| Read a batch (GAP, pipelined). | |
| template<typename Driver > | |
| size_t | BatchWrite (Driver &driver, std::span< ParamAccess > items) noexcept |
| Write a batch (SAP, pipelined; SAP is idempotent). | |
| constexpr uint32_t | TelemetryRequestMask (TelemetrySet set, uint32_t next_sequence) noexcept |
| Fields a set asks for, given the snapshot's next sequence number (Cyclic alternates 299/300). | |
| template<typename Driver > | |
| size_t | ReadTelemetry (Driver &driver, TelemetrySet set, MotorTelemetrySnapshot &snap) noexcept |
Refresh snap from one pipelined batch. | |
| MotorDriveDiagnostics | DecodeDriveStatus (uint32_t status, uint32_t gen_err, uint32_t gdrv, uint32_t adc) noexcept |
| Decode the four status words into named conditions and a severity. | |
| template<typename Driver > | |
| bool | ReadDriveDiagnostics (Driver &driver, MotorDriveDiagnostics &out) noexcept |
| Read the four status words in one batch and decode them. | |
| template<typename Driver > | |
| bool | ClearLatchedFlags (Driver &driver, uint32_t general_errors, uint32_t gate_driver_errors, uint32_t adc_status) noexcept |
| Clear latched (write-1-to-clear) bits of the error words in one batch. | |
| template<typename Driver > | |
| ApplyResult | ApplyParameterImage (Driver &driver, std::span< const ParamWrite > image, ApplyOptions opt) noexcept |
| Apply a parameter image: MOTOR_TYPE first, then the rest in image order. | |
Variables | |
| constexpr size_t | kBatchChunk = 16 |
| Elements per pipelined chunk (bounds the stack buffer; the driver chunks again internally). | |
| constexpr size_t | kTelemetryFieldCount = static_cast<size_t>(TelemetryField::Count) |
| constexpr std::array< Param, kTelemetryFieldCount > | kTelemetryParam |
| TMC9660 parameter behind each telemetry field. | |
| using vortex::motor::Param = typedef tmc9660::tmcl::Parameters |
| using vortex::motor::ReplyCode = typedef tmc9660::tmcl::ReplyCode |
|
strong |
|
strong |
The telemetry signals a snapshot carries (design §1.3, tiers C/F/S).
|
strong |
Which signals one ReadTelemetry() call fetches.
|
noexcept |
Apply a parameter image: MOTOR_TYPE first, then the rest in image order.
Before MOTOR_TYPE is set, FW051V100 answers most axis parameters with REPLY_WRONG_TYPE (design §1.10), so it is written (and verified) before anything else. The rest goes kBatchChunk entries per pipelined batch. No allocation and a fixed stack footprint, whatever the image size.
|
noexcept |
Read a batch (GAP, pipelined).
|
noexcept |
Write a batch (SAP, pipelined; SAP is idempotent).
|
noexcept |
Clear latched (write-1-to-clear) bits of the error words in one batch.
| general_errors | Bits of A:299 to clear (0 = leave the word alone) |
| gate_driver_errors | Bits of A:300 to clear |
| adc_status | Bits of A:301 to clear |
|
inlinenoexcept |
Decode the four status words into named conditions and a severity.
|
noexcept |
Read the four status words in one batch and decode them.
|
noexcept |
Refresh snap from one pipelined batch.
|
constexprnoexcept |
Fields a set asks for, given the snapshot's next sequence number (Cyclic alternates 299/300).
|
inlineconstexpr |
Elements per pipelined chunk (bounds the stack buffer; the driver chunks again internally).
|
inlineconstexpr |
|
inlineconstexpr |
TMC9660 parameter behind each telemetry field.