没有人回复,好可怜,只好自己来了:
void timA_56_init(void)
{
timA_tick_low = timA_tick_high = 0;
PWC_Fcg2PeriphClockCmd(PWC_FCG2_PERIPH_TIMA5 | PWC_FCG2_PERIPH_TIMA6, Enable);
stc_timera_base_init_t TAsubSet = { TimeraPclkDiv16, TimeraCountModeSawtoothWave, TimeraCountDirUp, Disable, 6250-1};
TIMERA_BaseInit(TMRA_DEV_SUB, &TAsubSet); //Gen 1ms overflow
stc_timera_base_init_t TAlowSet = { TimeraPclkDiv1, TimeraCountModeSawtoothWave, TimeraCountDirUp, Disable, 65535};
TIMERA_BaseInit(TMRA_DEV_SUB, &TAlowSet); //Gen linked 16bit counter
TMRA_DEV_LOW->HCUPR_f.HCUP11 = 1; //Enable TMRA5's linked count //其实就这一个置位就好了
TIMERA_Cmd(TMRA_DEV_LOW, Enable);
TIMERA_Cmd(TMRA_DEV_SUB, Enable);
} |