Class to control a simulated PWM output.
More...
#include <frc/simulation/PWMSim.h>
Class to control a simulated PWM output.
◆ PWMSim() [1/2]
frc::sim::PWMSim::PWMSim |
( |
const PWM & | pwm | ) |
|
|
explicit |
Constructs from a PWM object.
- Parameters
-
◆ PWMSim() [2/2]
frc::sim::PWMSim::PWMSim |
( |
int | channel | ) |
|
|
explicit |
Constructs from a PWM channel number.
- Parameters
-
◆ GetInitialized()
bool frc::sim::PWMSim::GetInitialized |
( |
| ) |
const |
Check whether the PWM has been initialized.
- Returns
- true if initialized
◆ GetOutputPeriod()
int frc::sim::PWMSim::GetOutputPeriod |
( |
| ) |
const |
Get the PWM period scale.
- Returns
- the PWM period scale
◆ GetPulseMicrosecond()
int32_t frc::sim::PWMSim::GetPulseMicrosecond |
( |
| ) |
const |
Get the PWM pulse microsecond value.
- Returns
- the PWM pulse microsecond value
◆ RegisterInitializedCallback()
Register a callback to be run when the PWM is initialized.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterOutputPeriodCallback()
Register a callback to be run when the PWM period scale changes.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterPulseMicrosecondCallback()
Register a callback to be run when the PWM pulse microsecond value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::PWMSim::ResetData |
( |
| ) |
|
Reset all simulation data.
◆ SetInitialized()
void frc::sim::PWMSim::SetInitialized |
( |
bool | initialized | ) |
|
Define whether the PWM has been initialized.
- Parameters
-
initialized | whether this object is initialized |
◆ SetOutputPeriod()
void frc::sim::PWMSim::SetOutputPeriod |
( |
int | period | ) |
|
Set the PWM period scale.
- Parameters
-
period | the PWM period scale |
◆ SetPulseMicrosecond()
void frc::sim::PWMSim::SetPulseMicrosecond |
( |
int32_t | microsecondPulseTime | ) |
|
Set the PWM pulse microsecond value.
- Parameters
-
microsecondPulseTime | the PWM pulse microsecond value |
The documentation for this class was generated from the following file: