001package com.ctre.phoenix;
002
003/**
004 * Status frames for CANifier
005 */
006public enum CANifierStatusFrame {
007        /**
008         * General status 1
009         */
010        Status_1_General(0x041400), 
011        /**
012         * General status 2
013         */
014        Status_2_General(0x041440), 
015        /**
016         * PWM0 input
017         */
018        Status_3_PwmInputs0(0x041480), 
019        /**
020         * PWM1 input
021         */
022        Status_4_PwmInputs1(0x0414C0), 
023        /**
024         * PWM2 input
025         */
026        Status_5_PwmInputs2(0x041500), 
027        /**
028         * PWM3 input
029         */
030        Status_6_PwmInputs3(0x041540), 
031        /**
032         * Miscelaneous status
033         */
034        Status_8_Misc(0x0415C0);
035
036        /**
037         * Get the CANifier Status frame from a specified value  
038         * @param value integer value of CANifier status frame
039         * @return CANifier status frame of specified value
040         */
041        public static CANifierStatusFrame valueOf(int value) {
042                for (CANifierStatusFrame frame : values()) {
043                        if (frame.value == value) {
044                                return frame;
045                        }
046                }
047                return null;
048        }
049
050        /**
051         * Value of CANifier status frame
052         */
053        public final int value;
054
055        /**
056         * Create a CANifierStatusFrame from initValue
057         * @param initValue Value of CANifier Status Frame
058         */
059        CANifierStatusFrame(int initValue) {
060                this.value = initValue;
061        }
062}