keil_examples/timer/timer.c
/******************************************************************************
** Function name:		reset_timer
**
** Descriptions:		Reset timer
**
** parameters:			timer number: 0 or 1 or 2 or 3
** Returned value:		None
** 
******************************************************************************/
Function name:         reset_timer
Descriptions:          Reset timer

timer number: 0 or 1 or 2 or 3
Returned value:                None
Function name : reset_timer Descriptions : Reset timer timer number : 0 or 1 or 2 or 3 Returned value : None
void reset_timer( uint8_t timer_num )
{
  uint32_t regVal;
  if ( timer_num == 0 )
  {
	regVal = LPC_TIM0->TCR;
	regVal |= 0x02;
	LPC_TIM0->TCR = regVal;
  }
  else if ( timer_num == 1 )
  {
	regVal = LPC_TIM1->TCR;
	regVal |= 0x02;
	LPC_TIM1->TCR = regVal;
  }
  else if ( timer_num == 2 )
  {
	regVal = LPC_TIM2->TCR;
	regVal |= 0x02;
	LPC_TIM2->TCR = regVal;
  }
  else if ( timer_num == 3 )
  {
	regVal = LPC_TIM3->TCR;
	regVal |= 0x02;
	LPC_TIM3->TCR = regVal;
  }
  return;
}
void reset_timer ( uint8_t timer_num ) { uint32_t regVal ; if ( timer_num == 0 ) { regVal = LPC_TIM0 -> TCR ; regVal |= 0x02 ; LPC_TIM0 -> TCR = regVal ; } else if ( timer_num == 1 ) { regVal = LPC_TIM1 -> TCR ; regVal |= 0x02 ; LPC_TIM1 -> TCR = regVal ; } else if ( timer_num == 2 ) { regVal = LPC_TIM2 -> TCR ; regVal |= 0x02 ; LPC_TIM2 -> TCR = regVal ; } else if ( timer_num == 3 ) { regVal = LPC_TIM3 -> TCR ; regVal |= 0x02 ; LPC_TIM3 -> TCR = regVal ; } return ; }
Function name:         reset_timer
Descriptions:          Reset timer
Function name : reset_timer Descriptions : Reset timer