- /* Reset timers */
- Chip_TIMER_Reset(LPC_TIMER0);
- /* 使能定时器时间相匹配时产生中断 */
- //Chip_TIMER_MatchEnableInt(LPC_TIMER0, 1);
- /* 获取定时器基本时钟速率 */
- timerBaseClock = Chip_Clock_GetAsyncSyscon_ClockRate(); //timerBaseClock=12MHZ
- /* 设置定时器0的每1秒匹配 */
- Chip_TIMER_SetMatch(LPC_TIMER0, 1, (timerBaseClock /1000 ));//上电默认
-
- //Initial state of the pin, high(1) or low(0)
- //MATn
- Chip_TIMER_ExtMatchControlSet(LPC_TIMER0, 0, TIMER_EXTMATCH_TOGGLE, 1);
|