summaryrefslogtreecommitdiffstats
path: root/doc/bsp_howto/timer.t
blob: d2d562968269b560ab16a5a1632e2d56efbd4b1a (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@c
@c  COPYRIGHT (c) 1988-1998.
@c  On-Line Applications Research Corporation (OAR).
@c  All rights reserved.
@c
@c  $Id$
@c

@chapter Timer Driver

You can program the timer driver for your own needs, but here are two uses
of it: 

@section UART'S FIFO Full Mode

The gen68340 BSP is an example of the use of the timer to support the UART
input FIFO full mode (FIFO means First In First Out and roughly means
buffer). This mode consists in the UART raising an interrupt when n
characters have been received (n is the UA RT's FIFO length). It results
in a lower interrupt processing time, but the problem is that a scanf
primitive will block on a receipt of less than n characters. The solution
is to set a timer that will check whether there are some characters
waiting in th e UART's input FIFO. The delay time has to be set carefully
otherwise high rates will be broken: 

@itemize @bullet

@item if no character was received last time the interrupt subroutine was
entered, set a long delay,

@item otherwise set the delay to the delay needed for n characters
receipt. 

@end itemize

@section Measuring RTEMS Primitives Time

RTEMS Timing Test Suite needs a timer support. You have to provide two
primitives: 



Function

Description

@example
void Timer_initialize (void)
@end example

Initialize the timer to be a counter to the microsecond.

@example
int Read_timer (void)
@end example

Returns the number of microseconds elapsed since the last call to
Timer_initialize. 

@example
rtems_status_code Empty_function (void)

return RTEMS_SUCCESSFUL;
@end example

@example
void Set_find_average_overhead (rtems_boolean find_flag)
@end example

DOES NOTHING ??????????