]> rtime.felk.cvut.cz Git - arc.git/blob - system/kernel/include/alarm_i.h
Initial commit.
[arc.git] / system / kernel / include / alarm_i.h
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16
17
18
19
20
21
22
23 #ifndef ALARM_I_H_\r
24 #define ALARM_I_H_\r
25 \r
26 #include "counter_i.h"\r
27 \r
28 struct counter_obj_s;\r
29 \r
30 typedef enum alarm_action_type_e {\r
31         ALARM_ACTION_ACTIVATETASK=0,\r
32         ALARM_ACTION_SETEVENT,\r
33         ALARM_ACTION_ALARMCALLBACK,             /* Only class 1 */\r
34         ALARM_ACTION_INCREMENTCOUNTER, /* SWS OS302 */\r
35 } alarm_action_type_t;\r
36 \r
37 \r
38 typedef struct alarm_action_s {\r
39         alarm_action_type_t type;\r
40         TaskType                        task_id;\r
41         EventMaskType           event_id;\r
42         CounterType             counter_id;\r
43 } alarm_action_t;\r
44 \r
45 typedef struct alarm_autostart_s {\r
46         _Bool  active;\r
47         uint32 alarmtime;\r
48         uint32 cycletime;\r
49         uint32 appmode_mask;\r
50 } alarm_autostart_t;\r
51 \r
52 typedef struct alarm_obj_s {\r
53 \r
54         char name[16];\r
55         /* Reference to counter */\r
56         struct counter_obj_s *counter;\r
57 \r
58         CounterType counter_id;\r
59         /* cycle, 0 = no cycle */\r
60         uint32 alarmtime;\r
61         uint32 cycletime;\r
62         uint32 appmode_mask;\r
63 \r
64         alarm_autostart_t autostart;\r
65 \r
66         uint32 app_mask;\r
67 \r
68         /* if the alarm is active or not */\r
69         _Bool active;\r
70         /* expire value */\r
71         uint32 expire_val;\r
72 \r
73 \r
74         // Action attributes when alarm expires.\r
75         alarm_action_t action;\r
76 /*\r
77         alarm_action_type_t action_type;\r
78         TaskType                        action_pid;\r
79         EventMaskType           action_event;\r
80         CounterType             action_counter;\r
81 */\r
82         /* List of alarms connected to the same counter */\r
83         SLIST_ENTRY(alarm_obj_s) alarm_list;\r
84         /* TODO: OS242, callback in scalability class 1 only..*/\r
85 #if 0\r
86         void (*cb)(void);\r
87 #endif\r
88 } alarm_obj_t;\r
89 \r
90 \r
91 \r
92 #endif /*ALARM_I_H_*/\r