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