STM32F1的SPWM逆变器源码
代码说明:
#include "SPWM.h" #include "led.h" #include "usart.h" u16 TimerPeriod = 7200; u16 DutyFactor = 50; void TIM_Int_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; NVIC_InitTypeDef NVIC_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4 | RCC_APB1Periph_TIM3,ENABLE); //时钟使能 /* GPIOA配置:通道PA.6和PA.7作为输出引脚*/ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; &nbs
下载说明:请别用迅雷下载,失败请重下,重下不扣分!