/*******************************************************************************
|
* File Name : pwm_ctrol.h
|
* Description :
|
* Created on :
|
* Author :
|
*******************************************************************************/
|
|
#ifndef FML_PWM_CTROL_H_
|
#define FML_PWM_CTROL_H_
|
/*******************************************************************************
|
* Include Files *
|
*******************************************************************************/
|
#include "stm32h7xx_hal.h"
|
#include "stdint.h"
|
|
/*******************************************************************************
|
* Macro *
|
*******************************************************************************/
|
// PWM ���ͨ���궨�壨��������Ӳ�������ģ�
|
#define MOTOR_TIM htim3
|
#define STEERING_TIM htim3
|
|
#define MOTOR_CHANNEL TIM_CHANNEL_1 // �� TIM3_CH1
|
#define STEERING_CHANNEL TIM_CHANNEL_2 // �� TIM3_CH2
|
|
void set_all_pwm(uint16_t duty);
|
void set_pwm_left();
|
void set_pwm_right();
|
void Set_Steering_PWM(int16_t steer) ;
|
uint32_t Map(int16_t input, int16_t in_min, int16_t in_max, uint32_t out_min, uint32_t out_max);
|
void Set_Motor_PWM(int16_t speed) ;
|
void SBUS_Control_PWM(void);
|
// 直接设置脉宽(微秒),用于 failsafe 或外部直接控制
|
void Set_Steering_Pulse(uint32_t pulse_us);
|
void Set_Motor_Pulse(uint32_t pulse_us);
|
|
|
#endif
|