11#include "wpi/units/pressure.hpp"
60 wpi::units::pounds_per_square_inch_t minPressure,
61 wpi::units::pounds_per_square_inch_t maxPressure)
override;
90 wpi::units::pounds_per_square_inch_t minPressure,
91 wpi::units::pounds_per_square_inch_t maxPressure)
override;
123 int reverseChannel)
override;
126 void ReportUsage(std::string_view device, std::string_view data)
override;
297 wpi::units::pounds_per_square_inch_t
GetPressure(
int channel)
const override;
305 static std::shared_ptr<PneumaticsBase> GetForModule(
int busId,
int module);
307 std::shared_ptr<DataStore> m_dataStore;
312 static std::unique_ptr<wpi::util::DenseMap<int, std::weak_ptr<DataStore>>[]>
314 static std::weak_ptr<DataStore>& GetDataStore(
int busId,
int module);
This file defines the DenseMap class.
@ index
Definition base.h:690
Class for operating a compressor connected to a pneumatics module.
Definition Compressor.hpp:34
DoubleSolenoid class for running 2 channels of high voltage Digital Output on a pneumatics module.
Definition DoubleSolenoid.hpp:25
friend class DataStore
Definition PneumaticHub.hpp:301
wpi::units::volt_t GetSolenoidsVoltage() const
Returns the current voltage of the solenoid power supply.
void EnableCompressorHybrid(wpi::units::pounds_per_square_inch_t minPressure, wpi::units::pounds_per_square_inch_t maxPressure) override
Enables the compressor in hybrid mode.
DoubleSolenoid MakeDoubleSolenoid(int forwardChannel, int reverseChannel) override
Create a double solenoid object for the specified channels.
PneumaticHub(int busId)
Constructs a PneumaticHub with the default ID (1).
void UnreserveCompressor() override
Unreserve the compressor.
Solenoid MakeSolenoid(int channel) override
Create a solenoid object for the specified channel.
wpi::units::ampere_t GetSolenoidsTotalCurrent() const
Returns the total current drawn by all solenoids.
wpi::units::volt_t GetAnalogVoltage(int channel) const override
Returns the raw voltage of the specified analog input channel.
CompressorConfigType GetCompressorConfigType() const override
Returns the active compressor configuration.
StickyFaults GetStickyFaults() const
Returns the sticky faults currently active on this device.
friend class PneumaticsBase
Definition PneumaticHub.hpp:302
void EnableCompressorDigital() override
Enables the compressor in digital mode using the digital pressure switch.
~PneumaticHub() override=default
wpi::units::ampere_t GetCompressorCurrent() const override
Returns the current drawn by the compressor.
Compressor MakeCompressor() override
Create a compressor object.
void DisableCompressor() override
Disables the compressor.
int GetSolenoidDisabledList() const override
Get a bitmask of disabled solenoids.
void ReportUsage(std::string_view device, std::string_view data) override
Report usage.
void UnreserveSolenoids(int mask) override
Unreserve the solenoids marked in the bitmask.
wpi::units::volt_t Get5VRegulatedVoltage() const
Returns the current voltage of the regulated 5v supply.
void SetOneShotDuration(int index, wpi::units::second_t duration) override
Set the duration for a single solenoid shot.
wpi::units::pounds_per_square_inch_t GetPressure(int channel) const override
Returns the pressure read by an analog pressure sensor on the specified analog input channel.
bool ReserveCompressor() override
Reserve the compressor.
void FireOneShot(int index) override
Fire a single solenoid shot.
bool GetPressureSwitch() const override
Returns the state of the pressure switch.
wpi::units::volt_t GetInputVoltage() const
Returns the current input voltage for this device.
void EnableCompressorAnalog(wpi::units::pounds_per_square_inch_t minPressure, wpi::units::pounds_per_square_inch_t maxPressure) override
Enables the compressor in analog mode.
void ClearStickyFaults()
Clears the sticky faults.
int CheckAndReserveSolenoids(int mask) override
Check to see if the solenoids marked in the bitmask can be reserved, and if so, reserve them.
Version GetVersion() const
Returns the hardware and firmware versions of this device.
bool GetCompressor() const override
Returns whether the compressor is active or not.
bool CheckSolenoidChannel(int channel) const override
Check if a solenoid channel is valid.
int GetSolenoids() const override
Gets a bitmask of solenoid values.
Faults GetFaults() const
Returns the faults currently active on this device.
int GetModuleNumber() const override
Get module number for this module.
PneumaticHub(int busId, int module)
Constructs a PneumaticHub.
void SetSolenoids(int mask, int values) override
Sets solenoids on a pneumatics module.
Solenoid class for running high voltage Digital Output on a pneumatics module.
Definition Solenoid.hpp:26
HAL_Handle HAL_REVPHHandle
Definition Types.h:71
::std::mutex mutex
Definition mutex.hpp:17
Definition CvSource.hpp:15
CompressorConfigType
Compressor config type.
Definition CompressorConfigType.hpp:11
Faults for a REV PH.
Definition PneumaticHub.hpp:155
uint32_t Channel0Fault
Fault on channel 0.
Definition PneumaticHub.hpp:157
uint32_t Channel3Fault
Fault on channel 3.
Definition PneumaticHub.hpp:163
uint32_t CompressorOpen
The compressor output has an open circuit.
Definition PneumaticHub.hpp:191
uint32_t Channel14Fault
Fault on channel 14.
Definition PneumaticHub.hpp:185
uint32_t HardwareFault
The hardware on the device has malfunctioned.
Definition PneumaticHub.hpp:199
uint32_t CanWarning
A warning was raised by the device's CAN controller.
Definition PneumaticHub.hpp:197
uint32_t Brownout
The input voltage is below the minimum voltage.
Definition PneumaticHub.hpp:195
uint32_t Channel8Fault
Fault on channel 8.
Definition PneumaticHub.hpp:173
uint32_t Channel10Fault
Fault on channel 10.
Definition PneumaticHub.hpp:177
uint32_t Channel11Fault
Fault on channel 11.
Definition PneumaticHub.hpp:179
uint32_t Channel13Fault
Fault on channel 13.
Definition PneumaticHub.hpp:183
uint32_t Channel12Fault
Fault on channel 12.
Definition PneumaticHub.hpp:181
uint32_t Channel1Fault
Fault on channel 1.
Definition PneumaticHub.hpp:159
uint32_t Channel15Fault
Fault on channel 15.
Definition PneumaticHub.hpp:187
uint32_t Channel9Fault
Fault on channel 9.
Definition PneumaticHub.hpp:175
uint32_t SolenoidOverCurrent
An overcurrent event occurred on a solenoid output.
Definition PneumaticHub.hpp:193
uint32_t Channel4Fault
Fault on channel 4.
Definition PneumaticHub.hpp:165
uint32_t Channel2Fault
Fault on channel 2.
Definition PneumaticHub.hpp:161
uint32_t Channel5Fault
Fault on channel 5.
Definition PneumaticHub.hpp:167
uint32_t Channel7Fault
Fault on channel 7.
Definition PneumaticHub.hpp:171
uint32_t Channel6Fault
Fault on channel 6.
Definition PneumaticHub.hpp:169
uint32_t CompressorOverCurrent
An overcurrent event occurred on the compressor output.
Definition PneumaticHub.hpp:189
bool GetChannelFault(int channel) const
Gets whether there is a fault at the specified channel.
Sticky faults for a REV PH.
Definition PneumaticHub.hpp:222
uint32_t HasReset
The device has rebooted.
Definition PneumaticHub.hpp:240
uint32_t Brownout
The input voltage is below the minimum voltage.
Definition PneumaticHub.hpp:230
uint32_t CompressorOpen
The compressor output has an open circuit.
Definition PneumaticHub.hpp:226
uint32_t CanWarning
A warning was raised by the device's CAN controller.
Definition PneumaticHub.hpp:232
uint32_t SolenoidOverCurrent
An overcurrent event occurred on a solenoid output.
Definition PneumaticHub.hpp:228
uint32_t CompressorOverCurrent
An overcurrent event occurred on the compressor output.
Definition PneumaticHub.hpp:224
uint32_t CanBusOff
The device's CAN controller experienced a "Bus Off" event.
Definition PneumaticHub.hpp:234
uint32_t HardwareFault
The hardware on the device has malfunctioned.
Definition PneumaticHub.hpp:236
uint32_t FirmwareFault
The firmware on the device has malfunctioned.
Definition PneumaticHub.hpp:238
Version and device data received from a REV PH.
Definition PneumaticHub.hpp:129
uint32_t FirmwareFix
The firmware fix version.
Definition PneumaticHub.hpp:135
uint32_t HardwareMajor
The hardware major version.
Definition PneumaticHub.hpp:139
uint32_t HardwareMinor
The hardware minor version.
Definition PneumaticHub.hpp:137
uint32_t UniqueId
The device's unique ID.
Definition PneumaticHub.hpp:141
uint32_t FirmwareMinor
The firmware minor version.
Definition PneumaticHub.hpp:133
uint32_t FirmwareMajor
The firmware major version.
Definition PneumaticHub.hpp:131