WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
DigitalInput.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 DIGITAL_INPUT_H_
8 #define DIGITAL_INPUT_H_
9 
10 class DigitalModule;
11 
12 #include "DigitalSource.h"
13 #include "LiveWindow/LiveWindowSendable.h"
14 
22 class DigitalInput : public DigitalSource, public LiveWindowSendable {
23 public:
24  explicit DigitalInput(uint32_t channel);
25  DigitalInput(uint8_t moduleNumber, uint32_t channel);
26  virtual ~DigitalInput();
27  uint32_t Get();
28  uint32_t GetChannel();
29 
30  // Digital Source Interface
31  virtual uint32_t GetChannelForRouting();
32  virtual uint32_t GetModuleForRouting();
33  virtual bool GetAnalogTriggerForRouting();
34 
35  // Interruptable Interface
36  virtual void RequestInterrupts(tInterruptHandler handler, void *param=NULL);
37  virtual void RequestInterrupts();
38  void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
39 
40  void UpdateTable();
41  void StartLiveWindowMode();
42  void StopLiveWindowMode();
43  std::string GetSmartDashboardType();
44  void InitTable(ITable *subTable);
45  ITable * GetTable();
46 
47 private:
48  void InitDigitalInput(uint8_t moduleNumber, uint32_t channel);
49  uint32_t m_channel;
50  DigitalModule *m_module;
51  bool m_lastValue;
52 
53  ITable *m_table;
54 };
55 
56 #endif
57 
virtual ~DigitalInput()
Definition: DigitalInput.cpp:71
Definition: DigitalInput.h:22
Definition: DigitalSource.h:19
DigitalInput(uint32_t channel)
Definition: DigitalInput.cpp:51
virtual uint32_t GetModuleForRouting()
Definition: DigitalInput.cpp:112
uint32_t GetChannel()
Definition: DigitalInput.cpp:96
virtual uint32_t GetChannelForRouting()
Definition: DigitalInput.cpp:104
virtual bool GetAnalogTriggerForRouting()
Definition: DigitalInput.cpp:121
virtual void RequestInterrupts()
Synchronus Wait version.
Definition: DigitalInput.cpp:165
Definition: DigitalModule.h:17