#ifndef STEPPER_MOTOR_H
#define STEPPER_MOTOR_H

#include "motor_common.h"

#include "stdint.h"
#include <stdbool.h>
typedef struct {
    Motor base;  // 继承自公共结构体
} RotateMotor;


// 更新电机状态
void Update_Motor_Status(RotateMotor *motor, SpeedStatus status, uint32_t targetSpeed, uint32_t acceleration);
;

void Rotate_SetDirection(int direction);

// 使能或禁用旋转电机
void Rotate_Enable_Rotate(bool enable);

// 设置PWM频率
void Set_PWM_Frequency(uint32_t frequency);

// 梯形加速算法
void RotateMotor_Accelerate(uint32_t targetRPM, uint32_t acceleration);
//梯形减速算法
void RotateMotor_Decelerate(uint32_t currentRPM, uint32_t deceleration);


void TIM3_CH1_Init(uint16_t psc,uint16_t arr);



#endif // STEPPER_MOTOR_H
