#include <stdio.h>

typedef enum StepControl_e { M1F = 1, M1R = 2, M2F= 4, M2R = 8, M3F= 16, M3R = 32, M4F= 64, M4R = 128 } StepControl_t;


typedef struct Phases_s { 
  unsigned M1 : 2;
  unsigned M2 : 2;
  unsigned M3 : 2;
  unsigned M4 : 2;
} Phases_t;

typedef union PhaseBlock_u {
  Phases_t      solo;
  unsigned char block;
} PhaseBlock_t;

typedef struct StepperSet_s { 
  PhaseBlock_t   phases;      
  StepControl_t  stepBuffer;
} StepperSet_t;

void stepInit( StepperSet_t * this) ;
void stepmotors( StepperSet_t * this, StepControl_t these );
void SyncMotors(StepperSet_t * this);

void printBin(unsigned char this) ;
void dumpStates( PhaseBlock_t this ) ;

