コード例 #1
0
/*! \brief  read the actual timer count from register
 */
uint16_t tmr_read_count(void)
{
    return tc_read_cv(TIMER, TIMER_CHANNEL_ID);
}
コード例 #2
0
ファイル: DelayFunctions.c プロジェクト: michaelnen/1404a
void delay(uint32_t us)		/* A simple implementation for a delay in us (not calibrated) */
{
	tc_start(TC1,1);
	while (tc_read_cv(TC1,1) < us*42);
	tc_stop(TC1,1);
}
コード例 #3
0
 /**************************************************************************
 The interrupt service routine.
 Reads the timer counter every time the ISR fires. Resets/restarts the clock
 and maintains a counter.
 **************************************************************************/
 void pin_edge_handler()
 {
	 timerRightWheel = tc_read_cv(TC2, 1);
	 tc_start(TC2, 1);
	 counterRightWheel++;
 }
コード例 #4
0
void delayMicroseconds(uint32_t us)		/* A simple implementation for a delay in us (not calibrated) */
{
	tc_start(TC0,0);
	while (tc_read_cv(TC0,0) < us*42);
	tc_stop(TC0,0);
}