mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal, wpilib] Incorporate pneumatic control type into wpilibc/j (#3728)
This commit is contained in:
@@ -84,17 +84,38 @@ bool PneumaticsControlModule::GetCompressor() const {
|
||||
return result;
|
||||
}
|
||||
|
||||
void PneumaticsControlModule::SetClosedLoopControl(bool enabled) {
|
||||
void PneumaticsControlModule::DisableCompressor() {
|
||||
int32_t status = 0;
|
||||
HAL_SetCTREPCMClosedLoopControl(m_handle, enabled, &status);
|
||||
HAL_SetCTREPCMClosedLoopControl(m_handle, false, &status);
|
||||
FRC_CheckErrorStatus(status, "Module {}", m_module);
|
||||
}
|
||||
|
||||
bool PneumaticsControlModule::GetClosedLoopControl() const {
|
||||
void PneumaticsControlModule::EnableCompressorDigital() {
|
||||
int32_t status = 0;
|
||||
HAL_SetCTREPCMClosedLoopControl(m_handle, true, &status);
|
||||
FRC_CheckErrorStatus(status, "Module {}", m_module);
|
||||
}
|
||||
|
||||
void PneumaticsControlModule::EnableCompressorAnalog(double minAnalogVoltage,
|
||||
double maxAnalogVoltage) {
|
||||
int32_t status = 0;
|
||||
HAL_SetCTREPCMClosedLoopControl(m_handle, true, &status);
|
||||
FRC_CheckErrorStatus(status, "Module {}", m_module);
|
||||
}
|
||||
|
||||
void PneumaticsControlModule::EnableCompressorHybrid(double minAnalogVoltage,
|
||||
double maxAnalogVoltage) {
|
||||
int32_t status = 0;
|
||||
HAL_SetCTREPCMClosedLoopControl(m_handle, true, &status);
|
||||
FRC_CheckErrorStatus(status, "Module {}", m_module);
|
||||
}
|
||||
|
||||
CompressorConfigType PneumaticsControlModule::GetCompressorConfigType() const {
|
||||
int32_t status = 0;
|
||||
auto result = HAL_GetCTREPCMClosedLoopControl(m_handle, &status);
|
||||
FRC_CheckErrorStatus(status, "Module {}", m_module);
|
||||
return result;
|
||||
return result ? CompressorConfigType::Digital
|
||||
: CompressorConfigType::Disabled;
|
||||
}
|
||||
|
||||
bool PneumaticsControlModule::GetPressureSwitch() const {
|
||||
|
||||
Reference in New Issue
Block a user