Exemple #1
0
/*
 * you want to use this!
 */
int calcwindspeed(){

	int curtick = 0;
	int speed = 0;
	disable_gpio_irq(2,13);


	curtick = cnttick;
	cnttick = 0;
	float div = Chip_TIMER_ReadCount(LPC_TIMER2)/ticksPerSecond;

	Chip_TIMER_Reset(LPC_TIMER2);
	enable_gpio_irq(2,13);
	DBG("div:%f count:%d\n",div,curtick);

	speed =  curtick*(2.25/(div))*1.609344*100; //mph to km/h to 100m/h
	return speed;
}
Exemple #2
0
/* Start a stopwatch */
uint32_t StopWatch_Start(void)
{
	/* Return the current timer count. */
	return Chip_TIMER_ReadCount(LPC_TIMER32_1);
}
Exemple #3
0
uint32_t Board_TIMER_GetTimerCounter(uint8_t timerNum)
{
	return Chip_TIMER_ReadCount(getTimerFomIndex(timerNum));
}
Exemple #4
0
uint32 usecs() {
  return Chip_TIMER_ReadCount(SYS_CLOCK_TIMER32);
}
Exemple #5
0
uint32_t Timer_ReadCount(uint8_t timerNumber){
	return Chip_TIMER_ReadCount(timer_sd[timerNumber].name);

}