12 #include <HAL/Types.h> 14 #include "ErrorBase.h" 15 #include "SmartDashboard/SendableBase.h" 66 explicit PWM(
int channel);
82 virtual void SetRaw(uint16_t value);
91 virtual uint16_t
GetRaw()
const;
130 virtual void SetSpeed(
double speed);
184 void SetBounds(
double max,
double deadbandMax,
double center,
185 double deadbandMin,
double min);
200 void SetRawBounds(
int max,
int deadbandMax,
int center,
int deadbandMin,
216 void GetRawBounds(int32_t* max, int32_t* deadbandMax, int32_t* center,
217 int32_t* deadbandMin, int32_t* min);
219 int GetChannel()
const;
226 HAL_DigitalHandle m_handle;
Definition: Utility.cpp:119
void SetBounds(double max, double deadbandMax, double center, double deadbandMin, double min)
Set the bounds on the PWM pulse widths.
Definition: PWM.cpp:157
PeriodMultiplier
Represents the amount to multiply the minimum servo-pulse pwm period by.
Definition: PWM.h:41
Skip every other pulse.
Definition: PWM.h:49
Skip three out of four pulses.
Definition: PWM.h:53
void GetRawBounds(int32_t *max, int32_t *deadbandMax, int32_t *center, int32_t *deadbandMin, int32_t *min)
Get the bounds on the PWM values.
Definition: PWM.cpp:175
virtual void SetSpeed(double speed)
Set the PWM value based on a speed.
Definition: PWM.cpp:93
virtual double GetSpeed() const
Get the PWM value in terms of speed.
Definition: PWM.cpp:100
Don't skip pulses.
Definition: PWM.h:45
PWM(int channel)
Allocate a PWM given a channel number.
Definition: PWM.cpp:21
void SetRawBounds(int max, int deadbandMax, int center, int deadbandMin, int min)
Set the bounds on the PWM values.
Definition: PWM.cpp:166
void EnableDeadbandElimination(bool eliminateDeadband)
Optionally eliminate the deadband from a speed controller.
Definition: PWM.cpp:150
virtual uint16_t GetRaw() const
Get the PWM value directly from the hardware.
Definition: PWM.cpp:68
void SetPeriodMultiplier(PeriodMultiplier mult)
Slow down the PWM signal for old devices.
Definition: PWM.cpp:117
Base class for most objects.
Definition: ErrorBase.h:74
virtual double GetPosition() const
Get the PWM value in terms of a position.
Definition: PWM.cpp:85
virtual void SetRaw(uint16_t value)
Set the PWM value directly to the hardware.
Definition: PWM.cpp:60
Definition: SendableBase.h:19
Definition: SendableBuilder.h:23
virtual void SetPosition(double pos)
Set the PWM value based on a position.
Definition: PWM.cpp:78
Class implements the PWM generation in the FPGA.
Definition: PWM.h:36
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
Definition: PWM.cpp:185
~PWM() override
Free the PWM channel.
Definition: PWM.cpp:50
virtual void SetDisabled()
Temporarily disables the PWM output.
Definition: PWM.cpp:108