blob: 5ea2963c12f382e445998b220757ab511498ac9a [file] [log] [blame]
jerrymf1579332013-02-07 01:56:28 +00001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5/*----------------------------------------------------------------------------*/
6
7#ifndef DIGITAL_SOURCE_H
8#define DIGITAL_SOURCE_H
9
10#include "InterruptableSensorBase.h"
11
12/**
13 * DigitalSource Interface.
14 * The DigitalSource represents all the possible inputs for a counter or a quadrature encoder. The source may be
15 * either a digital input or an analog input. If the caller just provides a channel, then a digital input will be
16 * constructed and freed when finished for the source. The source can either be a digital input or analog trigger
17 * but not both.
18 */
19class DigitalSource: public InterruptableSensorBase
20{
21public:
22 virtual ~DigitalSource();
23 virtual UINT32 GetChannelForRouting() = 0;
24 virtual UINT32 GetModuleForRouting() = 0;
25 virtual bool GetAnalogTriggerForRouting() = 0;
26 virtual void RequestInterrupts(tInterruptHandler handler, void *param) = 0;
27 virtual void RequestInterrupts() = 0;
28};
29
30#endif
31