Skip to content

Commit

Permalink
Document PH faults
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Jul 29, 2024
1 parent c2c5d37 commit f79f336
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 0 deletions.
27 changes: 27 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/PowerDistributionFaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,85 @@

@SuppressWarnings("MemberName")
public class PowerDistributionFaults {
/** Breaker fault on channel 0 */
public final boolean Channel0BreakerFault;

/** Breaker fault on channel 1 */
public final boolean Channel1BreakerFault;

/** Breaker fault on channel 2 */
public final boolean Channel2BreakerFault;

/** Breaker fault on channel 3 */
public final boolean Channel3BreakerFault;

/** Breaker fault on channel 4 */
public final boolean Channel4BreakerFault;

/** Breaker fault on channel 5 */
public final boolean Channel5BreakerFault;

/** Breaker fault on channel 6 */
public final boolean Channel6BreakerFault;

/** Breaker fault on channel 7 */
public final boolean Channel7BreakerFault;

/** Breaker fault on channel 8 */
public final boolean Channel8BreakerFault;

/** Breaker fault on channel 9 */
public final boolean Channel9BreakerFault;

/** Breaker fault on channel 10 */
public final boolean Channel10BreakerFault;

/** Breaker fault on channel 11 */
public final boolean Channel11BreakerFault;

/** Breaker fault on channel 12 */
public final boolean Channel12BreakerFault;

/** Breaker fault on channel 13 */
public final boolean Channel13BreakerFault;

/** Breaker fault on channel 14 */
public final boolean Channel14BreakerFault;

/** Breaker fault on channel 15 */
public final boolean Channel15BreakerFault;

/** Breaker fault on channel 16 */
public final boolean Channel16BreakerFault;

/** Breaker fault on channel 17 */
public final boolean Channel17BreakerFault;

/** Breaker fault on channel 18 */
public final boolean Channel18BreakerFault;

/** Breaker fault on channel 19 */
public final boolean Channel19BreakerFault;

/** Breaker fault on channel 20 */
public final boolean Channel20BreakerFault;

/** Breaker fault on channel 21 */
public final boolean Channel21BreakerFault;

/** Breaker fault on channel 22 */
public final boolean Channel22BreakerFault;

/** Breaker fault on channel 23 */
public final boolean Channel23BreakerFault;

/** The input voltage is below the minimum voltage */
public final boolean Brownout;

/** A warning was raised by the device's CAN controller */
public final boolean CanWarning;

/** The hardware on the device has malfunctioned */
public final boolean HardwareFault;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,88 @@

@SuppressWarnings("MemberName")
public class PowerDistributionStickyFaults {
/** Breaker fault on channel 0 */
public final boolean Channel0BreakerFault;

/** Breaker fault on channel 1 */
public final boolean Channel1BreakerFault;

/** Breaker fault on channel 2 */
public final boolean Channel2BreakerFault;

/** Breaker fault on channel 3 */
public final boolean Channel3BreakerFault;

/** Breaker fault on channel 4 */
public final boolean Channel4BreakerFault;

/** Breaker fault on channel 5 */
public final boolean Channel5BreakerFault;

/** Breaker fault on channel 6 */
public final boolean Channel6BreakerFault;

/** Breaker fault on channel 7 */
public final boolean Channel7BreakerFault;

/** Breaker fault on channel 8 */
public final boolean Channel8BreakerFault;

/** Breaker fault on channel 9 */
public final boolean Channel9BreakerFault;

/** Breaker fault on channel 10 */
public final boolean Channel10BreakerFault;

/** Breaker fault on channel 11 */
public final boolean Channel11BreakerFault;

/** Breaker fault on channel 12 */
public final boolean Channel12BreakerFault;

/** Breaker fault on channel 13 */
public final boolean Channel13BreakerFault;

/** Breaker fault on channel 14 */
public final boolean Channel14BreakerFault;

/** Breaker fault on channel 15 */
public final boolean Channel15BreakerFault;

/** Breaker fault on channel 16 */
public final boolean Channel16BreakerFault;

/** Breaker fault on channel 17 */
public final boolean Channel17BreakerFault;

/** Breaker fault on channel 18 */
public final boolean Channel18BreakerFault;

/** Breaker fault on channel 19 */
public final boolean Channel19BreakerFault;

/** Breaker fault on channel 20 */
public final boolean Channel20BreakerFault;

/** Breaker fault on channel 21 */
public final boolean Channel21BreakerFault;

/** Breaker fault on channel 22 */
public final boolean Channel22BreakerFault;

/** Breaker fault on channel 23 */
public final boolean Channel23BreakerFault;

/** The input voltage was below the minimum voltage */
public final boolean Brownout;

/** A warning was raised by the device's CAN controller */
public final boolean CanWarning;

/** The device's CAN controller experienced a "Bus Off" event */
public final boolean CanBusOff;

/** The device has reset since the last time sticky faults were cleared */
public final boolean HasReset;

/**
Expand Down
55 changes: 55 additions & 0 deletions hal/src/main/native/include/hal/PowerDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,66 +244,121 @@ struct HAL_PowerDistributionVersion {
};

struct HAL_PowerDistributionFaults {
/** Breaker fault on channel 0 */
uint32_t channel0BreakerFault : 1;
/** Breaker fault on channel 1 */
uint32_t channel1BreakerFault : 1;
/** Breaker fault on channel 2 */
uint32_t channel2BreakerFault : 1;
/** Breaker fault on channel 3 */
uint32_t channel3BreakerFault : 1;
/** Breaker fault on channel 4 */
uint32_t channel4BreakerFault : 1;
/** Breaker fault on channel 5 */
uint32_t channel5BreakerFault : 1;
/** Breaker fault on channel 6 */
uint32_t channel6BreakerFault : 1;
/** Breaker fault on channel 7 */
uint32_t channel7BreakerFault : 1;
/** Breaker fault on channel 8 */
uint32_t channel8BreakerFault : 1;
/** Breaker fault on channel 9 */
uint32_t channel9BreakerFault : 1;
/** Breaker fault on channel 10 */
uint32_t channel10BreakerFault : 1;
/** Breaker fault on channel 12 */
uint32_t channel11BreakerFault : 1;
/** Breaker fault on channel 13 */
uint32_t channel12BreakerFault : 1;
/** Breaker fault on channel 14 */
uint32_t channel13BreakerFault : 1;
/** Breaker fault on channel 15 */
uint32_t channel14BreakerFault : 1;
/** Breaker fault on channel 16 */
uint32_t channel15BreakerFault : 1;
/** Breaker fault on channel 17 */
uint32_t channel16BreakerFault : 1;
/** Breaker fault on channel 18 */
uint32_t channel17BreakerFault : 1;
/** Breaker fault on channel 19 */
uint32_t channel18BreakerFault : 1;
/** Breaker fault on channel 20 */
uint32_t channel19BreakerFault : 1;
/** Breaker fault on channel 21 */
uint32_t channel20BreakerFault : 1;
/** Breaker fault on channel 22 */
uint32_t channel21BreakerFault : 1;
/** Breaker fault on channel 23 */
uint32_t channel22BreakerFault : 1;
/** Breaker fault on channel 24 */
uint32_t channel23BreakerFault : 1;
/** The input voltage is below the minimum voltage */
uint32_t brownout : 1;
/** A warning was raised by the device's CAN controller */
uint32_t canWarning : 1;
/** The hardware on the device has malfunctioned */
uint32_t hardwareFault : 1;
};

/**
* Storage for REV PDH Sticky Faults
*/
struct HAL_PowerDistributionStickyFaults {
/** Breaker fault on channel 0 */
uint32_t channel0BreakerFault : 1;
/** Breaker fault on channel 1 */
uint32_t channel1BreakerFault : 1;
/** Breaker fault on channel 2 */
uint32_t channel2BreakerFault : 1;
/** Breaker fault on channel 3 */
uint32_t channel3BreakerFault : 1;
/** Breaker fault on channel 4 */
uint32_t channel4BreakerFault : 1;
/** Breaker fault on channel 5 */
uint32_t channel5BreakerFault : 1;
/** Breaker fault on channel 6 */
uint32_t channel6BreakerFault : 1;
/** Breaker fault on channel 7 */
uint32_t channel7BreakerFault : 1;
/** Breaker fault on channel 8 */
uint32_t channel8BreakerFault : 1;
/** Breaker fault on channel 9 */
uint32_t channel9BreakerFault : 1;
/** Breaker fault on channel 10 */
uint32_t channel10BreakerFault : 1;
/** Breaker fault on channel 12 */
uint32_t channel11BreakerFault : 1;
/** Breaker fault on channel 13 */
uint32_t channel12BreakerFault : 1;
/** Breaker fault on channel 14 */
uint32_t channel13BreakerFault : 1;
/** Breaker fault on channel 15 */
uint32_t channel14BreakerFault : 1;
/** Breaker fault on channel 16 */
uint32_t channel15BreakerFault : 1;
/** Breaker fault on channel 17 */
uint32_t channel16BreakerFault : 1;
/** Breaker fault on channel 18 */
uint32_t channel17BreakerFault : 1;
/** Breaker fault on channel 19 */
uint32_t channel18BreakerFault : 1;
/** Breaker fault on channel 20 */
uint32_t channel19BreakerFault : 1;
/** Breaker fault on channel 21 */
uint32_t channel20BreakerFault : 1;
/** Breaker fault on channel 22 */
uint32_t channel21BreakerFault : 1;
/** Breaker fault on channel 23 */
uint32_t channel22BreakerFault : 1;
/** Breaker fault on channel 24 */
uint32_t channel23BreakerFault : 1;
/** The input voltage is below the minimum voltage */
uint32_t brownout : 1;
/** A warning was raised by the device's CAN controller */
uint32_t canWarning : 1;
/** The device's CAN controller experienced a "Bus Off" event */
uint32_t canBusOff : 1;
/** The device has reset since the last time sticky faults were cleared */
uint32_t hasReset : 1;
};

Expand Down
Loading

0 comments on commit f79f336

Please sign in to comment.