armday10专题

2024/5/27 ARMday10 PWM实验蜂鸣器发声

TIM4.c #include "tim4.h"void tim4_init(){//1.设置tim4,GPIOB时钟使能RCC->MP_AHB4ENSETR |= (0x1<<1);RCC->MP_APB1ENSETR |= (0x1<<2);//2.设置PB6引脚为复位功能GPIOB->MODER &= (~(0x3<<12));GPIOB->MODER |= (0x2<<12);//3