|
HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
|
Unified handler for TMC9660 motor controller with GPIO, ADC, and temperature integration. More...
#include <cstdint>#include <memory>#include <array>#include <atomic>#include <type_traits>#include <variant>#include "core/hf-core-drivers/external/hf-tmc9660-driver/inc/tmc9660.hpp"#include "core/hf-core-drivers/external/hf-tmc9660-driver/inc/tmc9660_comm_interface.hpp"#include "base/BaseGpio.h"#include "base/BaseAdc.h"#include "base/BaseTemperature.h"#include "base/BaseSpi.h"#include "base/BaseUart.h"#include "RtosMutex.h"#include <utility>Go to the source code of this file.
Classes | |
| struct | Tmc9660CtrlPins |
| Shared helper holding the four TMC9660 host-side control pin references. More... | |
| class | HalSpiTmc9660Comm |
| Concrete SPI communication adapter for TMC9660 using BaseSpi and BaseGpio. More... | |
| class | HalUartTmc9660Comm |
| Concrete UART communication adapter for TMC9660 using BaseUart and BaseGpio. More... | |
| class | Tmc9660Handler |
| Unified, non-templated handler for a single TMC9660 motor controller device. More... | |
| class | Tmc9660Handler::Gpio |
| BaseGpio adapter for a single TMC9660 internal GPIO channel. More... | |
| class | Tmc9660Handler::Adc |
| BaseAdc adapter for all TMC9660 ADC channels. More... | |
| class | Tmc9660Handler::Temperature |
| BaseTemperature adapter for the TMC9660 internal chip temperature sensor. More... | |
Unified handler for TMC9660 motor controller with GPIO, ADC, and temperature integration.
This file provides the complete HAL-level integration for a single TMC9660 motor driver device. It bridges the HardFOC base interfaces (BaseSpi, BaseUart, BaseGpio, BaseAdc, BaseTemperature) with the templated tmc9660::TMC9660<CommType> driver from the hf-tmc9660-driver library.
The file contains three layers:
The handler owns all its internal resources:
External managers (AdcManager, TemperatureManager) that need to own a BaseAdc* or BaseTemperature* should use the thin delegation wrappers Tmc9660AdcWrapper and Tmc9660TemperatureWrapper (defined in their own files), which delegate to the handler's inner class instances.
The handler uses RtosMutex (recursive) for thread-safe access to all public methods. visitDriver() acquires the lock automatically. Raw pointer methods (driverViaSpi(), driverViaUart()) are NOT mutex-protected — the caller is responsible for synchronization when using them from multiple tasks. The Adc and Temperature inner classes use additional RtosMutex instances for their internal statistics tracking.