2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* 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. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2014-05-02 17:54:01 -04:00
|
|
|
#pragma once
|
2013-12-15 18:30:16 -05:00
|
|
|
|
|
|
|
|
#include "Resource.h"
|
|
|
|
|
#include "SensorBase.h"
|
2014-05-02 17:54:01 -04:00
|
|
|
#include "HAL/HAL.hpp"
|
|
|
|
|
#include "HAL/cpp/Synchronized.hpp"
|
2013-12-15 18:30:16 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SolenoidBase class is the common base class for the Solenoid and
|
|
|
|
|
* DoubleSolenoid classes.
|
|
|
|
|
*/
|
2014-05-02 17:54:01 -04:00
|
|
|
class SolenoidBase : public SensorBase
|
|
|
|
|
{
|
2013-12-15 18:30:16 -05:00
|
|
|
public:
|
|
|
|
|
virtual ~SolenoidBase();
|
|
|
|
|
uint8_t GetAll();
|
|
|
|
|
|
|
|
|
|
protected:
|
2014-06-13 17:45:10 -04:00
|
|
|
explicit SolenoidBase(uint8_t pcmID);
|
2013-12-15 18:30:16 -05:00
|
|
|
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];
|
|
|
|
|
};
|