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    /** Distance sensor. */
039    kDistanceSensor(6),
040    /** Encoder. */
041    kEncoder(7),
042    /** Power distribution. */
043    kPowerDistribution(8),
044    /** Pneumatics. */
045    kPneumatics(9),
046    /** Miscellaneous. */
047    kMiscellaneous(10),
048    /** IO breakout. */
049    kIOBreakout(11),
050    /** Servo Controller. */
051    kServoController(12),
052    /** Color Sensor. */
053    kColorSensor(13),
054    /** Firmware update. */
055    kFirmwareUpdate(31);
056
057    /** The device type ID. */
058    @SuppressWarnings("MemberName")
059    public final int id;
060
061    CANDeviceType(int id) {
062      this.id = id;
063    }
064  }
065
066  /**
067   * FRC CAN manufacturer ID.
068   *
069   * <p>This enum represents different manufacturer IDs for CAN devices. Teams are encouraged to use
070   * the kTeamUse manufacturer ID for custom or team-specific devices.
071   *
072   * @see <a href=
073   *     "https://docs.wpilib.org/en/stable/docs/software/can-devices/can-addressing.html">CAN
074   *     Manufacturer IDs</a>
075   */
076  public enum CANManufacturer {
077    /** Broadcast. */
078    kBroadcast(0),
079    /** National Instruments. */
080    kNI(1),
081    /** Luminary Micro. */
082    kLM(2),
083    /** DEKA Research and Development Corp. */
084    kDEKA(3),
085    /** Cross the Road Electronics. */
086    kCTRE(4),
087    /** REV Robotics. */
088    kREV(5),
089    /** Grapple. */
090    kGrapple(6),
091    /** MindSensors. */
092    kMS(7),
093    /** Team use. */
094    kTeamUse(8),
095    /** Kauai Labs. */
096    kKauaiLabs(9),
097    /** Copperforge. */
098    kCopperforge(10),
099    /** Playing With Fusion. */
100    kPWF(11),
101    /** Studica. */
102    kStudica(12),
103    /** TheThriftyBot. */
104    kTheThriftyBot(13),
105    /** Redux Robotics. */
106    kReduxRobotics(14),
107    /** AndyMark. */
108    kAndyMark(15),
109    /** Vivid-Hosting. */
110    kVividHosting(16),
111    /** Vertos Robotics. */
112    kVertosRobotics(17),
113    /** SWYFT Robotics. */
114    kSWYFTRobotics(18),
115    /** Lumyn Labs. */
116    kLumynLabs(19),
117    /** Brushland Labs. */
118    kBrushlandLabs(20);
119
120    /** The manufacturer ID. */
121    @SuppressWarnings("MemberName")
122    public final int id;
123
124    CANManufacturer(int id) {
125      this.id = id;
126    }
127  }
128
129  /** Utility class. */
130  private CANAPITypes() {}
131}