Timer_A 初始化配置 - 使用 SMCLK 分频 64 产生 62500 个时钟周期中断
void Timer_A_Init(void)\n{\n\tTimer_A_initUpModeParam htim = {0};\n\thtim.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;\n\thtim.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_64; // Divide the clock source by 64\n\thtim.timerPeriod = 62500 - 1; // Set the timer period for 62500 clock cycles\n\thtim.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_ENABLE;\n\thtim.captureCompareInterruptEnable_CCR0_CCIE = TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE;\n\thtim.timerClear = TIMER_A_DO_CLEAR;\n\thtim.startTimer = true;\n\tTimer_A_initUpMode(TIMER_A0_BASE, &htim);\n\t// Configure Timer A in up mode\n}
原文地址: https://www.cveoy.top/t/topic/p794 著作权归作者所有。请勿转载和采集!