#ifndef WALKING_MOTOR_H
#define WALKING_MOTOR_H

#include "motor_common.h"
#include "stdint.h"
#include <stdbool.h>

typedef struct {
    Motor base;  // 继承自公共结构体
} WalkingMotor;

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

void Walking_SetDirection(int direction);

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

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

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


void TIM3_CH2_Init(uint16_t psc,uint16_t arr);




#endif
