mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Implement user API for roboRIO power methods (fixes artf3728 and artf3537)
Change-Id: I7501a83dcdd81d45b298e044379ea4ac3670c742
This commit is contained in:
@@ -41,6 +41,22 @@ float getUserCurrent6V(int32_t *status) {
|
||||
return power->readUserCurrent6V(status) / 4.096f * 0.005566f - 0.009f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active state of the 6V rail
|
||||
*/
|
||||
bool getUserActive6V(int32_t *status) {
|
||||
initializePower(status);
|
||||
return power->readStatus_User6V(status) == 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fault count for the 6V rail
|
||||
*/
|
||||
int getUserCurrentFaults6V(int32_t *status) {
|
||||
initializePower(status);
|
||||
return (int)power->readOverCurrentFaultCounts_OverCurrentFaultCount6V(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the 5V rail voltage
|
||||
*/
|
||||
@@ -57,6 +73,27 @@ float getUserCurrent5V(int32_t *status) {
|
||||
return power->readUserCurrent5V(status) / 4.096f * 0.001996f - 0.002f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active state of the 5V rail
|
||||
*/
|
||||
bool getUserActive5V(int32_t *status) {
|
||||
initializePower(status);
|
||||
return power->readStatus_User5V(status) == 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fault count for the 5V rail
|
||||
*/
|
||||
int getUserCurrentFaults5V(int32_t *status) {
|
||||
initializePower(status);
|
||||
return (int)power->readOverCurrentFaultCounts_OverCurrentFaultCount5V(status);
|
||||
}
|
||||
|
||||
unsigned char getUserStatus5V(int32_t *status) {
|
||||
initializePower(status);
|
||||
return power->readStatus_User5V(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the 3.3V rail voltage
|
||||
*/
|
||||
@@ -72,3 +109,19 @@ float getUserCurrent3V3(int32_t *status) {
|
||||
initializePower(status);
|
||||
return power->readUserCurrent3V3(status) / 4.096f * 0.002486f - 0.003f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active state of the 3.3V rail
|
||||
*/
|
||||
bool getUserActive3V3(int32_t *status) {
|
||||
initializePower(status);
|
||||
return power->readStatus_User3V3(status) == 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fault count for the 3.3V rail
|
||||
*/
|
||||
int getUserCurrentFaults3V3(int32_t *status) {
|
||||
initializePower(status);
|
||||
return (int)power->readOverCurrentFaultCounts_OverCurrentFaultCount3V3(status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user