00001 #ifndef MOTOR_H 00002 #define MOTOR_H 00003 #define StepMotorIdleState 0 00004 #define StepMotorCw0State 1 00005 #define StepMotorCw1State 2 00006 #define StepMotorCw2State 3 00007 #define StepMotorCw3State 4 00008 #define StepMotorCw4State 5 00009 #define StepMotorCw5State 6 00010 #define StepMotorCw6State 7 00011 #define StepMotorCw7State 8 00012 #define StepMotorRcw0State 9 00013 #define StepMotorRcw1State 10 00014 #define StepMotorRcw2State 11 00015 #define StepMotorRcw3State 12 00016 #define High 1 00017 #define Low 0 00018 #define MotorStepTime 100 00019 00020 typedef struct STEPMOTOR_CONTROL{ 00021 unsigned char State; 00022 unsigned int Timer; 00023 }; 00024 typedef struct MOTOR_EVENT{ 00025 UCHAR HasEvent; 00026 UCHAR EventType; 00027 UCHAR RwFlag; 00028 UCHAR Data; 00029 }; 00030 extern struct STEPMOTOR_CONTROL StepMotorCtrl; 00031 extern struct MOTOR_EVENT MotorEvent; 00032 extern void F_MotorPowerOnInit(void) LargeReentrant; 00033 extern void F_MotorSvc(void) LargeReentrant; 00034 extern void F_MotorDirectionSet(INT8U Direction) LargeReentrant; 00035 extern INT8U F_MotorEventCheck(void) LargeReentrant; 00036 extern void F_MotorCommandSet(INT8U **pArgv,INT8U Argc) LargeReentrant; 00037 #endif