Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

stgdefs.h

Go to the documentation of this file.
00001 /*
00002  * Servo To Go controller
00003  *
00004  * Copyright (c) 2000 Servo To Go Inc.
00005  * 8117 Groton Ln.
00006  * Indianapolis, IN 46260
00007  *
00008  * Version 0.1 November 1995
00009  */
00010 
00011 #ifndef _STGDEFS_H_
00012 #define _STGDEFS_H_
00013 
00014 #ifndef BOOL
00015 #define BOOL int
00016 #endif
00017 
00018 // hardware direction bit definitions
00019 #define A_DIR_BIT      0x10
00020 #define B_DIR_BIT      0x02
00021 #define C_LOW_DIR_BIT  0x01
00022 #define C_HI_DIR_BIT   0x08
00023 #define D_DIR_BIT      0x10
00024 #define D_LOW_DIR_BIT  0x01
00025 #define D_HI_DIR_BIT   0x08
00026 
00027 /* parameters to the SelectInterruptPeriod Command */
00028 #define _500_MICROSECONDS        500
00029 #define _1_MILLISECOND           1000
00030 #define _2_MILLISECONDS          2000
00031 #define _3_MILLISECONDS          3000
00032 #define _4_MILLISECONDS          4000
00033 #define _5_MILLISECONDS          5000
00034 #define _10_MILLISECONDS         10000
00035 #define _100_MILLISECONDS        100000L
00036 #define _1_SECOND                1000000L
00037 #define MAX_PERIOD               -1L
00038 
00039 #define NO_BOARD       1
00040 #define BOARD_PRESENT  0
00041 
00042 #define MODEL_NO_ID    0
00043 #define MODEL1         1
00044 #define MODEL2         2
00045 
00046 typedef union
00047 {
00048     unsigned long               all;
00049     struct {unsigned char  A, B, C, D;} port;
00050 } IO32;
00051 
00052 typedef union
00053 {
00054     long           Long;
00055     unsigned char  Byte[4];
00056 } LONGBYTE;
00057 
00058 typedef union
00059 {
00060     unsigned short                          Word;
00061     struct   {unsigned char    high, low;}  Byte;
00062 } WORDBYTE;
00063 
00064 void ServoToGoDestructor(void);
00065 void ServoToGoConstructor(unsigned short wRequestedIrq);
00066 void MotSim(void);
00067 void           Stg_Init(unsigned short wRequestedIrq, unsigned short wAdd);
00068 unsigned short BaseAddress(void);
00069 void           RawDAC(unsigned short nAxis, long lCounts);
00070 void           StartADC(unsigned short wAxis);
00071 short          SpinReadADC(unsigned short wAxis);
00072 long           ReadADC(unsigned short wAxis, short *counts);
00073 void           AutoZeroAdc(void);
00074 void           DontAutoZeroAdc(void);
00075 void           CalADC(void);
00076 void           EncoderInit(void);
00077 void           EncoderLatch(void);
00078 void           EncoderResetAddr(void);
00079 void           SetEncoderCounts(unsigned short nAxis, long lCounts);
00080 void           SelectIndexAxisWithPolarity(unsigned char byAxis, unsigned char byPol);
00081 void           SelectIndexAxis(unsigned char byAxis);
00082 void           SelectIndexOrExtLatch(unsigned char bySelectBits);
00083 void           EnableCounterLatchOnIndexOrExt(unsigned char bySelectBits);
00084 short          IndexPulse(void);
00085 unsigned short IndexPulseLatch(void);
00086 void           ResetIndexLatches(unsigned char byLatchBits);
00087 unsigned char  CurrentIRR(void);
00088 void           ResetIndexLatch(void);
00089 unsigned char  GetIndexLatches(void);
00090 unsigned char  GetSELDI(void);
00091 unsigned char  GetIDLEN(void);
00092 unsigned char  GetCNTRL0(void);
00093 unsigned char  GetCNTRL1(void);
00094 unsigned char  GetBRDTST(void);
00095 void           ResetWatchdogLatch(void);
00096 void           EncReadAll(LONGBYTE *lbEnc);
00097 unsigned long  RawDIAll(void);
00098 unsigned char  RawDIBitPort(unsigned char byBitNumber, short nPort);
00099 unsigned char  RawDIPort(short nPort);
00100 //    unsigned long  RawDIPortBit(long lPort, long lBitNumber);
00101 void           RawDOAll(unsigned long lOutBits);
00102     void           RawDOBitValPort(unsigned char byBitNumber, unsigned char bySet0or1, unsigned short nPort);
00103 void           RawDOBytePort(unsigned char byData, short nPort);
00104 void           RawDOIO32(IO32 xOutBits);
00105 void           DigitalOut1(unsigned char byData, short nPortBits);
00106 void           DigitalOut2(unsigned char byBitNumber, unsigned char bySet0or1,
00107                            unsigned short nPortBits);
00108 void           DioDirection1(unsigned short nPort, unsigned short nDirection);
00109 void           DioDirection2(const unsigned short nSwDir);
00110 void           StopTimer(void);
00111 void           StartInterrupts(void);
00112 void           IrqReset(void);
00113 void           SelectInterruptPeriod(long lPeriodSelect);
00114 void           StopInterrupts(void);
00115 unsigned short GetBoardPresence(void);
00116 unsigned short GetAxes(void);
00117 unsigned short GetIrq(void);
00118 unsigned short GetAddr(void);
00119 void           SetAddr(unsigned short add);
00120 unsigned short GetModel(void);
00121 
00122 void           Timer2Delay(unsigned short counts);
00123 void           StartTimer2TerminalCount(unsigned short count);
00124 void           StartTimer2RTI(unsigned short count);
00125 unsigned short ReadTimer2TerminalCount(void);
00126 short          PollTimer2(void);
00127 void           MaskTimer2Interrupt(void);
00128 void           UnMaskTimer2Interrupt(void);
00129 BOOL           AddressInRange(long);
00130 void                  Initialize(unsigned short wRequestedIrq);
00131 void                  SetIrq(unsigned short wRequestedIrq);
00132 unsigned short        BaseFind(void);
00133 unsigned short        BrdtstOK(unsigned short wBaseAddress);
00134 void                  SetDDir(unsigned short nSwDir);
00135 
00136 #endif   // _STGDEFS_H_

Generated on Sun Dec 2 15:27:44 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001