New
This commit is contained in:
50
User/bsp/inc/bsp_step_moto.h
Normal file
50
User/bsp/inc/bsp_step_moto.h
Normal file
@@ -0,0 +1,50 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 模块名称:步进电机脉冲驱动模块
|
||||
// 文件名称:bsp_step_moto
|
||||
// 版本名称:V1.0
|
||||
// 文件说明:头文件
|
||||
// 日期时间:2018年8月23日20点37分
|
||||
// 文件作者:Jackie Chan
|
||||
// 修改记录:
|
||||
// 版本号 日期 作者 说明
|
||||
// V1.0 2018.08.23 J.C 正式发布
|
||||
//
|
||||
// 公司名称:多场低温科技有限公司
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _BSP_STEMP_MOTO_H
|
||||
#define _BSP_STEMP_MOTO_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Dir; /* 0 表示正转 1 表示反转 */
|
||||
uint32_t StepFreq; /* 步进频率 */
|
||||
uint32_t StepCount; /* 剩余步数 */
|
||||
uint32_t AllStep; /* 一次转动命令所要走的脉冲总数 */
|
||||
uint32_t CurrentStep; /* 已经走过的步数 */
|
||||
uint32_t DispStep; /* 显示走过的步数,零点搜索时候不计数 */
|
||||
uint8_t Running; /* 1表示正在旋转 0 表示停机 */
|
||||
uint8_t Pos; /* 线圈通电的相序,0-7 */
|
||||
int64_t pv_pulse; // 当前的脉冲值
|
||||
int64_t sv_pulse; // 电脑端的设定脉冲值
|
||||
int64_t prev_pv_pulse;// 上一次脉冲值,用于检测过零点
|
||||
} MOTO_T;
|
||||
|
||||
extern MOTO_T g_tMoto;
|
||||
|
||||
void bsp_InitStepMoto(void);
|
||||
void MOTO_Start(uint32_t _speed, uint8_t _dir, int32_t _stpes);
|
||||
void MOTO_ZorePos(void);
|
||||
void MOTO_Stop(void);
|
||||
void MOTO_Pause(void);
|
||||
void MOTO_ShangeSpeed(uint32_t _speed);
|
||||
uint32_t MOTO_RoudToStep(void);
|
||||
|
||||
extern MOTO_T g_tMoto;
|
||||
|
||||
#endif
|
||||
|
||||
/***************************** 安富莱电子 www.armfly.com (END OF FILE) *********************************/
|
||||
Reference in New Issue
Block a user