00001 #ifndef NEWSTG_H
00002 #define NEWSTG_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __GNUC__
00016 #ifndef __attribute__
00017 #define __attribute__(x)
00018 #endif
00019 #endif
00020
00021
00022 static char __attribute__((unused)) stg_h[] = "$Id: newstg.h,v 1.3 2001/10/30 23:34:05 paul_c Exp $";
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #define DEFAULT_STG_BASE_ADDRESS 0x200
00039 extern unsigned short STG_BASE_ADDRESS;
00040
00041 #define DEFAULT_STG_IRQ 5
00042 extern int STG_IRQ;
00043
00044
00045
00046 extern int stgMotInit(const char * stuff);
00047 extern int stgMotQuit(void);
00048
00049 extern int stgDacNum(void);
00050 extern int stgDacWrite(int dac, double volts);
00051 extern int stgDacWriteAll(int max, double * volts);
00052
00053 extern int stgEncoderSetIndexModel(unsigned int model);
00054 extern int stgEncoderNum(void);
00055 extern int stgEncoderRead(int encoder, double * counts);
00056 extern int stgEncoderReadAll(int max, double * counts);
00057 extern int stgEncoderResetIndex(int encoder);
00058 extern int stgEncoderReadLatch(int encoder, int * flag);
00059 extern int stgEncoderReadLevel(int encoder, int * flag);
00060
00061 extern int stgMaxLimitSwitchRead(int axis, int * flag);
00062 extern int stgMinLimitSwitchRead(int axis, int * flag);
00063
00064 extern int stgHomeSwitchRead(int axis, int * flag);
00065
00066 extern int stgAmpEnable(int axis, int enable);
00067 extern int stgAmpFault(int axis, int * fault);
00068
00069 extern int stgDioInit(const char * stuff);
00070 extern int stgDioQuit(void);
00071
00072 extern int stgDioMaxInputs(void);
00073 extern int stgDioMaxOutputs(void);
00074 extern int stgDioRead(int index, int *value);
00075 extern int stgDioWrite(int index, int value);
00076 extern int stgDioCheck(int index, int *value);
00077 extern int stgDioByteRead(int index, unsigned char *byte);
00078 extern int stgDioShortRead(int index, unsigned short *sh);
00079 extern int stgDioWordRead(int index, unsigned int *word);
00080 extern int stgDioByteWrite(int index, unsigned char byte);
00081 extern int stgDioShortWrite(int index, unsigned short sh);
00082 extern int stgDioWordWrite(int index, unsigned int word);
00083 extern int stgDioByteCheck(int index, unsigned char *byte);
00084 extern int stgDioShortCheck(int index, unsigned short *sh);
00085 extern int stgDioWordCheck(int index, unsigned int *word);
00086
00087 extern int stgAioInit(const char * stuff);
00088 extern int stgAioQuit(void);
00089
00090 extern int stgAioMaxInputs(void);
00091 extern int stgAioMaxOutputs(void);
00092 extern int stgAioStart(int index);
00093 extern void stgAioWait(void);
00094 extern int stgAioRead(int index, double *volts);
00095 extern int stgAioWrite(int index, double volts);
00096 extern int stgAioCheck(int index, double *volts);
00097 extern int stgModel(void);
00098
00099 #endif