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_Counter_h__ 00005 #define __nFRC_2012_1_6_4_Counter_h__ 00006 00007 #include "tSystemInterface.h" 00008 00009 namespace nFPGA 00010 { 00011 namespace nFRC_2012_1_6_4 00012 { 00013 00014 class tCounter 00015 { 00016 public: 00017 tCounter(){} 00018 virtual ~tCounter(){} 00019 00020 virtual tSystemInterface* getSystemInterface() = 0; 00021 static tCounter* create(unsigned char sys_index, tRioStatusCode *status); 00022 virtual unsigned char getSystemIndex() = 0; 00023 00024 00025 typedef enum 00026 { 00027 kNumSystems = 8, 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 UpSource_Channel : 4; 00044 unsigned UpSource_Module : 1; 00045 unsigned UpSource_AnalogTrigger : 1; 00046 unsigned DownSource_Channel : 4; 00047 unsigned DownSource_Module : 1; 00048 unsigned DownSource_AnalogTrigger : 1; 00049 unsigned IndexSource_Channel : 4; 00050 unsigned IndexSource_Module : 1; 00051 unsigned IndexSource_AnalogTrigger : 1; 00052 unsigned IndexActiveHigh : 1; 00053 unsigned UpRisingEdge : 1; 00054 unsigned UpFallingEdge : 1; 00055 unsigned DownRisingEdge : 1; 00056 unsigned DownFallingEdge : 1; 00057 unsigned Mode : 2; 00058 unsigned PulseLengthThreshold : 6; 00059 unsigned Enable : 1; 00060 }; 00061 struct{ 00062 unsigned value : 32; 00063 }; 00064 } tConfig; 00065 typedef 00066 union{ 00067 struct{ 00068 unsigned Period : 23; 00069 signed Count : 8; 00070 unsigned Stalled : 1; 00071 }; 00072 struct{ 00073 unsigned value : 32; 00074 }; 00075 } tTimerOutput; 00076 typedef 00077 union{ 00078 struct{ 00079 unsigned StallPeriod : 24; 00080 unsigned AverageSize : 7; 00081 unsigned UpdateWhenEmpty : 1; 00082 }; 00083 struct{ 00084 unsigned value : 32; 00085 }; 00086 } tTimerConfig; 00087 00088 00089 typedef enum 00090 { 00091 } tOutput_IfaceConstants; 00092 00093 virtual tOutput readOutput(tRioStatusCode *status) = 0; 00094 virtual bool readOutput_Direction(tRioStatusCode *status) = 0; 00095 virtual signed int readOutput_Value(tRioStatusCode *status) = 0; 00096 00097 00098 typedef enum 00099 { 00100 } tConfig_IfaceConstants; 00101 00102 virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; 00103 virtual void writeConfig_UpSource_Channel(unsigned char value, tRioStatusCode *status) = 0; 00104 virtual void writeConfig_UpSource_Module(unsigned char value, tRioStatusCode *status) = 0; 00105 virtual void writeConfig_UpSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; 00106 virtual void writeConfig_DownSource_Channel(unsigned char value, tRioStatusCode *status) = 0; 00107 virtual void writeConfig_DownSource_Module(unsigned char value, tRioStatusCode *status) = 0; 00108 virtual void writeConfig_DownSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; 00109 virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0; 00110 virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0; 00111 virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; 00112 virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0; 00113 virtual void writeConfig_UpRisingEdge(bool value, tRioStatusCode *status) = 0; 00114 virtual void writeConfig_UpFallingEdge(bool value, tRioStatusCode *status) = 0; 00115 virtual void writeConfig_DownRisingEdge(bool value, tRioStatusCode *status) = 0; 00116 virtual void writeConfig_DownFallingEdge(bool value, tRioStatusCode *status) = 0; 00117 virtual void writeConfig_Mode(unsigned char value, tRioStatusCode *status) = 0; 00118 virtual void writeConfig_PulseLengthThreshold(unsigned short value, tRioStatusCode *status) = 0; 00119 virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0; 00120 virtual tConfig readConfig(tRioStatusCode *status) = 0; 00121 virtual unsigned char readConfig_UpSource_Channel(tRioStatusCode *status) = 0; 00122 virtual unsigned char readConfig_UpSource_Module(tRioStatusCode *status) = 0; 00123 virtual bool readConfig_UpSource_AnalogTrigger(tRioStatusCode *status) = 0; 00124 virtual unsigned char readConfig_DownSource_Channel(tRioStatusCode *status) = 0; 00125 virtual unsigned char readConfig_DownSource_Module(tRioStatusCode *status) = 0; 00126 virtual bool readConfig_DownSource_AnalogTrigger(tRioStatusCode *status) = 0; 00127 virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0; 00128 virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0; 00129 virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0; 00130 virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0; 00131 virtual bool readConfig_UpRisingEdge(tRioStatusCode *status) = 0; 00132 virtual bool readConfig_UpFallingEdge(tRioStatusCode *status) = 0; 00133 virtual bool readConfig_DownRisingEdge(tRioStatusCode *status) = 0; 00134 virtual bool readConfig_DownFallingEdge(tRioStatusCode *status) = 0; 00135 virtual unsigned char readConfig_Mode(tRioStatusCode *status) = 0; 00136 virtual unsigned short readConfig_PulseLengthThreshold(tRioStatusCode *status) = 0; 00137 virtual bool readConfig_Enable(tRioStatusCode *status) = 0; 00138 00139 00140 typedef enum 00141 { 00142 } tReset_IfaceConstants; 00143 00144 virtual void strobeReset(tRioStatusCode *status) = 0; 00145 00146 00147 typedef enum 00148 { 00149 } tTimerOutput_IfaceConstants; 00150 00151 virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0; 00152 virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0; 00153 virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0; 00154 virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0; 00155 00156 00157 typedef enum 00158 { 00159 } tTimerConfig_IfaceConstants; 00160 00161 virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0; 00162 virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0; 00163 virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0; 00164 virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0; 00165 virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0; 00166 virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0; 00167 virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0; 00168 virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0; 00169 00170 00171 00172 00173 00174 private: 00175 tCounter(const tCounter&); 00176 void operator=(const tCounter&); 00177 }; 00178 00179 } 00180 } 00181 00182 #endif // __nFRC_2012_1_6_4_Counter_h__