WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #ifndef INTERRUPTABLE_SENSORBASE_H_ 00008 #define INTERRUPTABLE_SENSORBASE_H_ 00009 00010 #include "ChipObject.h" 00011 #include "SensorBase.h" 00012 00013 class InterruptableSensorBase : public SensorBase 00014 { 00015 public: 00016 InterruptableSensorBase(); 00017 virtual ~InterruptableSensorBase(); 00018 virtual void RequestInterrupts(tInterruptHandler handler, void *param) = 0; 00019 virtual void RequestInterrupts() = 0; 00020 virtual void CancelInterrupts(); 00021 virtual void WaitForInterrupt(float timeout); 00022 virtual void EnableInterrupts(); 00023 virtual void DisableInterrupts(); 00024 virtual double ReadInterruptTimestamp(); 00025 protected: 00026 tInterrupt *m_interrupt; 00027 tInterruptManager *m_manager; 00028 UINT32 m_interruptIndex; 00029 void AllocateInterrupts(bool watcher); 00030 }; 00031 00032 #endif 00033