本帖最后由 sky_42959069 于 2021-11-17 11:12 编辑
SYS->GPA_MFP&=~(SYS_GPA_MFP_PA14_Msk|SYS_GPA_MFP_PA15_Msk);
SYS->GPA_MFP|=(SYS_GPA_MFP_PA14_PWM0_CH2|SYS_GPA_MFP_PA15_PWM0_CH3);//PA14 PA15 用于PW0-CH2 CH3 //引脚设置
void PWM_Init(void)
{
PWM_ConfigOutputChannel(PWM0,2,20000,0);
PWM_ConfigOutputChannel(PWM0,3,20000,0);
PWM_EnableOutput(PWM0,PWM_CH_2_MASK);
PWM_EnableOutput(PWM0,PWM_CH_3_MASK);
PWM_EnablePeriodInt(PWM0,2,0);
PWM_EnablePeriodInt(PWM0,3,0);
NVIC_EnableIRQ(PWM0_IRQn);
}
//初始化
请大神们帮忙看下,初次玩新唐请多关照!
|