mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal, wpilib] PWM Rewrite (#7845)
The HAL will only contain the output period and the raw microseconds. Higher level things such as SimDevice can handle everything else.
This commit is contained in:
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
DMC60::DMC60(int channel) : PWMMotorController("DMC60", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "DigilentDMC60");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
Jaguar::Jaguar(int channel) : PWMMotorController("Jaguar", channel) {
|
||||
m_pwm.SetBounds(2.31_ms, 1.55_ms, 1.507_ms, 1.454_ms, 0.697_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.31_ms, 1.55_ms, 1.507_ms, 1.454_ms, 0.697_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "Jaguar");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
Koors40::Koors40(int channel) : PWMMotorController("Koors40", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_4X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_20Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "Koors40");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
PWMSparkFlex::PWMSparkFlex(int channel) : PWMMotorController("PWMSparkFlex", channel) {
|
||||
m_pwm.SetBounds(2.003_ms, 1.55_ms, 1.5_ms, 1.46_ms, 0.999_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.003_ms, 1.55_ms, 1.5_ms, 1.46_ms, 0.999_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "RevSparkFlexPWM");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
PWMSparkMax::PWMSparkMax(int channel) : PWMMotorController("PWMSparkMax", channel) {
|
||||
m_pwm.SetBounds(2.003_ms, 1.55_ms, 1.5_ms, 1.46_ms, 0.999_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.003_ms, 1.55_ms, 1.5_ms, 1.46_ms, 0.999_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "RevSparkMaxPWM");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
PWMTalonFX::PWMTalonFX(int channel) : PWMMotorController("PWMTalonFX", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "TalonFX");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
PWMTalonSRX::PWMTalonSRX(int channel) : PWMMotorController("PWMTalonSRX", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "PWMTalonSRX");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
PWMVenom::PWMVenom(int channel) : PWMMotorController("PWMVenom", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "FusionVenom");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
PWMVictorSPX::PWMVictorSPX(int channel) : PWMMotorController("PWMVictorSPX", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "PWMVictorSPX");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
SD540::SD540(int channel) : PWMMotorController("SD540", channel) {
|
||||
m_pwm.SetBounds(2.05_ms, 1.55_ms, 1.5_ms, 1.44_ms, 0.94_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.05_ms, 1.55_ms, 1.5_ms, 1.44_ms, 0.94_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "MindsensorsSD540");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
Spark::Spark(int channel) : PWMMotorController("Spark", channel) {
|
||||
m_pwm.SetBounds(2.003_ms, 1.55_ms, 1.5_ms, 1.46_ms, 0.999_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.003_ms, 1.55_ms, 1.5_ms, 1.46_ms, 0.999_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "RevSPARK");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
SparkMini::SparkMini(int channel) : PWMMotorController("SparkMini", channel) {
|
||||
m_pwm.SetBounds(2.5_ms, 1.51_ms, 1.5_ms, 1.49_ms, 0.5_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.5_ms, 1.51_ms, 1.5_ms, 1.49_ms, 0.5_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "RevSPARK");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
Talon::Talon(int channel) : PWMMotorController("Talon", channel) {
|
||||
m_pwm.SetBounds(2.037_ms, 1.539_ms, 1.513_ms, 1.487_ms, 0.989_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.037_ms, 1.539_ms, 1.513_ms, 1.487_ms, 0.989_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "Talon");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
Victor::Victor(int channel) : PWMMotorController("Victor", channel) {
|
||||
m_pwm.SetBounds(2.027_ms, 1.525_ms, 1.507_ms, 1.49_ms, 1.026_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_2X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.027_ms, 1.525_ms, 1.507_ms, 1.49_ms, 1.026_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_10Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "Victor");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
VictorSP::VictorSP(int channel) : PWMMotorController("VictorSP", channel) {
|
||||
m_pwm.SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds(2.004_ms, 1.52_ms, 1.5_ms, 1.48_ms, 0.997_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_5Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "VictorSP");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user