WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
AnalogTrigger.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 ANALOG_TRIGGER_H_
8 #define ANALOG_TRIGGER_H_
9 
10 #include "AnalogTriggerOutput.h"
11 #include "SensorBase.h"
12 
13 class AnalogChannel;
14 class AnalogModule;
15 
17 {
18  friend class AnalogTriggerOutput;
19 public:
20  AnalogTrigger(uint8_t moduleNumber, uint32_t channel);
21  explicit AnalogTrigger(uint32_t channel);
22  explicit AnalogTrigger(AnalogChannel *channel);
23  virtual ~AnalogTrigger();
24 
25  void SetLimitsVoltage(float lower, float upper);
26  void SetLimitsRaw(int32_t lower, int32_t upper);
27  void SetAveraged(bool useAveragedValue);
28  void SetFiltered(bool useFilteredValue);
29  uint32_t GetIndex();
30  bool GetInWindow();
31  bool GetTriggerState();
32  AnalogTriggerOutput *CreateOutput(AnalogTriggerOutput::Type type);
33 
34 private:
35  void InitTrigger(uint8_t moduleNumber, uint32_t channel);
36 
37  uint8_t m_index;
38  tAnalogTrigger *m_trigger;
39  AnalogModule *m_analogModule;
40  uint32_t m_channel;
41 };
42 
43 #endif
44 
Definition: AnalogTrigger.h:16
Definition: AnalogModule.h:20
Definition: AnalogTriggerOutput.h:41
AnalogTriggerOutput * CreateOutput(AnalogTriggerOutput::Type type)
Definition: AnalogTrigger.cpp:195
uint32_t GetIndex()
Definition: AnalogTrigger.cpp:152
AnalogTrigger(uint8_t moduleNumber, uint32_t channel)
Definition: AnalogTrigger.cpp:60
void SetAveraged(bool useAveragedValue)
Definition: AnalogTrigger.cpp:122
void SetLimitsVoltage(float lower, float upper)
Definition: AnalogTrigger.cpp:103
Definition: SensorBase.h:20
bool GetInWindow()
Definition: AnalogTrigger.cpp:163
void SetLimitsRaw(int32_t lower, int32_t upper)
Definition: AnalogTrigger.cpp:86
bool GetTriggerState()
Definition: AnalogTrigger.cpp:179
Definition: AnalogChannel.h:29
void SetFiltered(bool useFilteredValue)
Definition: AnalogTrigger.cpp:137