WPILibC++ 2024.3.2
DigitalSource.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <hal/Types.h>
8
10
11namespace frc {
12
13/**
14 * DigitalSource Interface.
15 *
16 * The DigitalSource represents all the possible inputs for a counter or a
17 * quadrature encoder. The source may be either a digital input or an analog
18 * input. If the caller just provides a channel, then a digital input will be
19 * constructed and freed when finished for the source. The source can either be
20 * a digital input or analog trigger but not both.
21 */
23 public:
24 DigitalSource() = default;
27
30 virtual bool IsAnalogTrigger() const = 0;
31 virtual int GetChannel() const = 0;
32};
33
34} // namespace frc
DigitalSource Interface.
Definition: DigitalSource.h:22
virtual AnalogTriggerType GetAnalogTriggerTypeForRouting() const =0
DigitalSource()=default
virtual bool IsAnalogTrigger() const =0
virtual HAL_Handle GetPortHandleForRouting() const =0
DigitalSource(DigitalSource &&)=default
virtual int GetChannel() const =0
DigitalSource & operator=(DigitalSource &&)=default
int32_t HAL_Handle
Definition: Types.h:17
Definition: AprilTagPoseEstimator.h:15
AnalogTriggerType
Defines the state in which the AnalogTrigger triggers.
Definition: AnalogTriggerType.h:10