component: Pwr
proto_imports:
  - vehicle/common/proto/power_board.proto
metric: ::l3_power::PowerStatus
namespace: l3_pwr

# TODO(SWAT-2908): Nicely setup l3_power diagnostic collector
faults:
    # Fault should be an ERROR.
  - id: 0
    name: RESERVED
    severity: WARNING
    description:
    # Fault should be an ERROR.
  - id: 1
    name: I2C_TEMP_TX_ERROR
    severity: WARNING
    description: "Failure communicating with i2c devices on temperature sensor bus."
    # Fault should be an ERROR.
  - id: 2
    name: I2C_TEMP_INIT_ERROR
    severity: WARNING
    description: "Failed to initialize i2c temperature sensor bus."
    # Deprecated.
  - id: 3
    name: UNUSED_FAULT3
    severity: INFO
    description: "Unused error code."
    deprecated: true
    # Deprecated.
  - id: 4
    name: UNUSED_FAULT4
    severity: INFO
    description: "Unused error code."
    deprecated: true
  - id: 5
    name: AI_CAN_ERROR
    severity: INFO
    description: "Unimplemented."
  - id: 6
    name: AI_CAN_RX_ERROR
    severity: INFO
    description: "Unimplemented."
  - id: 7
    name: AI_CAN_TX_ERROR
    severity: INFO
    description: "Unimplemented."
    # Fault should be an ERROR.
  - id: 8
    name: HW_WATCHDOG
    severity: WARNING
    description: "Powerboard watchdog triggered. Check power systems and restart the vehicle."
  - id: 9
    name: EFUSE_FAULTED
    severity: INFO
    description: "Unimplemented."
    # Fault should be an ERROR.
  - id: 10
    name: EFUSE_MIA
    severity: WARNING
    description: "eFuse is no longer detected."
    # Fault should be an ERROR.
  - id: 11
    name: OVER_TEMPERATURE
    severity: WARNING
    description: "The powerboard has reached critical temperature and needs to cool down."
    # Deprecated.
  - id: 12
    name: UNUSED_FAULT12
    severity: INFO
    description: "Unused error code."
    deprecated: true
  - id: 13
    name: SOFTWARE_ASSERT
    severity: INFO
    description: "Unimplemented."
  - id: 14
    name: INITIALIZATION_FAILURE
    severity: INFO
    description: "Unimplemented."
  - id: 15
    name: STATE_ERROR
    severity: WARNING
    description: "Powerboard state machine in an invalid state."
    # Fault should be an ERROR.
  - id: 16
    name: OUTPUT_OVER_VOLTAGE
    severity: WARNING
    description: "Powerboard voltage regulators are outputting a higher than nominal voltage."
    # Fault should be an ERROR.
  - id: 17
    name: OUTPUT_UNDER_VOLTAGE
    severity: WARNING
    description: "Powerboard voltage regulators are outputtting a lower than nominal voltage."
    # Fault should be an ERROR.
  - id: 18
    name: EFUSE_REQUESTED_SHUTDOWN
    severity: WARNING
    description: "Efuse has requested the powerboard to shutdown due to a fault."
    # Fault should be an ERROR.
  - id: 19
    name: UNDER_TEMPERATURE
    severity: WARNING
    description: "The powerboard temperature is critically low and needs to warm up."
