mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[wpilib, hal] High Level REV PH changes (#3792)
More functionality was implemented at the HAL level, so expose that to the wpilib level. This also does units changes for all the PH related functionality.
This commit is contained in:
@@ -26,17 +26,17 @@ class PneumaticHub : public PneumaticsBase {
|
||||
|
||||
void EnableCompressorDigital() override;
|
||||
|
||||
void EnableCompressorAnalog(double minAnalogVoltage,
|
||||
double maxAnalogVoltage) override;
|
||||
void EnableCompressorAnalog(units::volt_t minAnalogVoltage,
|
||||
units::volt_t maxAnalogVoltage) override;
|
||||
|
||||
void EnableCompressorHybrid(double minAnalogVoltage,
|
||||
double maxAnalogVoltage) override;
|
||||
void EnableCompressorHybrid(units::volt_t minAnalogVoltage,
|
||||
units::volt_t maxAnalogVoltage) override;
|
||||
|
||||
CompressorConfigType GetCompressorConfigType() const override;
|
||||
|
||||
bool GetPressureSwitch() const override;
|
||||
|
||||
double GetCompressorCurrent() const override;
|
||||
units::ampere_t GetCompressorCurrent() const override;
|
||||
|
||||
void SetSolenoids(int mask, int values) override;
|
||||
|
||||
@@ -65,6 +65,68 @@ class PneumaticHub : public PneumaticsBase {
|
||||
int reverseChannel) override;
|
||||
Compressor MakeCompressor() override;
|
||||
|
||||
struct Version {
|
||||
uint32_t FirmwareMajor;
|
||||
uint32_t FirmwareMinor;
|
||||
uint32_t FirmwareFix;
|
||||
uint32_t HardwareMinor;
|
||||
uint32_t HardwareMajor;
|
||||
uint32_t UniqueId;
|
||||
};
|
||||
|
||||
Version GetVersion() const;
|
||||
|
||||
struct Faults {
|
||||
uint32_t Channel0Fault : 1;
|
||||
uint32_t Channel1Fault : 1;
|
||||
uint32_t Channel2Fault : 1;
|
||||
uint32_t Channel3Fault : 1;
|
||||
uint32_t Channel4Fault : 1;
|
||||
uint32_t Channel5Fault : 1;
|
||||
uint32_t Channel6Fault : 1;
|
||||
uint32_t Channel7Fault : 1;
|
||||
uint32_t Channel8Fault : 1;
|
||||
uint32_t Channel9Fault : 1;
|
||||
uint32_t Channel10Fault : 1;
|
||||
uint32_t Channel11Fault : 1;
|
||||
uint32_t Channel12Fault : 1;
|
||||
uint32_t Channel13Fault : 1;
|
||||
uint32_t Channel14Fault : 1;
|
||||
uint32_t Channel15Fault : 1;
|
||||
uint32_t CompressorOverCurrent : 1;
|
||||
uint32_t CompressorOpen : 1;
|
||||
uint32_t SolenoidOverCurrent : 1;
|
||||
uint32_t Brownout : 1;
|
||||
uint32_t CanWarning : 1;
|
||||
uint32_t HardwareFault : 1;
|
||||
};
|
||||
|
||||
Faults GetFaults() const;
|
||||
|
||||
struct StickyFaults {
|
||||
uint32_t CompressorOverCurrent : 1;
|
||||
uint32_t CompressorOpen : 1;
|
||||
uint32_t SolenoidOverCurrent : 1;
|
||||
uint32_t Brownout : 1;
|
||||
uint32_t CanWarning : 1;
|
||||
uint32_t CanBusOff : 1;
|
||||
uint32_t HasReset : 1;
|
||||
};
|
||||
|
||||
StickyFaults GetStickyFaults() const;
|
||||
|
||||
void ClearStickyFaults();
|
||||
|
||||
units::volt_t GetInputVoltage() const;
|
||||
|
||||
units::volt_t Get5VRegulatedVoltage() const;
|
||||
|
||||
units::ampere_t GetSolenoidsTotalCurrent() const;
|
||||
|
||||
units::volt_t GetSolenoidsVoltage() const;
|
||||
|
||||
units::volt_t GetAnalogVoltage(int channel) const override;
|
||||
|
||||
private:
|
||||
class DataStore;
|
||||
friend class DataStore;
|
||||
|
||||
Reference in New Issue
Block a user