问答

汇集网友智慧,解决技术难题

lmksz

TA的家园币:24  

  • GD32F30X timer8 timer 11初始化问题

    有哪位大佬知道,GD32F30X的系统库函数timer_init()里没有对TIMER8/TIMER11的处理,是什么原因?voidtimer_init(uint32_ttimer_periph,timer_parameter_struct*initpara){/*configurethecounterprescalervalue*/TIMER_PSC(timer_periph)=(uint16_t)initpara->prescaler;/*configurethecounterdirectionandalignedmode*/if((TIMER0==timer_periph)||(TIMER1==timer_periph)||(TIMER2==timer_periph)||(TIMER3==timer_periph)||(TIMER4==timer_periph)||(TIMER7==timer_periph)){TIMER_CTL0(timer_periph)&=~(uint32_t)(TIMER_CTL0_DIR|TIMER_CTL0_CAM);TIMER_CTL0(timer_periph)|=(uint32_t)initpara->alignedmode;TIMER_CTL0(timer_periph)|=(uint32_t)initpara->counterdirection;}/*configuretheautoreloadvalue*/TIMER_CAR(timer_periph)=(uint32_t)initpara->period;if((TIMER5!=timer_periph)&&(TIMER6!=timer_periph)){/*resettheCKDIVbit*/TIMER_CTL0(timer_periph)&=~(uint32_t)TIMER_CTL0_CKDIV;TIMER_CTL0(timer_periph)|=(uint32_t)initpara->clockdivision;}if((TIMER0==timer_periph)||(TIMER7==timer_periph)){/*configuretherepetitioncountervalue*/TIMER_CREP(timer_periph)=(uint32_t)initpara->repetitioncounter;}/*generateanupdateevent*/TIMER_SWEVG(timer_periph)|=(uint32_t)TIMER_SWEVG_UPG;}