|
HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
|
Abstract base class for periodic timer operations. More...
#include <BasePeriodicTimer.h>
Public Member Functions | |
| virtual | ~BasePeriodicTimer () noexcept=default |
| Virtual destructor to ensure proper cleanup. | |
| BasePeriodicTimer (const BasePeriodicTimer &)=delete | |
| BasePeriodicTimer & | operator= (const BasePeriodicTimer &)=delete |
| virtual hf_timer_err_t | Initialize () noexcept=0 |
| Initialize the timer hardware/resources. | |
| virtual hf_timer_err_t | Deinitialize () noexcept=0 |
| Deinitialize the timer and free resources. | |
| virtual hf_timer_err_t | Start (hf_u64_t period_us) noexcept=0 |
| Start the periodic timer with specified period. | |
| virtual hf_timer_err_t | Stop () noexcept=0 |
| Stop the periodic timer. | |
| virtual hf_timer_err_t | SetPeriod (hf_u64_t period_us) noexcept=0 |
| Change the timer period while running. | |
| virtual hf_timer_err_t | GetPeriod (hf_u64_t &period_us) noexcept=0 |
| Get the current timer period. | |
| virtual hf_timer_err_t | GetStats (hf_u64_t &callback_count, hf_u64_t &missed_callbacks, hf_timer_err_t &last_error) noexcept=0 |
| Get timer statistics and status information. | |
| virtual hf_timer_err_t | ResetStats () noexcept=0 |
| Reset timer statistics. | |
| bool | IsInitialized () const noexcept |
| Check if timer is initialized. | |
| bool | IsRunning () const noexcept |
| Check if timer is currently running. | |
| virtual const char * | GetDescription () const noexcept=0 |
| Get description of this timer implementation. | |
| virtual hf_u64_t | GetMaxPeriod () const noexcept=0 |
| Get minimum supported timer period. | |
| virtual hf_u64_t | GetMinPeriod () const noexcept=0 |
| Get maximum supported timer period. | |
| virtual hf_u64_t | GetResolution () const noexcept=0 |
| Get timer resolution. | |
| hf_timer_err_t | SetCallback (hf_timer_callback_t callback, void *user_data=nullptr) noexcept |
| Set new callback function. | |
| void * | GetUserData () const noexcept |
| Get current user data pointer. | |
| virtual hf_timer_err_t | ResetStatistics () noexcept |
| Reset timer operation statistics. | |
| virtual hf_timer_err_t | ResetDiagnostics () noexcept |
| Reset timer diagnostic information. | |
| virtual hf_timer_err_t | GetStatistics (hf_timer_statistics_t &statistics) const noexcept |
| Get timer operation statistics. | |
| virtual hf_timer_err_t | GetDiagnostics (hf_timer_diagnostics_t &diagnostics) const noexcept |
| Get timer diagnostic information. | |
Protected Member Functions | |
| BasePeriodicTimer (hf_timer_callback_t callback, void *user_data=nullptr) noexcept | |
| Protected constructor with callback specification. | |
| void | SetInitialized (bool initialized) noexcept |
| Set the initialized state. | |
| void | SetRunning (bool running) noexcept |
| Set the running state. | |
| void | ExecuteCallback () noexcept |
| Execute the timer callback (called by implementations). | |
| bool | HasValidCallback () const noexcept |
| Check if callback is valid. | |
Protected Attributes | |
| hf_timer_callback_t | callback_ |
| Timer callback function. | |
| void * | user_data_ |
| User data passed to callback. | |
| bool | initialized_ |
| Initialization state flag. | |
| bool | running_ |
| Running state flag. | |
| hf_timer_statistics_t | statistics_ |
| Timer operation statistics. | |
| hf_timer_diagnostics_t | diagnostics_ |
| Timer diagnostic information. | |
Abstract base class for periodic timer operations.
This class provides a consistent interface for periodic timer functionality across different hardware platforms and timer implementations. It supports high-resolution timing, callback-based notifications, and precise period control.
Key Features:
|
virtualdefaultnoexcept |
Virtual destructor to ensure proper cleanup.
|
delete |
|
inlineexplicitprotectednoexcept |
Protected constructor with callback specification.
| callback | Timer callback function |
| user_data | User data passed to callback |
|
pure virtualnoexcept |
Deinitialize the timer and free resources.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlineprotectednoexcept |
Execute the timer callback (called by implementations).
|
pure virtualnoexcept |
Get description of this timer implementation.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlinevirtualnoexcept |
Get timer diagnostic information.
| diagnostics | Reference to store diagnostics data |
Reimplemented in EspPeriodicTimer, and StmPeriodicTimer.
|
pure virtualnoexcept |
Get minimum supported timer period.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
pure virtualnoexcept |
Get maximum supported timer period.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
pure virtualnoexcept |
Get the current timer period.
| period_us | Reference to store the current period |
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
pure virtualnoexcept |
Get timer resolution.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlinevirtualnoexcept |
Get timer operation statistics.
| statistics | Reference to store statistics data |
Reimplemented in EspPeriodicTimer, and StmPeriodicTimer.
|
pure virtualnoexcept |
Get timer statistics and status information.
| callback_count | Number of callbacks executed |
| missed_callbacks | Number of missed callbacks (if supported) |
| last_error | Last error that occurred |
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlinenoexcept |
Get current user data pointer.
|
inlineprotectednoexcept |
Check if callback is valid.
|
pure virtualnoexcept |
Initialize the timer hardware/resources.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlinenoexcept |
Check if timer is initialized.
|
inlinenoexcept |
Check if timer is currently running.
|
delete |
|
inlinevirtualnoexcept |
Reset timer diagnostic information.
|
inlinevirtualnoexcept |
Reset timer operation statistics.
|
pure virtualnoexcept |
Reset timer statistics.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlinenoexcept |
Set new callback function.
| callback | New callback function |
| user_data | New user data |
|
inlineprotectednoexcept |
Set the initialized state.
| initialized | New initialization state |
|
pure virtualnoexcept |
Change the timer period while running.
| period_us | New timer period in microseconds |
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
inlineprotectednoexcept |
Set the running state.
| running | New running state |
|
pure virtualnoexcept |
Start the periodic timer with specified period.
| period_us | Timer period in microseconds |
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
pure virtualnoexcept |
Stop the periodic timer.
Implemented in EspPeriodicTimer, and StmPeriodicTimer.
|
protected |
Timer callback function.
|
protected |
Timer diagnostic information.
|
protected |
Initialization state flag.
|
protected |
Running state flag.
|
protected |
Timer operation statistics.
|
protected |
User data passed to callback.