[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:
Thad House
2025-03-20 19:23:22 -07:00
committed by GitHub
parent 2e21a41f87
commit e2cc9e0059
96 changed files with 1037 additions and 2453 deletions

View File

@@ -37,10 +37,9 @@ public class DMC60 extends PWMMotorController {
public DMC60(final int channel) {
super("DMC60", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "DigilentDMC60");
}

View File

@@ -37,10 +37,9 @@ public class Jaguar extends PWMMotorController {
public Jaguar(final int channel) {
super("Jaguar", channel);
m_pwm.setBoundsMicroseconds(2310, 1550, 1507, 1454, 697);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2310, 1550, 1507, 1454, 697);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "Jaguar");
}

View File

@@ -37,10 +37,9 @@ public class Koors40 extends PWMMotorController {
public Koors40(final int channel) {
super("Koors40", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k4X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k20Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "Koors40");
}

View File

@@ -37,10 +37,9 @@ public class PWMSparkFlex extends PWMMotorController {
public PWMSparkFlex(final int channel) {
super("PWMSparkFlex", channel);
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "RevSparkFlexPWM");
}

View File

@@ -37,10 +37,9 @@ public class PWMSparkMax extends PWMMotorController {
public PWMSparkMax(final int channel) {
super("PWMSparkMax", channel);
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "RevSparkMaxPWM");
}

View File

@@ -37,10 +37,9 @@ public class PWMTalonFX extends PWMMotorController {
public PWMTalonFX(final int channel) {
super("PWMTalonFX", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "TalonFX");
}

View File

@@ -37,10 +37,9 @@ public class PWMTalonSRX extends PWMMotorController {
public PWMTalonSRX(final int channel) {
super("PWMTalonSRX", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "PWMTalonSRX");
}

View File

@@ -37,10 +37,9 @@ public class PWMVenom extends PWMMotorController {
public PWMVenom(final int channel) {
super("PWMVenom", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "FusionVenom");
}

View File

@@ -37,10 +37,9 @@ public class PWMVictorSPX extends PWMMotorController {
public PWMVictorSPX(final int channel) {
super("PWMVictorSPX", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "PWMVictorSPX");
}

View File

@@ -37,10 +37,9 @@ public class SD540 extends PWMMotorController {
public SD540(final int channel) {
super("SD540", channel);
m_pwm.setBoundsMicroseconds(2050, 1550, 1500, 1440, 940);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2050, 1550, 1500, 1440, 940);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "MindsensorsSD540");
}

View File

@@ -37,10 +37,9 @@ public class Spark extends PWMMotorController {
public Spark(final int channel) {
super("Spark", channel);
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "RevSPARK");
}

View File

@@ -37,10 +37,9 @@ public class SparkMini extends PWMMotorController {
public SparkMini(final int channel) {
super("SparkMini", channel);
m_pwm.setBoundsMicroseconds(2500, 1510, 1500, 1490, 500);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2500, 1510, 1500, 1490, 500);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "RevSPARK");
}

View File

@@ -37,10 +37,9 @@ public class Talon extends PWMMotorController {
public Talon(final int channel) {
super("Talon", channel);
m_pwm.setBoundsMicroseconds(2037, 1539, 1513, 1487, 989);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2037, 1539, 1513, 1487, 989);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "Talon");
}

View File

@@ -37,10 +37,9 @@ public class Victor extends PWMMotorController {
public Victor(final int channel) {
super("Victor", channel);
m_pwm.setBoundsMicroseconds(2027, 1525, 1507, 1490, 1026);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k2X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2027, 1525, 1507, 1490, 1026);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k10Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "Victor");
}

View File

@@ -37,10 +37,9 @@ public class VictorSP extends PWMMotorController {
public VictorSP(final int channel) {
super("VictorSP", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
setSpeed(0.0);
HAL.reportUsage("IO", getChannel(), "VictorSP");
}