aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/abstractions/nasa_cfe/cfe_osal/include/osapi-os-timer.h
blob: 8082c6227ab531a50d5b48597d8cf8c021105c9f (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
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
/*
** File: osapi-os-timer.h
**
**      Copyright (c) 2004-2006, United States government as represented by the 
**      administrator of the National Aeronautics Space Administration.  
**      All rights reserved. This software was created at NASAs Goddard 
**      Space Flight Center pursuant to government contracts.
**
**      This is governed by the NASA Open Source Agreement and may be used, 
**      distributed and modified only pursuant to the terms of that agreement.
**
** Author:  Alan Cudmore - Code 582
**
** Purpose: Contains functions prototype definitions and variable declarations
**          for the OS Abstraction Layer, Timer API
**
** $Revision: 1.5 $ 
**
** $Date: 2013/07/25 10:02:20GMT-05:00 $
**
** $Log: osapi-os-timer.h  $
** Revision 1.5 2013/07/25 10:02:20GMT-05:00 acudmore 
** removed circular include "osapi.h"
** Revision 1.4 2010/11/12 12:00:19GMT-05:00 acudmore 
** replaced copyright character with (c) and added open source notice where needed.
** Revision 1.3 2010/02/01 12:38:34EST acudmore 
** Added return code to OS_TimerAPIInit
** Revision 1.2 2008/08/26 13:52:52EDT apcudmore 
** removed linux specific define
** Revision 1.1 2008/08/20 16:12:07EDT apcudmore 
** Initial revision
** Member added to project c:/MKSDATA/MKS-REPOSITORY/MKS-OSAL-REPOSITORY/src/os/inc/project.pj
** 
**  
*/

#ifndef _osapi_timer_
#define _osapi_timer_

/*
** Typedefs
*/
typedef void (*OS_TimerCallback_t)(uint32 timer_id);

typedef struct 
{
   char                name[OS_MAX_API_NAME];
   uint32              creator;
   uint32              start_time;
   uint32              interval_time;
   uint32              accuracy;

} OS_timer_prop_t;


/*
** Timer API
*/
int32  OS_TimerAPIInit     (void);

int32 OS_TimerCreate      (uint32 *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t callback_ptr);
int32 OS_TimerSet         (uint32 timer_id, uint32 start_msec, uint32 interval_msec);
int32 OS_TimerDelete      (uint32 timer_id);

int32 OS_TimerGetIdByName (uint32 *timer_id, const char *timer_name);
int32 OS_TimerGetInfo     (uint32  timer_id, OS_timer_prop_t *timer_prop);

#endif