LPTMR0_CSR=0x00; //LPTMR的初始化
LPTMR0_PSR=0x00;
LPTMR0_CMR=0x00;
SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK; //Turn on PORTC clock
PORTC_PCR5=PORT_PCR_MUX(0x4); //Use ALT4 on PTC5
LPTMR0_PSR|=LPTMR_PSR_PCS(0x1)|LPTMR_PSR_PBYP_MASK; //Use LDO but bypass glitch filter
LPTMR0_CMR|=LPTMR_CMR_COMPARE(compare_value); //Set compare value
LPTMR0_CSR|=LPTMR_CSR_TPS(0x2); //Set LPT to use the pin selected
LPTMR0_CSR|=LPTMR_CSR_TMS_MASK; // put in pulse count mode 上升沿捕捉
//LPTMR0_CSR|=LPTMR_CSR_TFC_MASK; //自由计数
LPTMR0_CSR&=~LPTMR_CSR_TIE_MASK; //关输入中断
LPTMR0_CSR|= LPTMR_CSR_TEN_MASK;
}