versadac  1
versadac - Scalable Recorder Firmware
mrp_timer.h
1 /***************************************************************************************
2  *********** Copyright 2005 Zurich University of Applied Sciences / InES **************
3  ***************************************************************************************
4  **
5  ** File : mrp_timer.h
6  **
7  ** Description : This file provides a timer
8  **
9  ***************************************************************************************
10  ** Department : Institute of Embedded Systems
11  ** Project : MRP
12  ** Modul : MRP_Timer_T
13  ** Author : Christian Schaer
14  ** Contact : scc@zhwin.ch
15  ** Date : 10.04.2006
16  ****************************** Modifications ******************************************
17  **
18  ** Date : Who : Comment :
19  ** 10.05.06 scc initial release
20  **************************************************************************************/
21 /* $Workfile:: mrp_timer.h $*/
22 /* $Revision:: 2 $*/
23 /* $Date:: 16/12/10 14:44 $*/
24 
25 #ifndef MRP_TIMER_H
26 #define MRP_TIMER_H
27 
28 
29 /***********************************************************************/
30 /*** Header Files Includes ***/
31 /***********************************************************************/
32 
33 #include "mrp_pkg.h"
34 
35 
36 /***********************************************************************/
37 /*** Definitions ***/
38 /***********************************************************************/
39 
40 
41 
42 
43 /**********************************************************************/
44 /*** class MRP_Timer_T ***/
45 /**********************************************************************/
46 
47 struct MRP_Timer_T
48 {
49  MRPBoolean enabled_; /* Indicates whether or not the timer is enabled */
50  Unsigned16 normalized_timeout_; /* Normalized value (timeout_/tick_interval_) */
51  Unsigned16 tick_interval_; /* The interval in which the timer is called */
52  Unsigned16 timeout_; /* Timeout in milliseconds */
53  Unsigned16 value_; /* The current ticks of the timer */
54 };
55 
56 
57 /********************************************/
58 /*** Constructors and destructors ***/
59 /********************************************/
60 
61 void MRP_Timer_T_Init(MRP_Timer_T* const me);
62 
63 void MRP_Timer_T_Cleanup(MRP_Timer_T* const me);
64 
65 
66 
67 /********************************************/
68 /*** public Methods ***/
69 /********************************************/
70 
72 void MRP_Timer_T_start(MRP_Timer_T* const me, Unsigned16 timeout);
73 
75 void MRP_Timer_T_stop(MRP_Timer_T* const me);
76 
79 MRPBoolean MRP_Timer_T_tick(MRP_Timer_T* const me);
80 
81 
82 #endif
83 
84 
Definition: mrp_timer.h:47