#ifndef __serialstepper
#define  __serialstepper

  #include "ssls2.h"  
  #include "servoArray.h"
  #include "danStuff.h"


  typedef struct  serialStepper_s {
    SSLS_t         serial;        // serial port
    servoArray_t   servos;        // information tracking for position control
    volatile char  waiting;       // op flag
    unsigned char  limitSwitches; // tracking of state for input switchess
    unsigned char  limitSerial;   // tracking if the input state changed
    unsigned char  pingCounter;   // ping mechanism
  } serialStepper_t;


  Status_t stepMotorInit        (serialStepper_t* this);
  Status_t stepMotorSetSerial   (serialStepper_t* this, char * port);
  Status_t stepMotorListen      (serialStepper_t* this);
  Status_t stepMotorQLimitUpdate(serialStepper_t* this);
  Status_t stepMotorQPing       (serialStepper_t *this);
  Status_t finishStep           (serialStepper_t* this); 
  Status_t stepMotorSync        (serialStepper_t* this);
  Status_t stepMotorSpd         (serialStepper_t* this, unsigned int speed);
  Status_t stepMotorStep        (serialStepper_t* this, unsigned int motor, int dir);
  Status_t stepMotorFini        (serialStepper_t* this);

#endif
