|
Internal Interface Wrap
API reference
|
MCU-integrated periodic timer implementation. More...
#include <EspPeriodicTimer.h>
Private Member Functions | |
| hf_timer_err_t | ConvertError (int platform_error) const noexcept |
| Convert platform-specific error to hf_timer_err_t. | |
| bool | ValidatePeriod (hf_u64_t period_us) const noexcept |
| Validate timer period. | |
| bool | CreateTimerHandle () noexcept |
| Create platform-specific timer handle. | |
| void | DestroyTimerHandle () noexcept |
| Destroy platform-specific timer handle. | |
Static Private Member Functions | |
| static void | InternalTimerCallback (void *arg) |
| Internal timer callback dispatcher (ISR-safe C bridge). | |
Private Attributes | |
| hf_timer_handle_t | timer_handle_ |
| Platform-specific timer handle. | |
| hf_u64_t | period_us_ |
| Current timer period in microseconds. | |
| hf_timer_stats_t | stats_ |
| Timer statistics. | |
Additional Inherited Members | |
Protected Member Functions inherited from BasePeriodicTimer | |
| 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 inherited from BasePeriodicTimer | |
| 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. | |
MCU-integrated periodic timer implementation.
This class provides periodic timer functionality using the microcontroller's built-in timer peripherals. On ESP32, it uses the ESP timer API. The implementation handles platform-specific details while providing the unified BasePeriodicTimer API.
Features:
|
noexcept |
Constructor with callback specification.
| callback | Callback function to be called on timer expiry |
| user_data | User data passed to callback function |
|
overridenoexcept |
Destructor - ensures timer is stopped and resources are freed.
|
delete |
|
delete |
|
privatenoexcept |
Convert platform-specific error to hf_timer_err_t.
| platform_error | Platform-specific error code |
|
privatenoexcept |
Create platform-specific timer handle.
|
overridevirtualnoexcept |
Deinitialize the timer and free resources.
Implements BasePeriodicTimer.
|
privatenoexcept |
Destroy platform-specific timer handle.
Get description of this timer implementation.
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
Get timer diagnostic information.
| diagnostics | Reference to diagnostics structure to fill |
Reimplemented from BasePeriodicTimer.
|
overridevirtualnoexcept |
Get maximum supported timer period.
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
Get minimum supported timer period.
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
Get current timer period.
| period_us | Reference to store current period |
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
Get timer operation statistics.
| statistics | Reference to statistics structure to fill |
Reimplemented from BasePeriodicTimer.
|
overridevirtualnoexcept |
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 |
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
Internal timer callback dispatcher (ISR-safe C bridge).
| arg | User data (pointer to EspPeriodicTimer instance) |
|
delete |
|
delete |
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
Change timer period (timer can be running or stopped).
| new_period_us | New period in microseconds |
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
Start the timer with specified period.
| period_us | Timer period in microseconds |
Implements BasePeriodicTimer.
|
overridevirtualnoexcept |
Validate timer period.
| period_us | Period to validate in microseconds |
|
private |
Current timer period in microseconds.
|
private |
Timer statistics.
|
private |
Platform-specific timer handle.