![]() |
WPILibC++ 2023.4.3
|
Class to enable glitch filtering on a set of digital inputs. More...
#include <frc/DigitalGlitchFilter.h>
Public Member Functions | |
DigitalGlitchFilter () | |
~DigitalGlitchFilter () override | |
DigitalGlitchFilter (DigitalGlitchFilter &&)=default | |
DigitalGlitchFilter & | operator= (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... | |
![]() | |
virtual | ~Sendable ()=default |
virtual void | InitSendable (SendableBuilder &builder)=0 |
Initializes this Sendable object. More... | |
![]() | |
SendableHelper (const SendableHelper &rhs)=default | |
SendableHelper (SendableHelper &&rhs) | |
SendableHelper & | operator= (const SendableHelper &rhs)=default |
SendableHelper & | operator= (SendableHelper &&rhs) |
Additional Inherited Members | |
![]() | |
SendableHelper ()=default | |
~SendableHelper () | |
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.
frc::DigitalGlitchFilter::DigitalGlitchFilter | ( | ) |
|
override |
|
default |
void frc::DigitalGlitchFilter::Add | ( | Counter * | input | ) |
void frc::DigitalGlitchFilter::Add | ( | DigitalSource * | input | ) |
Assigns the DigitalSource to this glitch filter.
input | The DigitalSource to add. |
void frc::DigitalGlitchFilter::Add | ( | Encoder * | input | ) |
int frc::DigitalGlitchFilter::GetPeriodCycles | ( | ) |
Gets the number of cycles that the input must not change state for.
uint64_t frc::DigitalGlitchFilter::GetPeriodNanoSeconds | ( | ) |
Gets the number of nanoseconds that the input must not change state for.
|
overridevirtual |
|
default |
void frc::DigitalGlitchFilter::Remove | ( | Counter * | input | ) |
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.
input | The DigitalSource to remove. |
void frc::DigitalGlitchFilter::Remove | ( | Encoder * | input | ) |
void frc::DigitalGlitchFilter::SetPeriodCycles | ( | int | fpgaCycles | ) |
Sets the number of cycles that the input must not change state for.
fpgaCycles | The number of FPGA cycles. |
void frc::DigitalGlitchFilter::SetPeriodNanoSeconds | ( | uint64_t | nanoseconds | ) |
Sets the number of nanoseconds that the input must not change state for.
nanoseconds | The number of nanoseconds. |