12 #include <hal/Types.h>
13 #include <wpi/raw_ostream.h>
15 #include "frc/ErrorBase.h"
16 #include "frc/MotorSafety.h"
17 #include "frc/smartdashboard/Sendable.h"
18 #include "frc/smartdashboard/SendableHelper.h"
22 class SendableBuilder;
40 enum Value { kOff, kOn, kForward, kReverse };
41 enum Direction { kBothDirections, kForwardOnly, kReverseOnly };
52 explicit Relay(
int channel, Direction direction = kBothDirections);
79 void Set(Value value);
93 int GetChannel()
const;
96 void StopMotor()
override;
104 Direction m_direction;
106 hal::Handle<HAL_RelayHandle> m_forwardHandle;
107 hal::Handle<HAL_RelayHandle> m_reverseHandle;
Class for Spike style relay outputs.
Definition: Relay.h:36
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
This base class runs a watchdog timer and calls the subclass's StopMotor() function if the timeout ex...
Definition: MotorSafety.h:24
void Set(Value value)
Set the relay state.
~Relay() override
Free the resource associated with a relay.
Relay(int channel, Direction direction=kBothDirections)
Relay constructor given a channel.
Interface for Sendable objects.
Definition: Sendable.h:17
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:47
Value Get() const
Get the Relay State.
A helper class for use with objects that add themselves to SendableRegistry.
Definition: SendableHelper.h:28
Definition: SendableBuilder.h:23