Files
allwpilib/wpilibc/wpilibC++Devices/include/SolenoidBase.h
Alex Henning 7c8124d76c Allowed sharing of common C++ code between RoboRIO and Simulation.
Change-Id: I8bf2bda9df389c13ae0567a62dbf0ca931ceb6f8
2014-08-08 18:36:03 -04:00

34 lines
996 B
C++

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "Resource.h"
#include "SensorBase.h"
#include "HAL/HAL.hpp"
#include "HAL/cpp/Synchronized.hpp"
/**
* SolenoidBase class is the common base class for the Solenoid and
* DoubleSolenoid classes.
*/
class SolenoidBase : public SensorBase
{
public:
virtual ~SolenoidBase();
uint8_t GetAll();
protected:
explicit SolenoidBase(uint8_t pcmID);
void Set(uint8_t value, uint8_t mask);
virtual void InitSolenoid() = 0;
uint32_t m_moduleNumber; ///< Slot number where the module is plugged into the chassis.
static Resource *m_allocated;
private:
void* m_ports[kSolenoidChannels];
};