WPILib 2012
WPILibRoboticsLibraryforFRC
CInterfaces/CEncoder.h
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 _C_ENCODER_H
00008 #define _C_ENCODER_H
00009 
00010 void StartEncoder(UINT32 aChannel, UINT32 bChannel);
00011 INT32 GetEncoder(UINT32 aChannel, UINT32 bChannel);
00012 void ResetEncoder(UINT32 aChannel, UINT32 bChannel);
00013 void StopEncoder(UINT32 aChannel, UINT32 bChannel);
00014 double GetEncoderPeriod(UINT32 aChannel, UINT32 bChannel);
00015 void SetMaxEncoderPeriod(UINT32 aChannel, UINT32 bChannel, double maxPeriod);
00016 bool GetEncoderStopped(UINT32 aChannel, UINT32 bChannel);
00017 bool GetEncoderDirection(UINT32 aChannel, UINT32 bChannel);
00018 double GetEncoderDistance(UINT32 aChannel, UINT32 bChannel);
00019 double GetEncoderRate(UINT32 aChannel, UINT32 bChannel);
00020 void SetMinEncoderRate(UINT32 aChannel, UINT32 bChannel, double minRate);
00021 void SetEncoderDistancePerPulse(UINT32 aChannel, UINT32 bChannel, double distancePerPulse);
00022 void SetEncoderReverseDirection(UINT32 aChannel, UINT32 bChannel, bool reversedDirection);
00023 void StartEncoder(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00024 INT32 GetEncoder(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00025 void ResetEncoder(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00026 void StopEncoder(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00027 double GetEncoderPeriod(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00028 void SetMaxEncoderPeriod(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel, double maxPeriod);
00029 bool GetEncoderStopped(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00030 bool GetEncoderDirection(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00031 double GetEncoderDistance(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00032 double GetEncoderRate(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00033 void SetMinEncoderRate(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel, double minRate);
00034 void SetEncoderDistancePerPulse(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel, double distancePerPulse);
00035 void SetEncoderReverseDirection(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel, bool reversedDirection);
00036 void DeleteEncoder(UINT32 aChannel, UINT32 bChannel);
00037 void DeleteEncoder(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00038 
00039 typedef void *EncoderObject;
00040 
00041 EncoderObject CreateEncoder(UINT32 aChannel, UINT32 bChannel);
00042 EncoderObject CreateEncoder(UINT8 amoduleNumber, UINT32 aChannel, UINT8 bmoduleNumber, UINT32 bChannel);
00043 void StartEncoder(EncoderObject o);
00044 INT32 GetEncoder(EncoderObject o);
00045 void ResetEncoder(EncoderObject o);
00046 void StopEncoder(EncoderObject o);
00047 double GetEncoderPeriod(EncoderObject o);
00048 void SetMaxEncoderPeriod(EncoderObject o, double maxPeriod);
00049 bool GetEncoderStopped(EncoderObject o);
00050 bool GetEncoderDirection(EncoderObject o);
00051 double GetEncoderDistance(EncoderObject o);
00052 double GetEncoderRate(EncoderObject o);
00053 void SetMinEncoderRate(EncoderObject o, double minRate);
00054 void SetEncoderDistancePerPulse(EncoderObject o, double distancePerPulse);
00055 void SetEncoderReverseDirection(EncoderObject o, bool reversedDirection);
00056 void DeleteEncoder(EncoderObject o);
00057 #endif
 All Classes Functions Variables