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_DIO_h__ 00005 #define __nFRC_2012_1_6_4_DIO_h__ 00006 00007 #include "tSystemInterface.h" 00008 00009 namespace nFPGA 00010 { 00011 namespace nFRC_2012_1_6_4 00012 { 00013 00014 class tDIO 00015 { 00016 public: 00017 tDIO(){} 00018 virtual ~tDIO(){} 00019 00020 virtual tSystemInterface* getSystemInterface() = 0; 00021 static tDIO* create(unsigned char sys_index, tRioStatusCode *status); 00022 virtual unsigned char getSystemIndex() = 0; 00023 00024 00025 typedef enum 00026 { 00027 kNumSystems = 2, 00028 } tIfaceConstants; 00029 00030 typedef 00031 union{ 00032 struct{ 00033 unsigned Period : 16; 00034 unsigned MinHigh : 16; 00035 }; 00036 struct{ 00037 unsigned value : 32; 00038 }; 00039 } tPWMConfig; 00040 typedef 00041 union{ 00042 struct{ 00043 unsigned RelayFwd : 8; 00044 unsigned RelayRev : 8; 00045 unsigned I2CHeader : 4; 00046 }; 00047 struct{ 00048 unsigned value : 20; 00049 }; 00050 } tSlowValue; 00051 typedef 00052 union{ 00053 struct{ 00054 unsigned Transaction : 1; 00055 unsigned Done : 1; 00056 unsigned Aborted : 1; 00057 unsigned DataReceivedHigh : 24; 00058 }; 00059 struct{ 00060 unsigned value : 27; 00061 }; 00062 } tI2CStatus; 00063 typedef 00064 union{ 00065 struct{ 00066 unsigned PeriodPower : 4; 00067 unsigned OutputSelect_0 : 4; 00068 unsigned OutputSelect_1 : 4; 00069 unsigned OutputSelect_2 : 4; 00070 unsigned OutputSelect_3 : 4; 00071 }; 00072 struct{ 00073 unsigned value : 20; 00074 }; 00075 } tDO_PWMConfig; 00076 typedef 00077 union{ 00078 struct{ 00079 unsigned Address : 8; 00080 unsigned BytesToRead : 3; 00081 unsigned BytesToWrite : 3; 00082 unsigned DataToSendHigh : 16; 00083 unsigned BitwiseHandshake : 1; 00084 }; 00085 struct{ 00086 unsigned value : 31; 00087 }; 00088 } tI2CConfig; 00089 00090 00091 typedef enum 00092 { 00093 } tI2CDataToSend_IfaceConstants; 00094 00095 virtual void writeI2CDataToSend(unsigned int value, tRioStatusCode *status) = 0; 00096 virtual unsigned int readI2CDataToSend(tRioStatusCode *status) = 0; 00097 00098 00099 typedef enum 00100 { 00101 } tDO_IfaceConstants; 00102 00103 virtual void writeDO(unsigned short value, tRioStatusCode *status) = 0; 00104 virtual unsigned short readDO(tRioStatusCode *status) = 0; 00105 00106 00107 typedef enum 00108 { 00109 kNumFilterSelectElements = 16, 00110 } tFilterSelect_IfaceConstants; 00111 00112 virtual void writeFilterSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; 00113 virtual unsigned char readFilterSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0; 00114 00115 00116 typedef enum 00117 { 00118 kNumFilterPeriodElements = 3, 00119 } tFilterPeriod_IfaceConstants; 00120 00121 virtual void writeFilterPeriod(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; 00122 virtual unsigned char readFilterPeriod(unsigned char bitfield_index, tRioStatusCode *status) = 0; 00123 00124 00125 typedef enum 00126 { 00127 } tOutputEnable_IfaceConstants; 00128 00129 virtual void writeOutputEnable(unsigned short value, tRioStatusCode *status) = 0; 00130 virtual unsigned short readOutputEnable(tRioStatusCode *status) = 0; 00131 00132 00133 typedef enum 00134 { 00135 } tSlowValue_IfaceConstants; 00136 00137 virtual void writeSlowValue(tSlowValue value, tRioStatusCode *status) = 0; 00138 virtual void writeSlowValue_RelayFwd(unsigned char value, tRioStatusCode *status) = 0; 00139 virtual void writeSlowValue_RelayRev(unsigned char value, tRioStatusCode *status) = 0; 00140 virtual void writeSlowValue_I2CHeader(unsigned char value, tRioStatusCode *status) = 0; 00141 virtual tSlowValue readSlowValue(tRioStatusCode *status) = 0; 00142 virtual unsigned char readSlowValue_RelayFwd(tRioStatusCode *status) = 0; 00143 virtual unsigned char readSlowValue_RelayRev(tRioStatusCode *status) = 0; 00144 virtual unsigned char readSlowValue_I2CHeader(tRioStatusCode *status) = 0; 00145 00146 00147 typedef enum 00148 { 00149 } tI2CStatus_IfaceConstants; 00150 00151 virtual tI2CStatus readI2CStatus(tRioStatusCode *status) = 0; 00152 virtual unsigned char readI2CStatus_Transaction(tRioStatusCode *status) = 0; 00153 virtual bool readI2CStatus_Done(tRioStatusCode *status) = 0; 00154 virtual bool readI2CStatus_Aborted(tRioStatusCode *status) = 0; 00155 virtual unsigned int readI2CStatus_DataReceivedHigh(tRioStatusCode *status) = 0; 00156 00157 00158 typedef enum 00159 { 00160 } tI2CDataReceived_IfaceConstants; 00161 00162 virtual unsigned int readI2CDataReceived(tRioStatusCode *status) = 0; 00163 00164 00165 typedef enum 00166 { 00167 } tDI_IfaceConstants; 00168 00169 virtual unsigned short readDI(tRioStatusCode *status) = 0; 00170 00171 00172 typedef enum 00173 { 00174 } tPulse_IfaceConstants; 00175 00176 virtual void writePulse(unsigned short value, tRioStatusCode *status) = 0; 00177 virtual unsigned short readPulse(tRioStatusCode *status) = 0; 00178 00179 00180 typedef enum 00181 { 00182 kNumPWMPeriodScaleElements = 10, 00183 } tPWMPeriodScale_IfaceConstants; 00184 00185 virtual void writePWMPeriodScale(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; 00186 virtual unsigned char readPWMPeriodScale(unsigned char bitfield_index, tRioStatusCode *status) = 0; 00187 00188 00189 typedef enum 00190 { 00191 kNumDO_PWMDutyCycleElements = 4, 00192 } tDO_PWMDutyCycle_IfaceConstants; 00193 00194 virtual void writeDO_PWMDutyCycle(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; 00195 virtual unsigned char readDO_PWMDutyCycle(unsigned char bitfield_index, tRioStatusCode *status) = 0; 00196 00197 00198 typedef enum 00199 { 00200 } tBFL_IfaceConstants; 00201 00202 virtual void writeBFL(bool value, tRioStatusCode *status) = 0; 00203 virtual bool readBFL(tRioStatusCode *status) = 0; 00204 00205 00206 typedef enum 00207 { 00208 } tI2CStart_IfaceConstants; 00209 00210 virtual void strobeI2CStart(tRioStatusCode *status) = 0; 00211 00212 00213 typedef enum 00214 { 00215 } tDO_PWMConfig_IfaceConstants; 00216 00217 virtual void writeDO_PWMConfig(tDO_PWMConfig value, tRioStatusCode *status) = 0; 00218 virtual void writeDO_PWMConfig_PeriodPower(unsigned char value, tRioStatusCode *status) = 0; 00219 virtual void writeDO_PWMConfig_OutputSelect_0(unsigned char value, tRioStatusCode *status) = 0; 00220 virtual void writeDO_PWMConfig_OutputSelect_1(unsigned char value, tRioStatusCode *status) = 0; 00221 virtual void writeDO_PWMConfig_OutputSelect_2(unsigned char value, tRioStatusCode *status) = 0; 00222 virtual void writeDO_PWMConfig_OutputSelect_3(unsigned char value, tRioStatusCode *status) = 0; 00223 virtual tDO_PWMConfig readDO_PWMConfig(tRioStatusCode *status) = 0; 00224 virtual unsigned char readDO_PWMConfig_PeriodPower(tRioStatusCode *status) = 0; 00225 virtual unsigned char readDO_PWMConfig_OutputSelect_0(tRioStatusCode *status) = 0; 00226 virtual unsigned char readDO_PWMConfig_OutputSelect_1(tRioStatusCode *status) = 0; 00227 virtual unsigned char readDO_PWMConfig_OutputSelect_2(tRioStatusCode *status) = 0; 00228 virtual unsigned char readDO_PWMConfig_OutputSelect_3(tRioStatusCode *status) = 0; 00229 00230 00231 typedef enum 00232 { 00233 } tPulseLength_IfaceConstants; 00234 00235 virtual void writePulseLength(unsigned char value, tRioStatusCode *status) = 0; 00236 virtual unsigned char readPulseLength(tRioStatusCode *status) = 0; 00237 00238 00239 typedef enum 00240 { 00241 } tI2CConfig_IfaceConstants; 00242 00243 virtual void writeI2CConfig(tI2CConfig value, tRioStatusCode *status) = 0; 00244 virtual void writeI2CConfig_Address(unsigned char value, tRioStatusCode *status) = 0; 00245 virtual void writeI2CConfig_BytesToRead(unsigned char value, tRioStatusCode *status) = 0; 00246 virtual void writeI2CConfig_BytesToWrite(unsigned char value, tRioStatusCode *status) = 0; 00247 virtual void writeI2CConfig_DataToSendHigh(unsigned short value, tRioStatusCode *status) = 0; 00248 virtual void writeI2CConfig_BitwiseHandshake(bool value, tRioStatusCode *status) = 0; 00249 virtual tI2CConfig readI2CConfig(tRioStatusCode *status) = 0; 00250 virtual unsigned char readI2CConfig_Address(tRioStatusCode *status) = 0; 00251 virtual unsigned char readI2CConfig_BytesToRead(tRioStatusCode *status) = 0; 00252 virtual unsigned char readI2CConfig_BytesToWrite(tRioStatusCode *status) = 0; 00253 virtual unsigned short readI2CConfig_DataToSendHigh(tRioStatusCode *status) = 0; 00254 virtual bool readI2CConfig_BitwiseHandshake(tRioStatusCode *status) = 0; 00255 00256 00257 00258 typedef enum 00259 { 00260 } tLoopTiming_IfaceConstants; 00261 00262 virtual unsigned short readLoopTiming(tRioStatusCode *status) = 0; 00263 00264 00265 typedef enum 00266 { 00267 } tPWMConfig_IfaceConstants; 00268 00269 virtual void writePWMConfig(tPWMConfig value, tRioStatusCode *status) = 0; 00270 virtual void writePWMConfig_Period(unsigned short value, tRioStatusCode *status) = 0; 00271 virtual void writePWMConfig_MinHigh(unsigned short value, tRioStatusCode *status) = 0; 00272 virtual tPWMConfig readPWMConfig(tRioStatusCode *status) = 0; 00273 virtual unsigned short readPWMConfig_Period(tRioStatusCode *status) = 0; 00274 virtual unsigned short readPWMConfig_MinHigh(tRioStatusCode *status) = 0; 00275 00276 00277 00278 typedef enum 00279 { 00280 kNumPWMValueRegisters = 10, 00281 } tPWMValue_IfaceConstants; 00282 00283 virtual void writePWMValue(unsigned char reg_index, unsigned char value, tRioStatusCode *status) = 0; 00284 virtual unsigned char readPWMValue(unsigned char reg_index, tRioStatusCode *status) = 0; 00285 00286 00287 00288 private: 00289 tDIO(const tDIO&); 00290 void operator=(const tDIO&); 00291 }; 00292 00293 } 00294 } 00295 00296 #endif // __nFRC_2012_1_6_4_DIO_h__