WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
SensorBase.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 SENSORBASE_H_
8 #define SENSORBASE_H_
9 
10 #include "ChipObject/NiRio.h"
11 #include "ErrorBase.h"
12 #include <stdio.h>
13 #include "Base.h"
14 
20 class SensorBase: public ErrorBase {
21 public:
22  SensorBase();
23  virtual ~SensorBase();
24  static void DeleteSingletons();
25  static uint32_t GetDefaultAnalogModule() { return 1; }
26  static uint32_t GetDefaultDigitalModule() { return 1; }
27  static uint32_t GetDefaultSolenoidModule() { return 1; }
28  static bool CheckAnalogModule(uint8_t moduleNumber);
29  static bool CheckDigitalModule(uint8_t moduleNumber);
30  static bool CheckPWMModule(uint8_t moduleNumber);
31  static bool CheckRelayModule(uint8_t moduleNumber);
32  static bool CheckSolenoidModule(uint8_t moduleNumber);
33  static bool CheckDigitalChannel(uint32_t channel);
34  static bool CheckRelayChannel(uint32_t channel);
35  static bool CheckPWMChannel(uint32_t channel);
36  static bool CheckAnalogChannel(uint32_t channel);
37  static bool CheckSolenoidChannel(uint32_t channel);
38 
39  static const uint32_t kSystemClockTicksPerMicrosecond = 40;
40  static const uint32_t kDigitalChannels = 14;
41  static const uint32_t kAnalogChannels = 8;
42  static const uint32_t kAnalogModules = 2;
43  static const uint32_t kDigitalModules = 2;
44  static const uint32_t kSolenoidChannels = 8;
45  static const uint32_t kSolenoidModules = 2;
46  static const uint32_t kPwmChannels = 10;
47  static const uint32_t kRelayChannels = 8;
48  static const uint32_t kChassisSlots = 8;
49 protected:
50  void AddToSingletonList();
51 
52 private:
53  DISALLOW_COPY_AND_ASSIGN(SensorBase);
54  static SensorBase *m_singletonList;
55  SensorBase *m_nextSingleton;
56 };
57 
58 
59 #endif
static bool CheckPWMModule(uint8_t moduleNumber)
Definition: SensorBase.cpp:98
static bool CheckDigitalChannel(uint32_t channel)
Definition: SensorBase.cpp:132
static bool CheckRelayChannel(uint32_t channel)
Definition: SensorBase.cpp:146
static bool CheckPWMChannel(uint32_t channel)
Definition: SensorBase.cpp:160
Definition: SensorBase.h:20
Definition: ErrorBase.h:37
void AddToSingletonList()
Definition: SensorBase.cpp:47
static bool CheckRelayModule(uint8_t moduleNumber)
Definition: SensorBase.cpp:108
static void DeleteSingletons()
Definition: SensorBase.cpp:58
static bool CheckSolenoidModule(uint8_t moduleNumber)
Definition: SensorBase.cpp:118
static bool CheckAnalogChannel(uint32_t channel)
Definition: SensorBase.cpp:174
virtual ~SensorBase()
Definition: SensorBase.cpp:34
static bool CheckDigitalModule(uint8_t moduleNumber)
Definition: SensorBase.cpp:86
static bool CheckSolenoidChannel(uint32_t channel)
Definition: SensorBase.cpp:186
static bool CheckAnalogModule(uint8_t moduleNumber)
Definition: SensorBase.cpp:74
SensorBase()
Definition: SensorBase.cpp:27