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 C_ANALOG_CHANNEL_H 00008 #define C_ANALOG_CHANNEL_H 00009 00010 #include "AnalogChannel.h" 00011 #include "CWrappers.h" 00012 00013 AnalogChannel *AllocateAnalogChannel(UINT8 moduleNumber, UINT32 channel /*,SensorCreator createObject*/); 00014 00015 INT16 GetAnalogValue(UINT8 moduleNumber, UINT32 channel); 00016 INT32 GetAnalogAverageValue(UINT8 moduleNumber, UINT32 channel); 00017 00018 float GetAnalogVoltage(UINT8 moduleNumber, UINT32 channel); 00019 float GetAnalogAverageVoltage(UINT8 moduleNumber, UINT32 channel); 00020 00021 void SetAnalogAverageBits(UINT8 moduleNumber, UINT32 channel, UINT32 bits); 00022 UINT32 GetAnalogAverageBits(UINT8 moduleNumber, UINT32 channel); 00023 void SetAnalogOversampleBits(UINT8 moduleNumber, UINT32 channel, UINT32 bits); 00024 UINT32 GetAnalogOversampleBits(UINT8 moduleNumber, UINT32 channel); 00025 00026 INT16 GetAnalogValue(UINT32 channel); 00027 INT32 GetAnalogAverageValue(UINT32 channel); 00028 00029 float GetAnalogVoltage(UINT32 channel); 00030 float GetAnalogAverageVoltage(UINT32 channel); 00031 00032 void SetAnalogAverageBits(UINT32 channel, UINT32 bits); 00033 UINT32 GetAnalogAverageBits(UINT32 channel); 00034 void SetAnalogOversampleBits(UINT32 channel, UINT32 bits); 00035 UINT32 GetAnalogOversampleBits(UINT32 channel); 00036 00037 UINT32 GetAnalogLSBWeight(); 00038 INT32 GetAnalogOffset(); 00039 00040 void DeleteAnalogChannel(UINT8 moduleNumber, UINT32 channel); 00041 void DeleteAnalogChannel(UINT32 channel); 00042 00043 typedef void *AnalogChannelObject; 00044 00045 AnalogChannelObject CreateAnalogChannel(UINT8 moduleNumber, UINT32 channel); 00046 AnalogChannelObject CreateAnalogChannel(UINT32 channel); 00047 INT16 GetAnalogValue(AnalogChannelObject o); 00048 INT32 GetAnalogAverageValue(AnalogChannelObject o); 00049 00050 float GetAnalogVoltage(AnalogChannelObject o); 00051 float GetAnalogAverageVoltage(AnalogChannelObject o); 00052 00053 void SetAnalogAverageBits(AnalogChannelObject o, UINT32 bits); 00054 UINT32 GetAnalogAverageBits(AnalogChannelObject o); 00055 void SetAnalogOversampleBits(AnalogChannelObject o, UINT32 bits); 00056 UINT32 GetAnalogOversampleBits(AnalogChannelObject o); 00057 void DeleteAnalogChannel(AnalogChannelObject o); 00058 00059 #endif 00060