001    /*----------------------------------------------------------------------------*/
002    /* Copyright (c) FIRST 2008-2012. All Rights Reserved.                        */
003    /* Open Source Software - may be modified and shared by FRC teams. The code   */
004    /* must be accompanied by the FIRST BSD license file in the root directory of */
005    /* the project.                                                               */
006    /*----------------------------------------------------------------------------*/
007    
008    package edu.wpi.first.wpilibj;
009    
010    /**
011     * DigitalSource Interface.
012     * The DigitalSource represents all the possible inputs for a counter or a quadrature encoder. The source may be
013     * either a digital input or an analog input. If the caller just provides a channel, then a digital input will be
014     * constructed and freed when finished for the source. The source can either be a digital input or analog trigger
015     * but not both.
016     */
017    public abstract class DigitalSource extends InterruptableSensorBase {
018    
019        /**
020         * Get the channel routing number
021         * @return channel routing number
022         */
023        public abstract int getChannelForRouting();
024    
025        /**
026         * Get the module routing number
027         * @return module routing number
028         */
029        public abstract int getModuleForRouting();
030    
031        /**
032         * Is this an analog trigger
033         * @return true if this is an analog trigger
034         */
035        public abstract boolean getAnalogTriggerForRouting();
036    }