001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007/**
008 * CAN API Types.
009 *
010 * <p>This class defines enums for CAN device types and manufacturer IDs as specified in the WPILib
011 * documentation: https://docs.wpilib.org/en/stable/docs/software/can-devices/can-addressing.html
012 */
013@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass")
014public final class CANAPITypes {
015  /**
016   * FRC CAN device type.
017   *
018   * <p>This enum represents different types of CAN devices. Teams are encouraged to use the
019   * kMiscellaneous for custom or miscellaneous devices.
020   *
021   * @see <a href=
022   *     "https://docs.wpilib.org/en/stable/docs/software/can-devices/can-addressing.html">CAN
023   *     Device Types</a>
024   */
025  public enum CANDeviceType {
026    /** Broadcast. */
027    kBroadcast(0),
028    /** Robot controller. */
029    kRobotController(1),
030    /** Motor controller. */
031    kMotorController(2),
032    /** Relay controller. */
033    kRelayController(3),
034    /** Gyro sensor. */
035    kGyroSensor(4),
036    /** Accelerometer. */
037    kAccelerometer(5),
038    /** Ultrasonic sensor. */
039    kUltrasonicSensor(6),
040    /** Gear tooth sensor. */
041    kGearToothSensor(7),
042    /** Power distribution. */
043    kPowerDistribution(8),
044    /** Pneumatics. */
045    kPneumatics(9),
046    /** Miscellaneous. */
047    kMiscellaneous(10),
048    /** IO breakout. */
049    kIOBreakout(11),
050    /** Firmware update. */
051    kFirmwareUpdate(31);
052
053    @SuppressWarnings("PMD.MemberName")
054    public final int id;
055
056    CANDeviceType(int id) {
057      this.id = id;
058    }
059  }
060
061  /**
062   * FRC CAN manufacturer ID.
063   *
064   * <p>This enum represents different manufacturer IDs for CAN devices. Teams are encouraged to use
065   * the kTeamUse manufacturer ID for custom or team-specific devices.
066   *
067   * @see <a href=
068   *     "https://docs.wpilib.org/en/stable/docs/software/can-devices/can-addressing.html">CAN
069   *     Manufacturer IDs</a>
070   */
071  public enum CANManufacturer {
072    /** Broadcast. */
073    kBroadcast(0),
074    /** National Instruments. */
075    kNI(1),
076    /** Luminary Micro. */
077    kLM(2),
078    /** DEKA Research and Development Corp. */
079    kDEKA(3),
080    /** Cross the Road Electronics. */
081    kCTRE(4),
082    /** REV Robotics. */
083    kREV(5),
084    /** Grapple. */
085    kGrapple(6),
086    /** MindSensors. */
087    kMS(7),
088    /** Team use. */
089    kTeamUse(8),
090    /** Kauai Labs. */
091    kKauaiLabs(9),
092    /** Copperforge. */
093    kCopperforge(10),
094    /** Playing With Fusion. */
095    kPWF(11),
096    /** Studica. */
097    kStudica(12),
098    /** TheThriftyBot. */
099    kTheThriftyBot(13),
100    /** Redux Robotics. */
101    kReduxRobotics(14),
102    /** AndyMark. */
103    kAndyMark(15),
104    /** Vivid-Hosting. */
105    kVividHosting(16);
106
107    @SuppressWarnings("PMD.MemberName")
108    public final int id;
109
110    CANManufacturer(int id) {
111      this.id = id;
112    }
113  }
114
115  /** Utility class. */
116  private CANAPITypes() {}
117}