WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
SolenoidBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #ifndef SOLENOID_BASE_H_
8 #define SOLENOID_BASE_H_
9 
10 #include "Resource.h"
11 #include "SensorBase.h"
12 #include "ChipObject.h"
13 #include "Synchronized.h"
14 
19 class SolenoidBase : public SensorBase {
20 public:
21  virtual ~SolenoidBase();
22  uint8_t GetAll();
23 
24 protected:
25  explicit SolenoidBase(uint8_t moduleNumber);
26  void Set(uint8_t value, uint8_t mask);
27  virtual void InitSolenoid() = 0;
28 
29  uint32_t m_moduleNumber;
30  static Resource *m_allocated;
31 
32 private:
33  static tSolenoid *m_fpgaSolenoidModule;
34  static uint32_t m_refCount;
35  static ReentrantSemaphore m_semaphore;
36 };
37 
38 #endif
virtual ~SolenoidBase()
Definition: SolenoidBase.cpp:38
uint8_t GetAll()
Definition: SolenoidBase.cpp:78
void Set(uint8_t value, uint8_t mask)
Definition: SolenoidBase.cpp:58
SolenoidBase(uint8_t moduleNumber)
Definition: SolenoidBase.cpp:22
Definition: SensorBase.h:20
uint32_t m_moduleNumber
Slot number where the module is plugged into the chassis.
Definition: SolenoidBase.h:29
Definition: Resource.h:23
Definition: Synchronized.h:31
Definition: SolenoidBase.h:19