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_SPI_h__ 00005 #define __nFRC_2012_1_6_4_SPI_h__ 00006 00007 #include "tSystemInterface.h" 00008 00009 namespace nFPGA 00010 { 00011 namespace nFRC_2012_1_6_4 00012 { 00013 00014 class tSPI 00015 { 00016 public: 00017 tSPI(){} 00018 virtual ~tSPI(){} 00019 00020 virtual tSystemInterface* getSystemInterface() = 0; 00021 static tSPI* create(tRioStatusCode *status); 00022 00023 typedef enum 00024 { 00025 kNumSystems = 1, 00026 } tIfaceConstants; 00027 00028 typedef 00029 union{ 00030 struct{ 00031 unsigned ReceivedDataOverflow : 1; 00032 unsigned Idle : 1; 00033 }; 00034 struct{ 00035 unsigned value : 2; 00036 }; 00037 } tStatus; 00038 typedef 00039 union{ 00040 struct{ 00041 unsigned BusBitWidth : 8; 00042 unsigned ClockHalfPeriodDelay : 8; 00043 unsigned MSBfirst : 1; 00044 unsigned DataOnFalling : 1; 00045 unsigned LatchFirst : 1; 00046 unsigned LatchLast : 1; 00047 unsigned FramePolarity : 1; 00048 unsigned WriteOnly : 1; 00049 unsigned ClockPolarity : 1; 00050 }; 00051 struct{ 00052 unsigned value : 23; 00053 }; 00054 } tConfig; 00055 typedef 00056 union{ 00057 struct{ 00058 unsigned SCLK_Channel : 4; 00059 unsigned SCLK_Module : 1; 00060 unsigned MOSI_Channel : 4; 00061 unsigned MOSI_Module : 1; 00062 unsigned MISO_Channel : 4; 00063 unsigned MISO_Module : 1; 00064 unsigned SS_Channel : 4; 00065 unsigned SS_Module : 1; 00066 }; 00067 struct{ 00068 unsigned value : 20; 00069 }; 00070 } tChannels; 00071 00072 00073 00074 typedef enum 00075 { 00076 } tStatus_IfaceConstants; 00077 00078 virtual tStatus readStatus(tRioStatusCode *status) = 0; 00079 virtual bool readStatus_ReceivedDataOverflow(tRioStatusCode *status) = 0; 00080 virtual bool readStatus_Idle(tRioStatusCode *status) = 0; 00081 00082 00083 typedef enum 00084 { 00085 } tReadReceivedData_IfaceConstants; 00086 00087 virtual void strobeReadReceivedData(tRioStatusCode *status) = 0; 00088 00089 00090 typedef enum 00091 { 00092 } tConfig_IfaceConstants; 00093 00094 virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; 00095 virtual void writeConfig_BusBitWidth(unsigned char value, tRioStatusCode *status) = 0; 00096 virtual void writeConfig_ClockHalfPeriodDelay(unsigned char value, tRioStatusCode *status) = 0; 00097 virtual void writeConfig_MSBfirst(bool value, tRioStatusCode *status) = 0; 00098 virtual void writeConfig_DataOnFalling(bool value, tRioStatusCode *status) = 0; 00099 virtual void writeConfig_LatchFirst(bool value, tRioStatusCode *status) = 0; 00100 virtual void writeConfig_LatchLast(bool value, tRioStatusCode *status) = 0; 00101 virtual void writeConfig_FramePolarity(bool value, tRioStatusCode *status) = 0; 00102 virtual void writeConfig_WriteOnly(bool value, tRioStatusCode *status) = 0; 00103 virtual void writeConfig_ClockPolarity(bool value, tRioStatusCode *status) = 0; 00104 virtual tConfig readConfig(tRioStatusCode *status) = 0; 00105 virtual unsigned char readConfig_BusBitWidth(tRioStatusCode *status) = 0; 00106 virtual unsigned char readConfig_ClockHalfPeriodDelay(tRioStatusCode *status) = 0; 00107 virtual bool readConfig_MSBfirst(tRioStatusCode *status) = 0; 00108 virtual bool readConfig_DataOnFalling(tRioStatusCode *status) = 0; 00109 virtual bool readConfig_LatchFirst(tRioStatusCode *status) = 0; 00110 virtual bool readConfig_LatchLast(tRioStatusCode *status) = 0; 00111 virtual bool readConfig_FramePolarity(tRioStatusCode *status) = 0; 00112 virtual bool readConfig_WriteOnly(tRioStatusCode *status) = 0; 00113 virtual bool readConfig_ClockPolarity(tRioStatusCode *status) = 0; 00114 00115 00116 typedef enum 00117 { 00118 } tReceivedData_IfaceConstants; 00119 00120 virtual unsigned int readReceivedData(tRioStatusCode *status) = 0; 00121 00122 00123 typedef enum 00124 { 00125 } tDataToLoad_IfaceConstants; 00126 00127 virtual void writeDataToLoad(unsigned int value, tRioStatusCode *status) = 0; 00128 virtual unsigned int readDataToLoad(tRioStatusCode *status) = 0; 00129 00130 00131 typedef enum 00132 { 00133 } tReset_IfaceConstants; 00134 00135 virtual void strobeReset(tRioStatusCode *status) = 0; 00136 00137 00138 typedef enum 00139 { 00140 } tChannels_IfaceConstants; 00141 00142 virtual void writeChannels(tChannels value, tRioStatusCode *status) = 0; 00143 virtual void writeChannels_SCLK_Channel(unsigned char value, tRioStatusCode *status) = 0; 00144 virtual void writeChannels_SCLK_Module(unsigned char value, tRioStatusCode *status) = 0; 00145 virtual void writeChannels_MOSI_Channel(unsigned char value, tRioStatusCode *status) = 0; 00146 virtual void writeChannels_MOSI_Module(unsigned char value, tRioStatusCode *status) = 0; 00147 virtual void writeChannels_MISO_Channel(unsigned char value, tRioStatusCode *status) = 0; 00148 virtual void writeChannels_MISO_Module(unsigned char value, tRioStatusCode *status) = 0; 00149 virtual void writeChannels_SS_Channel(unsigned char value, tRioStatusCode *status) = 0; 00150 virtual void writeChannels_SS_Module(unsigned char value, tRioStatusCode *status) = 0; 00151 virtual tChannels readChannels(tRioStatusCode *status) = 0; 00152 virtual unsigned char readChannels_SCLK_Channel(tRioStatusCode *status) = 0; 00153 virtual unsigned char readChannels_SCLK_Module(tRioStatusCode *status) = 0; 00154 virtual unsigned char readChannels_MOSI_Channel(tRioStatusCode *status) = 0; 00155 virtual unsigned char readChannels_MOSI_Module(tRioStatusCode *status) = 0; 00156 virtual unsigned char readChannels_MISO_Channel(tRioStatusCode *status) = 0; 00157 virtual unsigned char readChannels_MISO_Module(tRioStatusCode *status) = 0; 00158 virtual unsigned char readChannels_SS_Channel(tRioStatusCode *status) = 0; 00159 virtual unsigned char readChannels_SS_Module(tRioStatusCode *status) = 0; 00160 00161 00162 typedef enum 00163 { 00164 } tClearReceivedData_IfaceConstants; 00165 00166 virtual void strobeClearReceivedData(tRioStatusCode *status) = 0; 00167 00168 00169 typedef enum 00170 { 00171 } tReceivedElements_IfaceConstants; 00172 00173 virtual unsigned short readReceivedElements(tRioStatusCode *status) = 0; 00174 00175 00176 typedef enum 00177 { 00178 } tLoad_IfaceConstants; 00179 00180 virtual void strobeLoad(tRioStatusCode *status) = 0; 00181 00182 00183 typedef enum 00184 { 00185 } tAvailableToLoad_IfaceConstants; 00186 00187 virtual unsigned short readAvailableToLoad(tRioStatusCode *status) = 0; 00188 00189 00190 00191 00192 private: 00193 tSPI(const tSPI&); 00194 void operator=(const tSPI&); 00195 }; 00196 00197 } 00198 } 00199 00200 #endif // __nFRC_2012_1_6_4_SPI_h__