WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 // Copyright (c) National Instruments 2008. All Rights Reserved. 00002 // Do Not Edit... this file is generated! 00003 00004 #ifndef __nFRC_2012_1_6_4_Encoder_h__ 00005 #define __nFRC_2012_1_6_4_Encoder_h__ 00006 00007 #include "tSystemInterface.h" 00008 00009 namespace nFPGA 00010 { 00011 namespace nFRC_2012_1_6_4 00012 { 00013 00014 class tEncoder 00015 { 00016 public: 00017 tEncoder(){} 00018 virtual ~tEncoder(){} 00019 00020 virtual tSystemInterface* getSystemInterface() = 0; 00021 static tEncoder* create(unsigned char sys_index, tRioStatusCode *status); 00022 virtual unsigned char getSystemIndex() = 0; 00023 00024 00025 typedef enum 00026 { 00027 kNumSystems = 4, 00028 } tIfaceConstants; 00029 00030 typedef 00031 union{ 00032 struct{ 00033 unsigned Direction : 1; 00034 signed Value : 31; 00035 }; 00036 struct{ 00037 unsigned value : 32; 00038 }; 00039 } tOutput; 00040 typedef 00041 union{ 00042 struct{ 00043 unsigned ASource_Channel : 4; 00044 unsigned ASource_Module : 1; 00045 unsigned ASource_AnalogTrigger : 1; 00046 unsigned BSource_Channel : 4; 00047 unsigned BSource_Module : 1; 00048 unsigned BSource_AnalogTrigger : 1; 00049 unsigned IndexSource_Channel : 4; 00050 unsigned IndexSource_Module : 1; 00051 unsigned IndexSource_AnalogTrigger : 1; 00052 unsigned IndexActiveHigh : 1; 00053 unsigned Reverse : 1; 00054 unsigned Enable : 1; 00055 }; 00056 struct{ 00057 unsigned value : 21; 00058 }; 00059 } tConfig; 00060 typedef 00061 union{ 00062 struct{ 00063 unsigned Period : 23; 00064 signed Count : 8; 00065 unsigned Stalled : 1; 00066 }; 00067 struct{ 00068 unsigned value : 32; 00069 }; 00070 } tTimerOutput; 00071 typedef 00072 union{ 00073 struct{ 00074 unsigned StallPeriod : 24; 00075 unsigned AverageSize : 7; 00076 unsigned UpdateWhenEmpty : 1; 00077 }; 00078 struct{ 00079 unsigned value : 32; 00080 }; 00081 } tTimerConfig; 00082 00083 00084 typedef enum 00085 { 00086 } tOutput_IfaceConstants; 00087 00088 virtual tOutput readOutput(tRioStatusCode *status) = 0; 00089 virtual bool readOutput_Direction(tRioStatusCode *status) = 0; 00090 virtual signed int readOutput_Value(tRioStatusCode *status) = 0; 00091 00092 00093 typedef enum 00094 { 00095 } tConfig_IfaceConstants; 00096 00097 virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; 00098 virtual void writeConfig_ASource_Channel(unsigned char value, tRioStatusCode *status) = 0; 00099 virtual void writeConfig_ASource_Module(unsigned char value, tRioStatusCode *status) = 0; 00100 virtual void writeConfig_ASource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; 00101 virtual void writeConfig_BSource_Channel(unsigned char value, tRioStatusCode *status) = 0; 00102 virtual void writeConfig_BSource_Module(unsigned char value, tRioStatusCode *status) = 0; 00103 virtual void writeConfig_BSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; 00104 virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0; 00105 virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0; 00106 virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; 00107 virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0; 00108 virtual void writeConfig_Reverse(bool value, tRioStatusCode *status) = 0; 00109 virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0; 00110 virtual tConfig readConfig(tRioStatusCode *status) = 0; 00111 virtual unsigned char readConfig_ASource_Channel(tRioStatusCode *status) = 0; 00112 virtual unsigned char readConfig_ASource_Module(tRioStatusCode *status) = 0; 00113 virtual bool readConfig_ASource_AnalogTrigger(tRioStatusCode *status) = 0; 00114 virtual unsigned char readConfig_BSource_Channel(tRioStatusCode *status) = 0; 00115 virtual unsigned char readConfig_BSource_Module(tRioStatusCode *status) = 0; 00116 virtual bool readConfig_BSource_AnalogTrigger(tRioStatusCode *status) = 0; 00117 virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0; 00118 virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0; 00119 virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0; 00120 virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0; 00121 virtual bool readConfig_Reverse(tRioStatusCode *status) = 0; 00122 virtual bool readConfig_Enable(tRioStatusCode *status) = 0; 00123 00124 00125 typedef enum 00126 { 00127 } tReset_IfaceConstants; 00128 00129 virtual void strobeReset(tRioStatusCode *status) = 0; 00130 00131 00132 typedef enum 00133 { 00134 } tTimerOutput_IfaceConstants; 00135 00136 virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0; 00137 virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0; 00138 virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0; 00139 virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0; 00140 00141 00142 typedef enum 00143 { 00144 } tTimerConfig_IfaceConstants; 00145 00146 virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0; 00147 virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0; 00148 virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0; 00149 virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0; 00150 virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0; 00151 virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0; 00152 virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0; 00153 virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0; 00154 00155 00156 00157 00158 00159 private: 00160 tEncoder(const tEncoder&); 00161 void operator=(const tEncoder&); 00162 }; 00163 00164 } 00165 } 00166 00167 #endif // __nFRC_2012_1_6_4_Encoder_h__