发布网友 发布时间:2024-04-01 13:47
共1个回答
热心网友 时间:2024-07-20 15:39
#include "stepmotor.h"#includeu32 PUL_CNT; // TIM3脉冲计数vu32 step_done;vu32 run_state;#define run_state_stop 0#define run_state_acc 1#define run_state_run 2#define run_state_dec 3void STEPMOTOR_CTRL_INIT(void){ GPIO_InitTypeDef GPIO_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_OCInitTypeDef TIM_OCInitStructure;