60 explicit PWM(
int channel,
bool registerSendable =
true);
175 void SetBounds(units::microsecond_t
max, units::microsecond_t deadbandMax,
176 units::microsecond_t center, units::microsecond_t deadbandMin,
177 units::microsecond_t
min);
192 void GetBounds(units::microsecond_t*
max, units::microsecond_t* deadbandMax,
193 units::microsecond_t* center,
194 units::microsecond_t* deadbandMin, units::microsecond_t*
min);
A class for driving addressable LEDs, such as WS2812Bs and NeoPixels.
Definition: AddressableLED.h:29
Class for configuring Direct Memory Access (DMA) of FPGA inputs.
Definition: DMA.h:23
Class implements the PWM generation in the FPGA.
Definition: PWM.h:26
PeriodMultiplier
Represents the amount to multiply the minimum servo-pulse pwm period by.
Definition: PWM.h:33
@ kPeriodMultiplier_1X
Don't skip pulses.
Definition: PWM.h:37
@ kPeriodMultiplier_4X
Skip three out of four pulses.
Definition: PWM.h:45
@ kPeriodMultiplier_2X
Skip every other pulse.
Definition: PWM.h:41
virtual void SetPosition(double pos)
Set the PWM value based on a position.
virtual units::microsecond_t GetPulseTime() const
Get the PWM pulse time directly from the hardware.
void GetBounds(units::microsecond_t *max, units::microsecond_t *deadbandMax, units::microsecond_t *center, units::microsecond_t *deadbandMin, units::microsecond_t *min)
Get the bounds on the PWM values.
void EnableDeadbandElimination(bool eliminateDeadband)
Optionally eliminate the deadband from a motor controller.
virtual void SetDisabled()
Temporarily disables the PWM output.
virtual void SetSpeed(double speed)
Set the PWM value based on a speed.
PWM(int channel, bool registerSendable=true)
Allocate a PWM given a channel number.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
virtual double GetPosition() const
Get the PWM value in terms of a position.
void SetAlwaysHighMode()
Sets the PWM output to be a continuous high signal while enabled.
void SetZeroLatch()
Latches PWM to zero.
void SetBounds(units::microsecond_t max, units::microsecond_t deadbandMax, units::microsecond_t center, units::microsecond_t deadbandMin, units::microsecond_t min)
Set the bounds on the PWM pulse widths.
~PWM() override
Free the PWM channel.
PWM & operator=(PWM &&)=default
void SetPeriodMultiplier(PeriodMultiplier mult)
Slow down the PWM signal for old devices.
virtual void SetPulseTime(units::microsecond_t time)
Set the PWM pulse time directly to the hardware.
virtual double GetSpeed() const
Get the PWM value in terms of speed.
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:19
Interface for Sendable objects.
Definition: Sendable.h:16
Definition: AprilTagPoseEstimator.h:15
UnitTypeLhs() max(const UnitTypeLhs &lhs, const UnitTypeRhs &rhs)
Definition: base.h:3417
UnitTypeLhs() min(const UnitTypeLhs &lhs, const UnitTypeRhs &rhs)
Definition: base.h:3409