|
HardFOC Vortex V1 HAL
Unified HAL API for the HardFOC Vortex motor-control platform (ESP32-C6, TMC9660)
|
Unified API singleton for the HardFOC Vortex platform. More...
#include <array>#include <atomic>#include <cstdint>#include <cstring>#include <memory>#include "handlers/logger/Logger.h"#include "RtosMutex.h"#include "VortexBootReport.h"#include "VortexDiagnostics.h"#include "VortexVersion.h"Go to the source code of this file.
Classes | |
| struct | VortexSystemDiagnostics |
| Comprehensive system diagnostics for the Vortex platform. More... | |
| struct | ManagerHealthEntry |
| Per-manager health entry for unified error aggregation. More... | |
| struct | ManagerHealthSnapshot |
| Aggregated health snapshot across all Vortex managers. More... | |
| class | Vortex |
| Unified API singleton for the HardFOC Vortex platform. More... | |
Macros | |
| #define | VORTEX_API Vortex::GetInstance() |
| Global access macro for Vortex API. | |
| #define | VORTEX_API_INIT() (Vortex::GetInstance().EnsureInitialized(), Vortex::GetInstance()) |
| Global access macro for Vortex API with initialization check. | |
Enumerations | |
| enum class | VortexOnboardTmc9660Transport : std::uint8_t { Spi = 0 , Uart = 1 } |
Host physical layer used for the onboard TMC9660 during Vortex::InitializeMotors(). More... | |
Functions | |
| Vortex & | GetVortex () noexcept |
| Convenience accessor — equivalent to Vortex::GetInstance(). | |
Unified API singleton for the HardFOC Vortex platform.
This class provides a beautiful, unified access point to all component handlers in the HardFOC Vortex system. It implements lazy initialization with proper dependency management and ensures all singletons are properly initialized in the correct order before exposing them to the user.
Key Features:
Architecture:
Initialization Order:
SetOnboardTmc9660Transport() before EnsureInitialized() — default is UART)EnsureInitialized() succeeds when NVS, comms, GPIO, and LEDs are up; motor / sensor failures produce warnings and degraded diagnostics.Usage Example:
| #define VORTEX_API Vortex::GetInstance() |
| #define VORTEX_API_INIT | ( | ) | (Vortex::GetInstance().EnsureInitialized(), Vortex::GetInstance()) |
Global access macro for Vortex API with initialization check.
|
strong |
Host physical layer used for the onboard TMC9660 during Vortex::InitializeMotors().
Vortex always exposes a UART to the TMC9660. SPI to the motor IC is muxed (PCAL_TMC_SPI_COMM_EN); MotorController asserts it only for SPI handlers. Default is UART (bootloader/TMCL over UART, SPI mux released). Call SetOnboardTmc9660Transport(VortexOnboardTmc9660Transport::Spi) before EnsureInitialized() if you need TMCL over SPI instead.
| Enumerator | |
|---|---|
| Spi | |
| Uart | |
|
inlinenoexcept |
Convenience accessor — equivalent to Vortex::GetInstance().