HardFOC Core
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Tmc9660AdcWrapper Class Reference

Delegation wrapper that adapts Tmc9660Handler::Adc for external ownership. More...

#include <Tmc9660AdcWrapper.h>

Inheritance diagram for Tmc9660AdcWrapper:

Public Member Functions

 Tmc9660AdcWrapper (Tmc9660Handler &handler) noexcept
 Construct the ADC delegation wrapper.
 
 ~Tmc9660AdcWrapper () noexcept override=default
 Default destructor. Does not affect the handler or its ADC.
 
 Tmc9660AdcWrapper (const Tmc9660AdcWrapper &)=delete
 Non-copyable, non-movable (reference semantics – cannot rebind handler_).
 
Tmc9660AdcWrapper & operator= (const Tmc9660AdcWrapper &)=delete
 
 Tmc9660AdcWrapper (Tmc9660AdcWrapper &&)=delete
 
Tmc9660AdcWrapper & operator= (Tmc9660AdcWrapper &&)=delete
 
BaseAdc Delegation Methods

Each method delegates directly to the handler's Adc instance.

bool Initialize () noexcept override
 
bool Deinitialize () noexcept override
 
hf_u8_t GetMaxChannels () const noexcept override
 
bool IsChannelAvailable (hf_channel_id_t channel_id) const noexcept override
 
hf_adc_err_t ReadChannelV (hf_channel_id_t channel_id, float &channel_reading_v, hf_u8_t numOfSamplesToAvg=1, hf_time_t timeBetweenSamples=0) noexcept override
 
hf_adc_err_t ReadChannelCount (hf_channel_id_t channel_id, hf_u32_t &channel_reading_count, hf_u8_t numOfSamplesToAvg=1, hf_time_t timeBetweenSamples=0) noexcept override
 
hf_adc_err_t ReadChannel (hf_channel_id_t channel_id, hf_u32_t &channel_reading_count, float &channel_reading_v, hf_u8_t numOfSamplesToAvg=1, hf_time_t timeBetweenSamples=0) noexcept override
 
hf_adc_err_t ReadMultipleChannels (const hf_channel_id_t *channel_ids, hf_u8_t num_channels, hf_u32_t *readings, float *voltages) noexcept override
 
hf_adc_err_t GetStatistics (hf_adc_statistics_t &statistics) noexcept override
 
hf_adc_err_t GetDiagnostics (hf_adc_diagnostics_t &diagnostics) noexcept override
 
hf_adc_err_t ResetStatistics () noexcept override
 
hf_adc_err_t ResetDiagnostics () noexcept override
 

Private Attributes

Tmc9660Handler & handler_
 Reference to the TMC9660 handler (not owned).
 

Detailed Description

Delegation wrapper that adapts Tmc9660Handler::Adc for external ownership.

This is a pure delegation class. Every BaseAdc method simply calls the corresponding method on the Tmc9660Handler's internal Adc instance via Tmc9660Handler::AdcInstance(). It exists solely to allow a host to own a std::unique_ptr<BaseAdc> that refers to TMC9660 ADC functionality without transferring ownership of the handler's internal objects.

Note
This class does NOT own or manage the Tmc9660Handler. The handler must outlive all Tmc9660AdcWrapper instances that reference it.
See also
Tmc9660Handler::Adc Inner class with the actual implementation.

Constructor & Destructor Documentation

◆ Tmc9660AdcWrapper() [1/3]

Tmc9660AdcWrapper::Tmc9660AdcWrapper ( Tmc9660Handler &  handler)
explicitnoexcept

Construct the ADC delegation wrapper.

Parameters
handlerReference to a live Tmc9660Handler whose Adc instance this wrapper delegates to.
Warning
The handler must remain valid for the lifetime of this wrapper.

◆ ~Tmc9660AdcWrapper()

Tmc9660AdcWrapper::~Tmc9660AdcWrapper ( )
overridedefaultnoexcept

Default destructor. Does not affect the handler or its ADC.

◆ Tmc9660AdcWrapper() [2/3]

Tmc9660AdcWrapper::Tmc9660AdcWrapper ( const Tmc9660AdcWrapper &  )
delete

Non-copyable, non-movable (reference semantics – cannot rebind handler_).

◆ Tmc9660AdcWrapper() [3/3]

Tmc9660AdcWrapper::Tmc9660AdcWrapper ( Tmc9660AdcWrapper &&  )
delete

Member Function Documentation

◆ Deinitialize()

bool Tmc9660AdcWrapper::Deinitialize ( )
overridenoexcept

◆ GetDiagnostics()

hf_adc_err_t Tmc9660AdcWrapper::GetDiagnostics ( hf_adc_diagnostics_t &  diagnostics)
overridenoexcept

◆ GetMaxChannels()

hf_u8_t Tmc9660AdcWrapper::GetMaxChannels ( ) const
overridenoexcept

◆ GetStatistics()

hf_adc_err_t Tmc9660AdcWrapper::GetStatistics ( hf_adc_statistics_t &  statistics)
overridenoexcept

◆ Initialize()

bool Tmc9660AdcWrapper::Initialize ( )
overridenoexcept

◆ IsChannelAvailable()

bool Tmc9660AdcWrapper::IsChannelAvailable ( hf_channel_id_t  channel_id) const
overridenoexcept

◆ operator=() [1/2]

Tmc9660AdcWrapper & Tmc9660AdcWrapper::operator= ( const Tmc9660AdcWrapper &  )
delete

◆ operator=() [2/2]

Tmc9660AdcWrapper & Tmc9660AdcWrapper::operator= ( Tmc9660AdcWrapper &&  )
delete

◆ ReadChannel()

hf_adc_err_t Tmc9660AdcWrapper::ReadChannel ( hf_channel_id_t  channel_id,
hf_u32_t &  channel_reading_count,
float &  channel_reading_v,
hf_u8_t  numOfSamplesToAvg = 1,
hf_time_t  timeBetweenSamples = 0 
)
overridenoexcept

◆ ReadChannelCount()

hf_adc_err_t Tmc9660AdcWrapper::ReadChannelCount ( hf_channel_id_t  channel_id,
hf_u32_t &  channel_reading_count,
hf_u8_t  numOfSamplesToAvg = 1,
hf_time_t  timeBetweenSamples = 0 
)
overridenoexcept

◆ ReadChannelV()

hf_adc_err_t Tmc9660AdcWrapper::ReadChannelV ( hf_channel_id_t  channel_id,
float &  channel_reading_v,
hf_u8_t  numOfSamplesToAvg = 1,
hf_time_t  timeBetweenSamples = 0 
)
overridenoexcept

◆ ReadMultipleChannels()

hf_adc_err_t Tmc9660AdcWrapper::ReadMultipleChannels ( const hf_channel_id_t *  channel_ids,
hf_u8_t  num_channels,
hf_u32_t *  readings,
float *  voltages 
)
overridenoexcept

◆ ResetDiagnostics()

hf_adc_err_t Tmc9660AdcWrapper::ResetDiagnostics ( )
overridenoexcept

◆ ResetStatistics()

hf_adc_err_t Tmc9660AdcWrapper::ResetStatistics ( )
overridenoexcept

Member Data Documentation

◆ handler_

Tmc9660Handler& Tmc9660AdcWrapper::handler_
private

Reference to the TMC9660 handler (not owned).


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