HardFOC Vortex V1 HAL
Unified HAL API for the HardFOC Vortex motor-control platform (ESP32-C6, TMC9660)
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
VortexDiagnostics.h File Reference

One error catalog and one aggregated health snapshot for the whole Vortex HAL. More...

#include <array>
#include <cstddef>
#include <cstdint>
Include dependency graph for VortexDiagnostics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ManagerDiagnostics
 One manager's state in the aggregated snapshot. More...
 
struct  VortexBoardDiagnostics
 Aggregated board health (Vortex::CollectDiagnostics()). Index order of managers = init order. More...
 

Enumerations

enum class  ManagerError : uint8_t {
  None = 0 , NotInitialized , DependencyNotReady , BusUnavailable ,
  DeviceNotFound , InitFailed , CommunicationFailed , InvalidParameter ,
  HardwareFault , Unknown
}
 The shared error catalog (manager lane). More...
 

Functions

constexpr const char * ManagerErrorToString (ManagerError e) noexcept
 Short text for a ManagerError.
 

Variables

constexpr size_t kVortexManagerCount = 9
 Number of managers the facade owns (NVS, comms, GPIO, LEDs, motors, ADC, IMU, encoders, temperature).
 

Detailed Description

One error catalog and one aggregated health snapshot for the whole Vortex HAL.

Each manager keeps its own error enum (CommError, MotorError, hf_gpio_err_t, ...). The facade maps them onto ManagerError, the shared catalog, so a caller can judge the board without knowing nine enums; the raw code travels alongside for the detail. Vortex::CollectDiagnostics() fills VortexBoardDiagnostics from counters the managers already hold: it makes no bus transfer and does not allocate, so it is safe from a periodic health task.

Ownership: value types. Thread safety: filled under the facade's lifecycle lock. MCU-free.

Enumeration Type Documentation

◆ ManagerError

enum class ManagerError : uint8_t
strong

The shared error catalog (manager lane).

Enumerator
None 

No error.

NotInitialized 

The manager is not up (never initialised, shut down, or failed)

DependencyNotReady 

A manager or bus it needs is not up.

BusUnavailable 

No usable bus (SPI / I2C / UART / CAN) or the binding refused it.

DeviceNotFound 

No device at the slot, address or name.

InitFailed 

Bring-up of a device failed (bootloader, sensor reset, ...)

CommunicationFailed 

A transfer failed (NACK, CRC, timeout)

InvalidParameter 

Out-of-range index or argument.

HardwareFault 

The device reported a fault, or a read returned an error code.

Unknown 

A code the facade does not map.

Function Documentation

◆ ManagerErrorToString()

constexpr const char * ManagerErrorToString ( ManagerError  e)
constexprnoexcept

Short text for a ManagerError.

Variable Documentation

◆ kVortexManagerCount

constexpr size_t kVortexManagerCount = 9
inlineconstexpr

Number of managers the facade owns (NVS, comms, GPIO, LEDs, motors, ADC, IMU, encoders, temperature).