WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
InterruptableSensorBase.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 INTERRUPTABLE_SENSORBASE_H_
8 #define INTERRUPTABLE_SENSORBASE_H_
9 
10 #include "ChipObject.h"
11 #include "SensorBase.h"
12 
14 {
15 public:
17  virtual ~InterruptableSensorBase();
18  virtual void RequestInterrupts(tInterruptHandler handler, void *param) = 0;
19  virtual void RequestInterrupts() = 0;
20  virtual void CancelInterrupts();
21  virtual void WaitForInterrupt(float timeout);
22  virtual void EnableInterrupts();
23  virtual void DisableInterrupts();
24  virtual double ReadInterruptTimestamp();
25 protected:
26  tInterrupt *m_interrupt;
27  tInterruptManager *m_manager;
28  uint32_t m_interruptIndex;
29  void AllocateInterrupts(bool watcher);
30 };
31 
32 #endif
33 
virtual void WaitForInterrupt(float timeout)
Synchronus version.
Definition: InterruptableSensorBase.cpp:51
virtual void CancelInterrupts()
Free up the underlying chipobject functions.
Definition: InterruptableSensorBase.cpp:37
virtual void DisableInterrupts()
Disable, but don't deallocate.
Definition: InterruptableSensorBase.cpp:77
Definition: SensorBase.h:20
virtual double ReadInterruptTimestamp()
Return the timestamp for the interrupt that occurred.
Definition: InterruptableSensorBase.cpp:91
Definition: InterruptableSensorBase.h:13
virtual void RequestInterrupts()=0
Synchronus Wait version.
virtual void EnableInterrupts()
Enable interrupts - after finishing setup.
Definition: InterruptableSensorBase.cpp:65