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