#ifndef __PWM_H
#define __PWM_H

#include "tim.h"

void PWM_Set_Duty(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t pulse);

// 启动所有PWM通道
void PWM_Init_All(void);
// 设置PWM占空比 (Compare范围 0-20000)
void PWM_Set_Duty(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t pulse);

void motor_left_front(int16_t duty);

void motor_left_back(int16_t duty);

void motor_right_front(int16_t duty);

void motor_right_back(int16_t duty);

void pwm_control_territory(uint16_t mode, uint16_t value);

#endif
