20class DigitalGlitchFilter;
144 std::shared_ptr<DigitalSource> downSource,
bool inverted);
469 double m_distancePerPulse = 1;
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or and nanopb were all modified for use in Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition ThirdPartyNotices.txt:124
Definition AnalogTrigger.h:22
Interface for counting the number of ticks on a digital input channel.
Definition CounterBase.h:20
EncodingType
Definition CounterBase.h:22
Class for counting the number of ticks on a digital input channel.
Definition Counter.h:36
void SetSemiPeriodMode(bool highSemiPeriod)
Set Semi-period mode on this counter.
void SetUpSource(std::shared_ptr< DigitalSource > source)
Set the source object that causes the counter to count up.
void ClearUpSource()
Disable the up counting source to the counter.
double GetDistance() const
Read the current scaled counter value.
void SetDistancePerPulse(double distancePerPulse)
Set the distance per pulse for this counter.
Counter(const AnalogTrigger &trigger)
Create an instance of a Counter object.
void SetUpSource(DigitalSource *source)
Counter & operator=(Counter &&)=default
Counter(EncodingType encodingType, DigitalSource *upSource, DigitalSource *downSource, bool inverted)
Create an instance of a Counter object.
void SetUpDownCounterMode()
Set standard up / down counting mode on this counter.
void Reset() override
Reset the Counter to zero.
void SetDownSource(std::shared_ptr< AnalogTrigger > analogTrigger, AnalogTriggerType triggerType)
Set the down counting source to be an analog trigger.
void SetExternalDirectionMode()
Set external direction mode on this counter.
std::shared_ptr< DigitalSource > m_downSource
Makes the counter count down.
Definition Counter.h:459
void SetUpSource(std::shared_ptr< AnalogTrigger > analogTrigger, AnalogTriggerType triggerType)
Set the up counting source to be an analog trigger.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
bool GetDirection() const override
The last direction the counter value changed.
Counter(Counter &&)=default
units::second_t GetPeriod() const override
Get the Period of the most recent count.
void SetDownSource(DigitalSource *source)
Set the source object that causes the counter to count down.
void SetUpSource(DigitalSource &source)
Set the source object that causes the counter to count up.
void SetDownSource(int channel)
Set the down counting source to be a digital input channel.
Counter(DigitalSource *source)
Create an instance of a counter from a Digital Source (such as a Digital Input).
Counter(Mode mode=kTwoPulse)
Create an instance of a counter where no sources are selected.
int Get() const override
Read the current counter value.
void SetReverseDirection(bool reverseDirection)
Set the Counter to return reversed sensing on the direction.
Counter(int channel)
Create an instance of a Counter object.
double GetRate() const
Get the current rate of the Counter.
Mode
Definition Counter.h:41
@ kTwoPulse
Definition Counter.h:42
@ kSemiperiod
Definition Counter.h:43
@ kPulseLength
Definition Counter.h:44
@ kExternalDirection
Definition Counter.h:45
void SetUpdateWhenEmpty(bool enabled)
Select whether you want to continue updating the event timer output when there are no samples capture...
void SetDownSource(AnalogTrigger *analogTrigger, AnalogTriggerType triggerType)
Set the down counting source to be an analog trigger.
int GetSamplesToAverage() const
Get the Samples to Average which specifies the number of samples of the timer to average when calcula...
void SetDownSourceEdge(bool risingEdge, bool fallingEdge)
Set the edge sensitivity on a down counting source.
void SetUpSource(AnalogTrigger *analogTrigger, AnalogTriggerType triggerType)
Set the up counting source to be an analog trigger.
void ClearDownSource()
Disable the down counting source to the counter.
void SetUpSource(int channel)
Set the up source for the counter as a digital input channel.
void SetDownSource(std::shared_ptr< DigitalSource > source)
Counter(std::shared_ptr< DigitalSource > source)
Create an instance of a counter from a Digital Source (such as a Digital Input).
bool GetStopped() const override
Determine if the clock is stopped.
Counter(EncodingType encodingType, std::shared_ptr< DigitalSource > upSource, std::shared_ptr< DigitalSource > downSource, bool inverted)
Create an instance of a Counter object.
void SetMaxPeriod(units::second_t maxPeriod) final
Set the maximum period where the device is still considered "moving".
std::shared_ptr< DigitalSource > m_upSource
Makes the counter count up.
Definition Counter.h:456
void SetSamplesToAverage(int samplesToAverage)
Set the Samples to Average which specifies the number of samples of the timer to average when calcula...
void SetUpSourceEdge(bool risingEdge, bool fallingEdge)
Set the edge sensitivity on an up counting source.
void SetDownSource(DigitalSource &source)
Set the source object that causes the counter to count down.
void SetPulseLengthMode(double threshold)
Configure the counter to count in up or down based on the length of the input pulse.
hal::Handle< HAL_CounterHandle, HAL_FreeCounter > m_counter
The FPGA counter object.
Definition Counter.h:462
Class for configuring Direct Memory Access (DMA) of FPGA inputs.
Definition DMA.h:23
DMA sample.
Definition DMASample.h:23
Class to enable glitch filtering on a set of digital inputs.
Definition DigitalGlitchFilter.h:30
DigitalSource Interface.
Definition DigitalSource.h:22
A move-only C++ wrapper around a HAL handle.
Definition Types.h:96
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.h:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition SendableHelper.h:21
Interface for Sendable objects.
Definition Sendable.h:16
AnalogTriggerType
Defines the state in which the AnalogTrigger triggers.
Definition AnalogTriggerType.h:10