Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl > Class Template Reference

Simple non-blocking delay using system time. More...

#include <non_blocking_delay.hpp>

Collaboration diagram for sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >:

Public Member Functions

 NonBlockingDelay (uint32_t delay_ms)
 Constructor with delay period.
 
void start ()
 Start the delay timer.
 
bool ready () const
 Check if delay period has elapsed.
 
void reset ()
 Reset the delay timer for next period.
 
void stop ()
 Stop the delay timer.
 
bool isActive () const
 Check if timer is active.
 
void setPeriod (uint32_t delay_ms)
 Update delay period.
 
uint32_t getPeriod () const
 Get current delay period.
 

Detailed Description

template<typename SystemTimeImpl>
class sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >

Simple non-blocking delay using system time.

Template-based non-blocking delay that uses HAL system time interface. Applications typically use this through board-provided timing utilities.

Template Parameters
SystemTimeImplHAL system time implementation
Note
All public methods are ISR-safe — timer reads only, no blocking.

Definition at line 32 of file non_blocking_delay.hpp.

Constructor & Destructor Documentation

◆ NonBlockingDelay()

template<typename SystemTimeImpl >
sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::NonBlockingDelay ( uint32_t  delay_ms)
inlineexplicit

Constructor with delay period.

Parameters
delay_msDelay period in milliseconds

Definition at line 38 of file non_blocking_delay.hpp.

Member Function Documentation

◆ getPeriod()

template<typename SystemTimeImpl >
uint32_t sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::getPeriod ( ) const
inline

Get current delay period.

Returns
Current delay period in milliseconds

Definition at line 91 of file non_blocking_delay.hpp.

◆ isActive()

template<typename SystemTimeImpl >
bool sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::isActive ( ) const
inline

Check if timer is active.

Definition at line 75 of file non_blocking_delay.hpp.

◆ ready()

template<typename SystemTimeImpl >
bool sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::ready ( ) const
inline

Check if delay period has elapsed.

Returns
true if delay period has elapsed

Definition at line 53 of file non_blocking_delay.hpp.

◆ reset()

template<typename SystemTimeImpl >
void sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::reset ( )
inline

Reset the delay timer for next period.

Definition at line 61 of file non_blocking_delay.hpp.

◆ setPeriod()

template<typename SystemTimeImpl >
void sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::setPeriod ( uint32_t  delay_ms)
inline

Update delay period.

Parameters
delay_msNew delay period in milliseconds

Definition at line 83 of file non_blocking_delay.hpp.

◆ start()

template<typename SystemTimeImpl >
void sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::start ( )
inline

Start the delay timer.

Definition at line 44 of file non_blocking_delay.hpp.

◆ stop()

template<typename SystemTimeImpl >
void sbl::patterns::timing::NonBlockingDelay< SystemTimeImpl >::stop ( )
inline

Stop the delay timer.

Definition at line 68 of file non_blocking_delay.hpp.


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