WPILibC++ 2024.1.1-beta-4
frc::DigitalGlitchFilter Class Reference

Class to enable glitch filtering on a set of digital inputs. More...

#include <frc/DigitalGlitchFilter.h>

Inheritance diagram for frc::DigitalGlitchFilter:
wpi::Sendable wpi::SendableHelper< DigitalGlitchFilter >

Public Member Functions

 DigitalGlitchFilter ()
 
 ~DigitalGlitchFilter () override
 
 DigitalGlitchFilter (DigitalGlitchFilter &&)=default
 
DigitalGlitchFilteroperator= (DigitalGlitchFilter &&)=default
 
void Add (DigitalSource *input)
 Assigns the DigitalSource to this glitch filter. More...
 
void Add (Encoder *input)
 Assigns the Encoder to this glitch filter. More...
 
void Add (Counter *input)
 Assigns the Counter to this glitch filter. More...
 
void Remove (DigitalSource *input)
 Removes a digital input from this filter. More...
 
void Remove (Encoder *input)
 Removes an encoder from this filter. More...
 
void Remove (Counter *input)
 Removes a counter from this filter. More...
 
void SetPeriodCycles (int fpgaCycles)
 Sets the number of cycles that the input must not change state for. More...
 
void SetPeriodNanoSeconds (uint64_t nanoseconds)
 Sets the number of nanoseconds that the input must not change state for. More...
 
int GetPeriodCycles ()
 Gets the number of cycles that the input must not change state for. More...
 
uint64_t GetPeriodNanoSeconds ()
 Gets the number of nanoseconds that the input must not change state for. More...
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::Sendable
virtual ~Sendable ()=default
 
virtual void InitSendable (SendableBuilder &builder)=0
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::SendableHelper< DigitalGlitchFilter >
 SendableHelper (const SendableHelper &rhs)=default
 
 SendableHelper (SendableHelper &&rhs)
 
SendableHelperoperator= (const SendableHelper &rhs)=default
 
SendableHelperoperator= (SendableHelper &&rhs)
 

Additional Inherited Members

- Protected Member Functions inherited from wpi::SendableHelper< DigitalGlitchFilter >
 SendableHelper ()=default
 
 ~SendableHelper ()
 

Detailed Description

Class to enable glitch filtering on a set of digital inputs.

This class will manage adding and removing digital inputs from a FPGA glitch filter. The filter lets the user configure the time that an input must remain high or low before it is classified as high or low.

Constructor & Destructor Documentation

◆ DigitalGlitchFilter() [1/2]

frc::DigitalGlitchFilter::DigitalGlitchFilter ( )

◆ ~DigitalGlitchFilter()

frc::DigitalGlitchFilter::~DigitalGlitchFilter ( )
override

◆ DigitalGlitchFilter() [2/2]

frc::DigitalGlitchFilter::DigitalGlitchFilter ( DigitalGlitchFilter &&  )
default

Member Function Documentation

◆ Add() [1/3]

void frc::DigitalGlitchFilter::Add ( Counter input)

Assigns the Counter to this glitch filter.

Parameters
inputThe Counter to add.

◆ Add() [2/3]

void frc::DigitalGlitchFilter::Add ( DigitalSource input)

Assigns the DigitalSource to this glitch filter.

Parameters
inputThe DigitalSource to add.

◆ Add() [3/3]

void frc::DigitalGlitchFilter::Add ( Encoder input)

Assigns the Encoder to this glitch filter.

Parameters
inputThe Encoder to add.

◆ GetPeriodCycles()

int frc::DigitalGlitchFilter::GetPeriodCycles ( )

Gets the number of cycles that the input must not change state for.

Returns
The number of cycles.

◆ GetPeriodNanoSeconds()

uint64_t frc::DigitalGlitchFilter::GetPeriodNanoSeconds ( )

Gets the number of nanoseconds that the input must not change state for.

Returns
The number of nanoseconds.

◆ InitSendable()

void frc::DigitalGlitchFilter::InitSendable ( wpi::SendableBuilder builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::Sendable.

◆ operator=()

DigitalGlitchFilter & frc::DigitalGlitchFilter::operator= ( DigitalGlitchFilter &&  )
default

◆ Remove() [1/3]

void frc::DigitalGlitchFilter::Remove ( Counter input)

Removes a counter from this filter.

Removes the Counter from this glitch filter and re-assigns it to the default filter.

Parameters
inputThe Counter to remove.

◆ Remove() [2/3]

void frc::DigitalGlitchFilter::Remove ( DigitalSource input)

Removes a digital input from this filter.

Removes the DigitalSource from this glitch filter and re-assigns it to the default filter.

Parameters
inputThe DigitalSource to remove.

◆ Remove() [3/3]

void frc::DigitalGlitchFilter::Remove ( Encoder input)

Removes an encoder from this filter.

Removes the Encoder from this glitch filter and re-assigns it to the default filter.

Parameters
inputThe Encoder to remove.

◆ SetPeriodCycles()

void frc::DigitalGlitchFilter::SetPeriodCycles ( int  fpgaCycles)

Sets the number of cycles that the input must not change state for.

Parameters
fpgaCyclesThe number of FPGA cycles.

◆ SetPeriodNanoSeconds()

void frc::DigitalGlitchFilter::SetPeriodNanoSeconds ( uint64_t  nanoseconds)

Sets the number of nanoseconds that the input must not change state for.

Parameters
nanosecondsThe number of nanoseconds.

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