|
HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
|
Base class for ADCs. More...
#include <BaseAdc.h>
Public Member Functions | |
| virtual | ~BaseAdc () noexcept=default |
| Virtual destructor. | |
| BaseAdc (const BaseAdc &)=delete | |
| BaseAdc & | operator= (const BaseAdc &)=delete |
| BaseAdc (BaseAdc &&) noexcept=default | |
| BaseAdc & | operator= (BaseAdc &&) noexcept=default |
| bool | EnsureInitialized () noexcept |
| Ensures that the ADC is initialized (lazy initialization). | |
| bool | EnsureDeinitialized () noexcept |
| Ensures that the ADC is initialized (lazy initialization). | |
| bool | IsInitialized () const noexcept |
| Checks if the class is initialized. | |
| virtual bool | Initialize () noexcept=0 |
| Initializes the ADC peripheral (must be implemented by derived classes). | |
| virtual bool | Deinitialize () noexcept=0 |
| Deinitializes the ADC peripheral (must be implemented by derived classes).. | |
| virtual hf_u8_t | GetMaxChannels () const noexcept=0 |
| Get the maximum number of channels supported by this ADC. | |
| virtual bool | IsChannelAvailable (hf_channel_id_t channel_id) const noexcept=0 |
| Check if a specific channel is available. | |
| virtual 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=0 |
| Read channel voltage. | |
| virtual 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=0 |
| Read channel count (raw ADC value). | |
| virtual 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=0 |
| Read both channel count and voltage. | |
| virtual hf_adc_err_t | ReadMultipleChannels (const hf_channel_id_t *channel_ids, hf_u8_t num_channels, hf_u32_t *readings, float *voltages) noexcept |
| Read multiple channels simultaneously. | |
| virtual hf_adc_err_t | ResetStatistics () noexcept |
| Reset ADC operation statistics. | |
| virtual hf_adc_err_t | ResetDiagnostics () noexcept |
| Reset ADC diagnostic information. | |
| virtual hf_adc_err_t | GetStatistics (hf_adc_statistics_t &statistics) noexcept |
| Get ADC operation statistics. | |
| virtual hf_adc_err_t | GetDiagnostics (hf_adc_diagnostics_t &diagnostics) noexcept |
| Get ADC diagnostic information. | |
Protected Member Functions | |
| BaseAdc () noexcept | |
| Protected default constructor. | |
Protected Attributes | |
| bool | initialized_ |
| Initialization status. | |
| hf_adc_statistics_t | statistics_ |
| ADC operation statistics. | |
| hf_adc_diagnostics_t | diagnostics_ |
| ADC diagnostic information. | |
Base class for ADCs.
This class provides a common interface for all ADC implementations in the HardFOC system. It supports lazy initialization, robust error handling, and consistent API across different ADC hardware.
|
virtualdefaultnoexcept |
Virtual destructor.
|
delete |
|
defaultnoexcept |
|
inlineprotectednoexcept |
Protected default constructor.
|
pure virtualnoexcept |
Deinitializes the ADC peripheral (must be implemented by derived classes)..
Implemented in StmAdc.
|
inlinenoexcept |
Ensures that the ADC is initialized (lazy initialization).
|
inlinenoexcept |
Ensures that the ADC is initialized (lazy initialization).
|
inlinevirtualnoexcept |
Get ADC diagnostic information.
| diagnostics | Reference to diagnostics structure to fill |
|
pure virtualnoexcept |
Get the maximum number of channels supported by this ADC.
Implemented in StmAdc.
|
inlinevirtualnoexcept |
Get ADC operation statistics.
| statistics | Reference to statistics structure to fill |
|
pure virtualnoexcept |
Initializes the ADC peripheral (must be implemented by derived classes).
Implemented in StmAdc.
|
pure virtualnoexcept |
Check if a specific channel is available.
| channel_id | Channel ID to check |
Implemented in StmAdc.
|
inlinenoexcept |
Checks if the class is initialized.
|
pure virtualnoexcept |
Read both channel count and voltage.
| channel_id | Channel ID to read from |
| channel_reading_count | Reference to store count reading |
| channel_reading_v | Reference to store voltage reading |
| numOfSamplesToAvg | Number of samples to average (default 1) |
| timeBetweenSamples | Time between samples in milliseconds (default 0) |
Implemented in StmAdc.
|
pure virtualnoexcept |
Read channel count (raw ADC value).
| channel_id | Channel ID to read from |
| channel_reading_count | Reference to store count reading |
| numOfSamplesToAvg | Number of samples to average (default 1) |
| timeBetweenSamples | Time between samples in milliseconds (default 0) |
Implemented in StmAdc.
|
pure virtualnoexcept |
Read channel voltage.
| channel_id | Channel ID to read from |
| channel_reading_v | Reference to store voltage reading |
| numOfSamplesToAvg | Number of samples to average (default 1) |
| timeBetweenSamples | Time between samples in milliseconds (default 0) |
Implemented in StmAdc.
|
inlinevirtualnoexcept |
Read multiple channels simultaneously.
| channel_ids | Array of channel IDs |
| num_channels | Number of channels |
| readings | Array to store raw readings |
| voltages | Array to store voltage readings |
|
inlinevirtualnoexcept |
Reset ADC diagnostic information.
|
inlinevirtualnoexcept |
Reset ADC operation statistics.
|
protected |
ADC diagnostic information.
|
protected |
Initialization status.
|
protected |
ADC operation statistics.