bldc/firmware/src/Driver/inc/motor.h

40 lines
1.1 KiB
C
Raw Normal View History

2020-10-20 14:43:40 +00:00
/*******************************************************************************
* @file motor.h
* @author: MQjehovah mail:MQjehovah@hotmail.com
* @version 1.0.0
* @date 2020.0.20
* @brief
******************************************************************************
* @attention
*******************************************************************************/
#ifndef __MOTOR_H
#define __MOTOR_H
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_conf.h"
/* Definition ----------------------------------------------------------------*/
2020-10-20 16:30:52 +00:00
enum motor_dir
{
MOTOR_DIR_CW, //正向
MOTOR_DIR_CCW //反向
};
2020-10-20 14:43:40 +00:00
enum motor_state
{
MOTOR_STATE_STOP //停止状态
};
typedef struct _motor
{
u8 dir;
2020-10-20 16:30:52 +00:00
u8 state; //运行状态
u8 hall_position; //霍尔位置
s16 speed; //转速
2020-10-20 14:43:40 +00:00
} motor_t;
/* Exported Functions --------------------------------------------------------*/
extern motor_t motor_info;
#endif
/*********************************END OF FILE**********************************/