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

extsmmot.c File Reference

#include "extintf.h"
#include "parport.h"
#include "emcmot.h"

Include dependency graph for extsmmot.c:

Include dependency graph

Go to the source code of this file.

Defines

#define STEPPER_MAX   6

Functions

char __attribute__ ((unused)) ident[]="$Id
int extMotQuit ()
int extDacNum ()
int extDacWrite (int dac, double volts)
int extDacWriteAll (int max, double *volts)
int extEncoderSetIndexModel (unsigned int model)
int extEncoderNum ()
int extEncoderRead (int encoder, double *counts)
int extEncoderReadAll (int max, double *counts)
int extEncoderResetIndex (int encoder)
int extEncoderReadLatch (int encoder, int *flag)
int extEncoderReadLevel (int encoder, int *flag)
int extAmpEnable (int axis, int enable)
int extAmpFault (int axis, int *fault)
int extMaxLimitSwitchRead (int axis, int *flag)
int extMinLimitSwitchRead (int axis, int *flag)
int extHomeSwitchRead (int axis, int *flag)


Define Documentation

#define STEPPER_MAX   6
 


Function Documentation

char __attribute__ (unused)    [static]
 

Definition at line 37 of file extsmmot.c.

00037                                                    : extsmmot.c,v 1.4 2001/05/14 18:35:06 wshackle Exp $";
00038 
00039 #define STEPPER_MAX 6           /* can only handle 6 motors */
00040 
00041 /*
00042    FIXME-- declaration for global in emcmot, used in the encoder
00043    read function. Is there a better way to do this?
00044 */
00045 extern EMCMOT_DEBUG *emcmotDebug;
00046 
00047 int extMotInit(const char * stuff)
00048 {
00049   if (0 != pptDioInit(0)) {
00050     return -1;
00051   }
00052 
00053   return 0;
00054 }

int extAmpEnable int    axis,
int    enable
 

Definition at line 132 of file extsmmot.c.

00133 {
00134   return 0;
00135 }

int extAmpFault int    axis,
int *    fault
 

Definition at line 137 of file extsmmot.c.

00138 {
00139   return 0;
00140 }

int extDacNum void   
 

Definition at line 61 of file extsmmot.c.

00062 {
00063   return 0;
00064 }

int extDacWrite int    dac,
double    volts
 

Definition at line 66 of file extsmmot.c.

00067 {
00068   return 0;
00069 }

int extDacWriteAll int    max,
double *    volts
 

Definition at line 71 of file extsmmot.c.

00072 {
00073   return 0;
00074 }

int extEncoderNum void   
 

Definition at line 81 of file extsmmot.c.

00082 {
00083   return 0;
00084 }

int extEncoderRead int    encoder,
double *    counts
 

Definition at line 86 of file extsmmot.c.

00087 {
00088   if (encoder < 0 ||
00089       encoder >= STEPPER_MAX) {
00090     *counts = 0.0;
00091   }
00092   else {
00093     *counts = (double) emcmotDebug->stepperCount[encoder];
00094   }
00095 
00096   return 0;
00097 }

int extEncoderReadAll int    max,
double *    counts
 

Definition at line 99 of file extsmmot.c.

00100 {
00101   int t;
00102 
00103   for (t = 0; t < max; t++) {
00104     if (t >= STEPPER_MAX) {
00105       counts[t] = 0.0;
00106     }
00107     else {
00108       counts[t] = (double) emcmotDebug->stepperCount[t];
00109     }
00110   }
00111 
00112   return 0;
00113 }

int extEncoderReadLatch int    encoder,
int *    flag
 

Definition at line 120 of file extsmmot.c.

00121 {
00122   *flag = 1;                    /* always on "index pulse" */
00123 
00124   return 0;
00125 }

int extEncoderReadLevel int    encoder,
int *    flag
 

Definition at line 127 of file extsmmot.c.

00128 {
00129   return 0;
00130 }

int extEncoderResetIndex int    encoder
 

Definition at line 115 of file extsmmot.c.

00116 {
00117   return 0;
00118 }

int extEncoderSetIndexModel unsigned int    model
 

Definition at line 76 of file extsmmot.c.

00077 {
00078   return 0;
00079 }

int extHomeSwitchRead int    axis,
int *    flag
 

Definition at line 177 of file extsmmot.c.

00178 {
00179   if (axis < 0 || axis > STEPPER_MAX) {
00180     *flag = 0;
00181     return 0;
00182   }
00183 
00184   pptDioRead(2, flag);
00185 
00186   return 0;
00187 }

int extMaxLimitSwitchRead int    axis,
int *    flag
 

Definition at line 153 of file extsmmot.c.

00154 {
00155   if (axis < 0 || axis >= STEPPER_MAX) {
00156     *flag = 0;
00157     return 0;
00158   }
00159 
00160   pptDioRead(0, flag);
00161 
00162   return 0;
00163 }

int extMinLimitSwitchRead int    axis,
int *    flag
 

Definition at line 165 of file extsmmot.c.

00166 {
00167   if (axis < 0 || axis >= STEPPER_MAX) {
00168     *flag = 0;
00169     return 0;
00170   }
00171 
00172   pptDioRead(1, flag);
00173 
00174   return 0;
00175 }

int extMotQuit void   
 

Definition at line 56 of file extsmmot.c.

00057 {
00058   return pptDioQuit();
00059 }


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