Now you can download a copy of these docs so you can use them offline! Download now
AnalogTriggerOutput.cpp
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 #include "AnalogTriggerOutput.h" 00008 #include "AnalogTrigger.h" 00009 #include "WPIErrors.h" 00010 00020 AnalogTriggerOutput::AnalogTriggerOutput(AnalogTrigger *trigger, AnalogTriggerOutput::Type outputType) 00021 : m_trigger (trigger) 00022 , m_outputType (outputType) 00023 { 00024 } 00025 00026 AnalogTriggerOutput::~AnalogTriggerOutput() 00027 { 00028 } 00029 00034 bool AnalogTriggerOutput::Get() 00035 { 00036 tRioStatusCode localStatus = NiFpga_Status_Success; 00037 bool result = false; 00038 switch(m_outputType) 00039 { 00040 case kInWindow: 00041 result = m_trigger->m_trigger->readOutput_InHysteresis(m_trigger->m_index, &localStatus); 00042 case kState: 00043 result = m_trigger->m_trigger->readOutput_OverLimit(m_trigger->m_index, &localStatus); 00044 case kRisingPulse: 00045 case kFallingPulse: 00046 wpi_setWPIError(AnalogTriggerPulseOutputError); 00047 return false; 00048 } 00049 wpi_setError(localStatus); 00050 return result; 00051 } 00052 00056 UINT32 AnalogTriggerOutput::GetChannelForRouting() 00057 { 00058 return (m_trigger->m_index << 2) + m_outputType; 00059 } 00060 00064 UINT32 AnalogTriggerOutput::GetModuleForRouting() 00065 { 00066 return m_trigger->m_index >> 2; 00067 } 00068 00072 bool AnalogTriggerOutput::GetAnalogTriggerForRouting() 00073 { 00074 return true; 00075 } 00076 00081 void AnalogTriggerOutput::RequestInterrupts(tInterruptHandler handler, void *param) 00082 { 00083 } 00084 00089 void AnalogTriggerOutput::RequestInterrupts() 00090 { 00091 } 00092
Generated on Thu Jan 12 2012 22:35:17 for WPILibC++ by
1.7.1