?? motor.h
字號:
/****************************************Copyright (c)**************************************************/
/**
;** 西南科技大學計算機科學學院
;**
;** http://www.cs.suswt.edu.cn
;**
;** 日期: 2007/09/21
;** 描述: Motor.h 西南科技大學計算機學院CS-II型實驗板電機驅動工作程序頭文件
;** 作者:
;**
;**--------------Motor.h文件
;**------------------------------------------------------------------------------------------------------*/
/**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#ifndef _MOTOR_H_ /* avoid being incude more than once */
#define _MOTOR_H_
/************************************************
* Header file *
***********************************************/
#include"config.h"
/************************************************
* Macros *
***********************************************/
#define DCMOTOR_SWITCH 0x00800000
#define MOTOR_PINSEL 0xffffffc0 //選擇P2.19-23
#define DCMOTOR_SPEED_GRADE 0x10
#define STEP_PHASE_A 0x00400000
#define STEP_PHASE_B 0x00200000
#define STEP_PHASE_C 0x00100000
#define STEP_PHASE_D 0x00080000
#define CLOCKWISE 1
#define ANTICLOCKWISE 0
#define MOTOR_DC_ENABLE
#define MOTOR_STEP_ENABLE
/************************************************
* Function declaration *
***********************************************/
extern void MOTORDCRun(uint8 speed); //直流電機驅動函數
extern void MOTORInit(void); //電機初始化函數
extern void MOTORStepRun(uint8 speed,uint8 direction); //步進電機驅動函數
#endif
/******************************************************************************
* End of Entire File *
*****************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -