2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::GenericDebouncer< T > Class Template Reference

#include <generic_debouncer.h>

Public Member Functions

 GenericDebouncer (const units::millisecond_t symmetricDebounceTime, T initialValue={})
 Construct a new Debouncer object with symmetric times.
 
operator() (T newVal)
 Update debouncer with new input and retreive latest debounced status.
 
void Reset (T newVal)
 

Private Attributes

units::millisecond_t m_debounceTime
 
m_rawStatus
 Last raw value.
 
m_debouncedStatus
 Current value after applying debounce.
 
std::chrono::time_point< std::chrono::steady_clock > m_debounceTransitionTime
 Time when latest transition detected.
 

Constructor & Destructor Documentation

◆ GenericDebouncer()

template<class T >
argos_lib::GenericDebouncer< T >::GenericDebouncer ( const units::millisecond_t  symmetricDebounceTime,
initialValue = {} 
)
inlineexplicit

Construct a new Debouncer object with symmetric times.

Parameters
symmetricDebounceTimeSymmetric activate and clear time

Member Function Documentation

◆ operator()()

template<class T >
T argos_lib::GenericDebouncer< T >::operator() ( newVal)
inline

Update debouncer with new input and retreive latest debounced status.

Parameters
newValLatest raw value
Returns
Value after applying debounce

◆ Reset()

template<class T >
void argos_lib::GenericDebouncer< T >::Reset ( newVal)
inline
Parameters
newValValue to set to

Member Data Documentation

◆ m_debouncedStatus

template<class T >
T argos_lib::GenericDebouncer< T >::m_debouncedStatus
private

Current value after applying debounce.

◆ m_debounceTime

template<class T >
units::millisecond_t argos_lib::GenericDebouncer< T >::m_debounceTime
private

◆ m_debounceTransitionTime

template<class T >
std::chrono::time_point<std::chrono::steady_clock> argos_lib::GenericDebouncer< T >::m_debounceTransitionTime
private

Time when latest transition detected.

◆ m_rawStatus

template<class T >
T argos_lib::GenericDebouncer< T >::m_rawStatus
private

Last raw value.


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