BaseTemperature adapter for the TMC9660 internal chip temperature sensor.
More...
#include <Tmc9660Handler.h>
|
| | Temperature (Tmc9660Handler &parent) |
| | Construct the temperature wrapper.
|
| |
| | ~Temperature () noexcept override=default |
| | Default destructor.
|
| |
|
| bool | Initialize () noexcept override |
| | Initialize (verifies parent driver is ready).
|
| |
| bool | Deinitialize () noexcept override |
| | Deinitialize (no-op).
|
| |
| hf_temp_err_t | ReadTemperatureCelsiusImpl (float *temperature_celsius) noexcept override |
| | Read the chip temperature in degrees Celsius.
|
| |
| hf_temp_err_t | GetSensorInfo (hf_temp_sensor_info_t *info) const noexcept override |
| | Get sensor information (type, range, resolution, accuracy).
|
| |
| hf_u32_t | GetCapabilities () const noexcept override |
| | Get sensor capabilities flags.
|
| |
|
| hf_temp_err_t | UpdateStatistics (hf_temp_err_t result, uint64_t start_time_us) noexcept |
| | Update operation timing statistics.
|
| |
| uint64_t | GetCurrentTimeUs () const noexcept |
| | Get current time in microseconds.
|
| |
| void | UpdateDiagnostics (hf_temp_err_t error) noexcept |
| | Update error diagnostics.
|
| |
BaseTemperature adapter for the TMC9660 internal chip temperature sensor.
Reads the TMC9660's built-in chip temperature via the telemetry subsystem and presents it through the standard HardFOC BaseTemperature interface. Includes thread-safe statistics and diagnostics tracking.
Sensor specifications:
- Range: -40°C to +150°C
- Resolution: 0.1°C
- Accuracy: ±2°C typical
- Response time: ~100ms
- Note
- This inner class is owned by the handler. For host ownership of a
BaseTemperature*, use Tmc9660TemperatureWrapper.
◆ Temperature()
Construct the temperature wrapper.
- Parameters
-
◆ ~Temperature()
| Tmc9660Handler::Temperature::~Temperature |
( |
| ) |
|
|
overridedefaultnoexcept |
◆ Deinitialize()
| bool Tmc9660Handler::Temperature::Deinitialize |
( |
| ) |
|
|
overridenoexcept |
◆ GetCapabilities()
| hf_u32_t Tmc9660Handler::Temperature::GetCapabilities |
( |
| ) |
const |
|
overridenoexcept |
Get sensor capabilities flags.
- Returns
- Bitmask of HF_TEMP_CAP_HIGH_PRECISION | HF_TEMP_CAP_FAST_RESPONSE.
◆ GetCurrentTimeUs()
| uint64_t Tmc9660Handler::Temperature::GetCurrentTimeUs |
( |
| ) |
const |
|
privatenoexcept |
Get current time in microseconds.
◆ GetSensorInfo()
| hf_temp_err_t Tmc9660Handler::Temperature::GetSensorInfo |
( |
hf_temp_sensor_info_t * |
info | ) |
const |
|
overridenoexcept |
Get sensor information (type, range, resolution, accuracy).
- Parameters
-
| [out] | info | Pointer to store the sensor info struct. |
- Returns
- TEMP_SUCCESS or TEMP_ERR_NULL_POINTER.
◆ Initialize()
| bool Tmc9660Handler::Temperature::Initialize |
( |
| ) |
|
|
overridenoexcept |
Initialize (verifies parent driver is ready).
◆ ReadTemperatureCelsiusImpl()
| hf_temp_err_t Tmc9660Handler::Temperature::ReadTemperatureCelsiusImpl |
( |
float * |
temperature_celsius | ) |
|
|
overridenoexcept |
Read the chip temperature in degrees Celsius.
- Parameters
-
| [out] | temperature_celsius | Pointer to store the temperature reading. |
- Returns
- TEMP_SUCCESS, TEMP_ERR_READ_FAILED, or TEMP_ERR_OUT_OF_RANGE.
◆ UpdateDiagnostics()
| void Tmc9660Handler::Temperature::UpdateDiagnostics |
( |
hf_temp_err_t |
error | ) |
|
|
privatenoexcept |
Update error diagnostics.
◆ UpdateStatistics()
| hf_temp_err_t Tmc9660Handler::Temperature::UpdateStatistics |
( |
hf_temp_err_t |
result, |
|
|
uint64_t |
start_time_us |
|
) |
| |
|
privatenoexcept |
Update operation timing statistics.
◆ diagnostics_
| hf_temp_diagnostics_t Tmc9660Handler::Temperature::diagnostics_ |
|
mutableprivate |
Health and error diagnostics.
◆ last_error_
| std::atomic<hf_temp_err_t> Tmc9660Handler::Temperature::last_error_ |
|
private |
◆ mutex_
| RtosMutex Tmc9660Handler::Temperature::mutex_ |
|
mutableprivate |
Thread-safety for statistics.
◆ parent_
◆ statistics_
| hf_temp_statistics_t Tmc9660Handler::Temperature::statistics_ |
|
mutableprivate |
Accumulated operation statistics.
The documentation for this class was generated from the following files: