HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
Tmc9660Handler::Temperature Class Reference

BaseTemperature adapter for the TMC9660 internal chip temperature sensor. More...

#include <Tmc9660Handler.h>

Inheritance diagram for Tmc9660Handler::Temperature:
[legend]
Collaboration diagram for Tmc9660Handler::Temperature:
[legend]

Public Member Functions

 Temperature (Tmc9660Handler &parent)
 Construct the temperature wrapper.
 
 ~Temperature () noexcept override=default
 Default destructor.
 
BaseTemperature Interface Implementation
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.
 

Private Member Functions

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.
 

Private Attributes

Tmc9660Handlerparent_
 Owning handler.
 
RtosMutex mutex_
 Thread-safety for statistics.
 
hf_temp_statistics_t statistics_
 Accumulated operation statistics.
 
hf_temp_diagnostics_t diagnostics_
 Health and error diagnostics.
 
std::atomic< hf_temp_err_tlast_error_
 Most recent error code.
 

Detailed Description

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 manager-layer ownership, use Tmc9660TemperatureWrapper (defined in TemperatureManager.h).

Constructor & Destructor Documentation

◆ Temperature()

Tmc9660Handler::Temperature::Temperature ( Tmc9660Handler & parent)

Construct the temperature wrapper.

Parameters
parentReference to the owning Tmc9660Handler.
Here is the call graph for this function:

◆ ~Temperature()

Tmc9660Handler::Temperature::~Temperature ( )
overridedefaultnoexcept

Default destructor.

Member Function Documentation

◆ Deinitialize()

bool Tmc9660Handler::Temperature::Deinitialize ( )
overridenoexcept

Deinitialize (no-op).

◆ 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.
Here is the call graph for this function:

◆ GetCurrentTimeUs()

uint64_t Tmc9660Handler::Temperature::GetCurrentTimeUs ( ) const
privatenoexcept

Get current time in microseconds.

Here is the call graph for this function:

◆ 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]infoPointer to store the sensor info struct.
Returns
TEMP_SUCCESS or TEMP_ERR_NULL_POINTER.
Here is the call graph for this function:

◆ Initialize()

bool Tmc9660Handler::Temperature::Initialize ( )
overridenoexcept

Initialize (verifies parent driver is ready).

Here is the call graph for this function:

◆ ReadTemperatureCelsiusImpl()

hf_temp_err_t Tmc9660Handler::Temperature::ReadTemperatureCelsiusImpl ( float * temperature_celsius)
overridenoexcept

Read the chip temperature in degrees Celsius.

Parameters
[out]temperature_celsiusPointer to store the temperature reading.
Returns
TEMP_SUCCESS, TEMP_ERR_READ_FAILED, or TEMP_ERR_OUT_OF_RANGE.
Here is the call graph for this function:

◆ UpdateDiagnostics()

void Tmc9660Handler::Temperature::UpdateDiagnostics ( hf_temp_err_t error)
privatenoexcept

Update error diagnostics.

Here is the call graph for this function:

◆ UpdateStatistics()

hf_temp_err_t Tmc9660Handler::Temperature::UpdateStatistics ( hf_temp_err_t result,
uint64_t start_time_us )
privatenoexcept

Update operation timing statistics.

Here is the call graph for this function:

Member Data Documentation

◆ 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

Most recent error code.

◆ mutex_

RtosMutex Tmc9660Handler::Temperature::mutex_
mutableprivate

Thread-safety for statistics.

◆ parent_

Tmc9660Handler& Tmc9660Handler::Temperature::parent_
private

Owning handler.

◆ statistics_

hf_temp_statistics_t Tmc9660Handler::Temperature::statistics_
mutableprivate

Accumulated operation statistics.


The documentation for this class was generated from the following files: