/* Author Date Comment * Diego Melli 28/08/2015 * Andrea Delbuggio 28/08/2015 * Fabiana Andrade 28/08/2015 *****************************************************************************/ /** I N C L U D E S **********************************************************/ #include "system/typedefs.h" #include "user/adminModule.h" #include "user/loaderModule.h" /** D E F I N I T I O N S ****************************************************/ #ifndef STEPMOTOR_H #define STEPMOTOR_H #define STEPPER_MINOR_VERSION 0x01 //Motor Version 0.1 #define STEPPER_MAJOR_VERSION 0x00 //sentido #define STOP (byte) 0x00 #define ADELANTE (byte) 0x01 #define ATRAS (byte) 0x02 //tipo paso #define SIMPLE (byte) 0x00 #define NORMAL (byte) 0x01 #define MEDIO (byte) 0x02 //bits #define CERO (byte) 0 #define UNO (byte) 1 #define tiempoFlanco (int) 30 //phaseArray[phasetype][phaseposition][outputnumber]; //phasetype:- 0 = simple ; 1 = normal byte pasoArray[2][4]={ {0x01, 0x02, 0x04, 0x08}, {0x03, 0x06, 0x0C, 0x09} }; byte pasoMedioArray[8]={ 0x01,0x03,0x02,0x06, 0x04,0x0C, 0x08, 0x09 }; /** S T R U C T U R E S ******************************************************/ typedef union STEPPER_DATA_PACKET { byte _byte[USBGEN_EP_SIZE]; //For byte access word _word[USBGEN_EP_SIZE/2];//For word access(USBGEN_EP_SIZE msut be even) struct { enum { READ_VERSION = 0x00, SET_STEPPER = 0x01, RESET = 0xFF //backward compatibility }CMD; byte len; }; struct { unsigned :8; byte id; }; struct { unsigned :8; byte stepper_num; byte stepper_status; }; struct { unsigned :8; word word_data; }; } STEPPER_DATA_PACKET; /** P U B L I C P R O T O T Y P E S *****************************************/ #endif /* STEPMOTOR_H */