61 explicit PWM(
int channel,
bool registerSendable =
true);
176 void SetBounds(units::microsecond_t max, units::microsecond_t deadbandMax,
177 units::microsecond_t
center, units::microsecond_t deadbandMin,
178 units::microsecond_t min);
193 void GetBounds(units::microsecond_t* max, units::microsecond_t* deadbandMax,
194 units::microsecond_t*
center,
195 units::microsecond_t* deadbandMin, units::microsecond_t* min);
A class for driving addressable LEDs, such as WS2812B, WS2815, and NeoPixels.
Definition AddressableLED.h:34
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:27
PeriodMultiplier
Represents the amount to multiply the minimum servo-pulse pwm period by.
Definition PWM.h:34
@ kPeriodMultiplier_1X
Don't skip pulses.
Definition PWM.h:38
@ kPeriodMultiplier_4X
Skip three out of four pulses.
Definition PWM.h:46
@ kPeriodMultiplier_2X
Skip every other pulse.
Definition PWM.h:42
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.
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