00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "extintf.h"
00028 #include "ppmc.h"
00029
00030
00031 #ifndef __GNUC__
00032 #ifndef __attribute__
00033 #define __attribute__(x)
00034 #endif
00035 #endif
00036
00037 static char __attribute__((unused)) ident[] = "$Id: extppmcmot.c,v 1.2 2001/10/23 18:07:31 wshackle Exp $";
00038
00039
00040
00041
00042 int extMotInit(const char * stuff)
00043 {
00044 return ppmcMotInit(stuff);
00045 }
00046
00047 int extMotQuit()
00048 {
00049 return ppmcMotQuit();
00050 }
00051
00052
00053 int extDacNum()
00054 {
00055 return ppmcDacNum();
00056 }
00057
00058 int extDacWrite(int dac, double volts)
00059 {
00060 return ppmcDacWrite(dac, volts);
00061 }
00062
00063 int extDacWriteAll(int max, double * volts)
00064 {
00065 return ppmcDacWriteAll(max, volts);
00066 }
00067
00068
00069 int extEncoderSetIndexModel(unsigned int model)
00070 {
00071 return ppmcEncoderSetIndexModel(model);
00072 }
00073
00074 int extEncoderNum()
00075 {
00076 return ppmcEncoderNum();
00077 }
00078
00079 int extEncoderRead(int encoder, double * counts)
00080 {
00081 return ppmcEncoderRead(encoder, counts);
00082 }
00083
00084 int extEncoderReadAll(int max, double * counts)
00085 {
00086 return ppmcEncoderReadAll(max, counts);
00087 }
00088
00089 int extEncoderResetIndex(int encoder)
00090 {
00091 return ppmcEncoderResetIndex(encoder);
00092 }
00093
00094 int extEncoderReadLatch(int encoder, int * flag)
00095 {
00096 #ifdef NO_INDEX_PULSE
00097 *flag = 1;
00098 return 0;
00099 #else
00100 return ppmcEncoderReadLatch(encoder, flag);
00101 #endif
00102 }
00103
00104 int extEncoderReadLevel(int encoder, int * flag)
00105 {
00106 return ppmcEncoderReadLevel(encoder, flag);
00107 }
00108
00109
00110
00111 int extMaxLimitSwitchRead(int axis, int * flag)
00112 {
00113 #ifdef NO_LIMIT_SWITCH
00114 *flag = 0;
00115 return 0;
00116 #else
00117 return ppmcMaxLimitSwitchRead(axis, flag);
00118 #endif
00119 }
00120
00121 int extMinLimitSwitchRead(int axis, int * flag)
00122 {
00123 #ifdef NO_LIMIT_SWITCH
00124 *flag = 0;
00125 return 0;
00126 #else
00127 return ppmcMinLimitSwitchRead(axis, flag);
00128 #endif
00129 }
00130
00131 int extHomeSwitchRead(int axis, int * flag)
00132 {
00133 #ifdef NO_HOME_SWITCH
00134 *flag = 1;
00135 return 0;
00136 #else
00137 return ppmcHomeSwitchRead(axis, flag);
00138 #endif
00139 }
00140
00141 int extAmpEnable(int axis, int enable)
00142 {
00143 return ppmcAmpEnable(axis, enable);
00144 }
00145
00146 int extAmpFault(int axis, int * fault)
00147 {
00148 return ppmcAmpFault(axis, fault);
00149 }
00150
00151 int extDioInit(const char * stuff)
00152 {
00153 return ppmcDioInit(stuff);
00154 }
00155
00156 int extDioQuit()
00157 {
00158 return ppmcDioQuit();
00159 }
00160
00161 int extDioMaxInputs()
00162 {
00163 return ppmcDioMaxInputs();
00164 }
00165
00166 int extDioMaxOutputs()
00167 {
00168 return ppmcDioMaxOutputs();
00169 }
00170
00171 int extDioRead(int index, int *value)
00172 {
00173 return ppmcDioRead(index, value);
00174 }
00175
00176 int extDioWrite(int index, int value)
00177 {
00178 return ppmcDioWrite(index, value);
00179 }
00180
00181 int extDioCheck(int index, int *value)
00182 {
00183 return ppmcDioCheck(index, value);
00184 }
00185
00186 int extDioByteRead(int index, unsigned char *byte)
00187 {
00188 return ppmcDioByteRead(index, byte);
00189 }
00190
00191 int extDioShortRead(int index, unsigned short *sh)
00192 {
00193 return ppmcDioShortRead(index, sh);
00194 }
00195
00196 int extDioWordRead(int index, unsigned int *word)
00197 {
00198 return ppmcDioWordRead(index, word);
00199 }
00200
00201 int extDioByteWrite(int index, unsigned char byte)
00202 {
00203 return ppmcDioByteWrite(index, byte);
00204 }
00205
00206 int extDioShortWrite(int index, unsigned short sh)
00207 {
00208 return ppmcDioShortWrite(index, sh);
00209 }
00210
00211 int extDioWordWrite(int index, unsigned int word)
00212 {
00213 return ppmcDioWordWrite(index, word);
00214 }
00215
00216 int extDioByteCheck(int index, unsigned char *byte)
00217 {
00218 return ppmcDioByteCheck(index, byte);
00219 }
00220
00221 int extDioShortCheck(int index, unsigned short *sh)
00222 {
00223 return ppmcDioShortCheck(index, sh);
00224 }
00225
00226 int extDioWordCheck(int index, unsigned int *word)
00227 {
00228 return ppmcDioWordCheck(index, word);
00229 }
00230
00231 int extAioInit(const char * stuff)
00232 {
00233 return ppmcAioInit(stuff);
00234 }
00235
00236 int extAioQuit()
00237 {
00238 return ppmcAioQuit();
00239 }
00240
00241 int extAioMaxInputs()
00242 {
00243 return ppmcAioMaxInputs();
00244 }
00245
00246 int extAioMaxOutputs()
00247 {
00248 return ppmcAioMaxOutputs();
00249 }
00250
00251 int extAioRead(int index, double *volts)
00252 {
00253 return ppmcAioRead(index, volts);
00254 }
00255
00256 int extAioWrite(int index, double volts)
00257 {
00258 return ppmcAioWrite(index, volts);
00259 }
00260
00261 int extAioCheck(int index, double *volts)
00262 {
00263 return ppmcAioCheck(index, volts);
00264 }