summaryrefslogtreecommitdiff
path: root/src/c/hardware/avr/timer/u8AVRGetTimerValues.c
blob: c542c182c0e471bfd30da8189483925f7490ebe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Function to get timer count
//
// Calling Sequence
//     u8AVRGetTimerValues(timer)
//
// Parameters
//     timer: timer whose current count is to be returned (0,1,2)
//     ***Refer datasheet for more description about timer
//              
// Description
//     This function returns the count of timer specified 
//
//
// Authors
//     Siddhesh Wani
//


#include "AVRPeripheralTimer.h"


uint8 u8AVRGetTimerValues(uint8 timer)
{
    switch(timer)
	{
		case 0:
				return TCNT0;
				
		case 1:
				break;
		case 2:
				return TCNT2;
	}	    

	return 0;
}