Class CanandcolorDetails.Bitsets

java.lang.Object
com.reduxrobotics.sensors.canandcolor.CanandcolorDetails.Bitsets
Enclosing class:
CanandcolorDetails

public static class CanandcolorDetails.Bitsets extends Object
Canandcolor bitsets.
  • Field Details

    • kSettingReportFlags_SetSuccess

      public static final int kSettingReportFlags_SetSuccess
      setting_report_flags - Whether the setting set/fetch was successful
      See Also:
    • kSettingReportFlags_CommitSuccess

      public static final int kSettingReportFlags_CommitSuccess
      setting_report_flags - Whether the setting synch commit was successful
      See Also:
    • kFaults_PowerCycle

      public static final int kFaults_PowerCycle
      faults - The power cycle fault flag, which is set to true when the device first boots. Clearing sticky faults and then checking this flag can be used to determine if the device rebooted.
      See Also:
    • kFaults_CanIdConflict

      public static final int kFaults_CanIdConflict
      faults - The CAN ID conflict flag, which is set to true if there is a CAN id conflict. In practice, you should physically inspect the device to ensure it's not flashing blue.
      See Also:
    • kFaults_CanGeneralError

      public static final int kFaults_CanGeneralError
      faults - The CAN general error flag, which will raise if the device encounters a CAN fault during operation. If communication with the device still functions, this will not register as an active fault for long if at all. This may raise due to wiring issues, such as an intermittently shorted CAN bus.
      See Also:
    • kFaults_OutOfTemperatureRange

      public static final int kFaults_OutOfTemperatureRange
      faults - The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius. This may be of concern if the device is near very active motors.
      See Also:
    • kFaults_HardwareFaultDistance

      public static final int kFaults_HardwareFaultDistance
      faults - The hardware fault flag corresponding to the distance sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.
      See Also:
    • kFaults_HardwareFaultColor

      public static final int kFaults_HardwareFaultColor
      faults - The hardware fault flag corresponding to the color sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.
      See Also:
    • kFaults_I2cBusRecovery

      public static final int kFaults_I2cBusRecovery
      faults - The I2C bus recovery flag, which will raise when the device needs to completely restart the I2C bus. This fault flag should not be active for very long; if it is stuck as an active fault, that may indicate a hardware issue.
      See Also:
    • kDigoutCond_Slot0

      public static final int kDigoutCond_Slot0
      digout_cond - Slot 0
      See Also:
    • kDigoutCond_Slot1

      public static final int kDigoutCond_Slot1
      digout_cond - Slot 1
      See Also:
    • kDigoutCond_Slot2

      public static final int kDigoutCond_Slot2
      digout_cond - Slot 2
      See Also:
    • kDigoutCond_Slot3

      public static final int kDigoutCond_Slot3
      digout_cond - Slot 3
      See Also:
    • kDigoutCond_Slot4

      public static final int kDigoutCond_Slot4
      digout_cond - Slot 4
      See Also:
    • kDigoutCond_Slot5

      public static final int kDigoutCond_Slot5
      digout_cond - Slot 5
      See Also:
    • kDigoutCond_Slot6

      public static final int kDigoutCond_Slot6
      digout_cond - Slot 6
      See Also:
    • kDigoutCond_Slot7

      public static final int kDigoutCond_Slot7
      digout_cond - Slot 7
      See Also:
    • kDigoutCond_Slot8

      public static final int kDigoutCond_Slot8
      digout_cond - Slot 8
      See Also:
    • kDigoutCond_Slot9

      public static final int kDigoutCond_Slot9
      digout_cond - Slot 9
      See Also:
    • kDigoutCond_Slot10

      public static final int kDigoutCond_Slot10
      digout_cond - Slot 10
      See Also:
    • kDigoutCond_Slot11

      public static final int kDigoutCond_Slot11
      digout_cond - Slot 11
      See Also:
    • kDigoutCond_Slot12

      public static final int kDigoutCond_Slot12
      digout_cond - Slot 12
      See Also:
    • kDigoutCond_Slot13

      public static final int kDigoutCond_Slot13
      digout_cond - Slot 13
      See Also:
    • kDigoutCond_Slot14

      public static final int kDigoutCond_Slot14
      digout_cond - Slot 14
      See Also:
    • kDigoutCond_Slot15

      public static final int kDigoutCond_Slot15
      digout_cond - Slot 15
      See Also:
  • Method Details

    • constructSettingReportFlags

      public static int constructSettingReportFlags(boolean setSuccess, boolean commitSuccess)
      Constructs a setting_report_flags bitset.
      Parameters:
      setSuccess - Whether the setting set/fetch was successful
      commitSuccess - Whether the setting synch commit was successful
      Returns:
      bitset data as int
    • constructFaults

      public static int constructFaults(boolean powerCycle, boolean canIdConflict, boolean canGeneralError, boolean outOfTemperatureRange, boolean hardwareFaultDistance, boolean hardwareFaultColor, boolean i2cBusRecovery)
      Constructs a faults bitset.
      Parameters:
      powerCycle - The power cycle fault flag, which is set to true when the device first boots. Clearing sticky faults and then checking this flag can be used to determine if the device rebooted.
      canIdConflict - The CAN ID conflict flag, which is set to true if there is a CAN id conflict. In practice, you should physically inspect the device to ensure it's not flashing blue.
      canGeneralError - The CAN general error flag, which will raise if the device encounters a CAN fault during operation. If communication with the device still functions, this will not register as an active fault for long if at all. This may raise due to wiring issues, such as an intermittently shorted CAN bus.
      outOfTemperatureRange - The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius. This may be of concern if the device is near very active motors.
      hardwareFaultDistance - The hardware fault flag corresponding to the distance sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.
      hardwareFaultColor - The hardware fault flag corresponding to the color sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.
      i2cBusRecovery - The I2C bus recovery flag, which will raise when the device needs to completely restart the I2C bus. This fault flag should not be active for very long; if it is stuck as an active fault, that may indicate a hardware issue.
      Returns:
      bitset data as int
    • constructDigoutCond

      public static int constructDigoutCond(boolean slot0, boolean slot1, boolean slot2, boolean slot3, boolean slot4, boolean slot5, boolean slot6, boolean slot7, boolean slot8, boolean slot9, boolean slot10, boolean slot11, boolean slot12, boolean slot13, boolean slot14, boolean slot15)
      Constructs a digout_cond bitset.
      Parameters:
      slot0 - Slot 0
      slot1 - Slot 1
      slot2 - Slot 2
      slot3 - Slot 3
      slot4 - Slot 4
      slot5 - Slot 5
      slot6 - Slot 6
      slot7 - Slot 7
      slot8 - Slot 8
      slot9 - Slot 9
      slot10 - Slot 10
      slot11 - Slot 11
      slot12 - Slot 12
      slot13 - Slot 13
      slot14 - Slot 14
      slot15 - Slot 15
      Returns:
      bitset data as int
    • extractSettingReportFlags_SetSuccess

      public static boolean extractSettingReportFlags_SetSuccess(int field)
      Extracts set_success from setting_report_flags.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractSettingReportFlags_CommitSuccess

      public static boolean extractSettingReportFlags_CommitSuccess(int field)
      Extracts commit_success from setting_report_flags.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_PowerCycle

      public static boolean extractFaults_PowerCycle(int field)
      Extracts power_cycle from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_CanIdConflict

      public static boolean extractFaults_CanIdConflict(int field)
      Extracts can_id_conflict from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_CanGeneralError

      public static boolean extractFaults_CanGeneralError(int field)
      Extracts can_general_error from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_OutOfTemperatureRange

      public static boolean extractFaults_OutOfTemperatureRange(int field)
      Extracts out_of_temperature_range from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_HardwareFaultDistance

      public static boolean extractFaults_HardwareFaultDistance(int field)
      Extracts hardware_fault_distance from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_HardwareFaultColor

      public static boolean extractFaults_HardwareFaultColor(int field)
      Extracts hardware_fault_color from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractFaults_I2cBusRecovery

      public static boolean extractFaults_I2cBusRecovery(int field)
      Extracts i2c_bus_recovery from faults.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot0

      public static boolean extractDigoutCond_Slot0(int field)
      Extracts slot0 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot1

      public static boolean extractDigoutCond_Slot1(int field)
      Extracts slot1 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot2

      public static boolean extractDigoutCond_Slot2(int field)
      Extracts slot2 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot3

      public static boolean extractDigoutCond_Slot3(int field)
      Extracts slot3 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot4

      public static boolean extractDigoutCond_Slot4(int field)
      Extracts slot4 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot5

      public static boolean extractDigoutCond_Slot5(int field)
      Extracts slot5 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot6

      public static boolean extractDigoutCond_Slot6(int field)
      Extracts slot6 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot7

      public static boolean extractDigoutCond_Slot7(int field)
      Extracts slot7 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot8

      public static boolean extractDigoutCond_Slot8(int field)
      Extracts slot8 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot9

      public static boolean extractDigoutCond_Slot9(int field)
      Extracts slot9 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot10

      public static boolean extractDigoutCond_Slot10(int field)
      Extracts slot10 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot11

      public static boolean extractDigoutCond_Slot11(int field)
      Extracts slot11 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot12

      public static boolean extractDigoutCond_Slot12(int field)
      Extracts slot12 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot13

      public static boolean extractDigoutCond_Slot13(int field)
      Extracts slot13 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot14

      public static boolean extractDigoutCond_Slot14(int field)
      Extracts slot14 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not
    • extractDigoutCond_Slot15

      public static boolean extractDigoutCond_Slot15(int field)
      Extracts slot15 from digout_cond.
      Parameters:
      field - data bitfield
      Returns:
      true if set, false if not