1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
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>.
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
14 * -------------------------------- Arctic Core ------------------------------*/
19 #include "counter_i.h"
\r
21 /* STD container : OsAlarmSetEvent
22 * OsAlarmSetEventRef: 1
23 * OsAlarmSetEventTaskRef: 1
26 /* STD container : OsAlarmActivateTask
27 * OsAlarmActivateTaskRef: 1
30 /* STD container : OsAlarmCallback
31 * OsAlarmCallbackName: 1 Function Ptr
34 /* STD container : OsAlarmIncrementCounter
35 * OsAlarmIncrementCounterRef: 1 Ref to counter
41 typedef enum alarm_action_type_e {
\r
42 ALARM_ACTION_ACTIVATETASK=0,
\r
43 ALARM_ACTION_SETEVENT,
\r
44 ALARM_ACTION_ALARMCALLBACK, /* Only class 1 */
\r
45 ALARM_ACTION_INCREMENTCOUNTER, /* SWS OS302 */
\r
46 } alarm_action_type_t;
\r
49 /* STD container : OsAlarmAction
50 * OsAlarmActivateTask: 0..1
51 * OsAlarmCallback: 0..1
52 * OsAlarmIncrementCounter: 0..1
53 * OsAlarmSetEvent: 0..1
55 typedef struct OsAlarmAction {
\r
56 alarm_action_type_t type;
\r
58 EventMaskType event_id;
\r
59 CounterType counter_id;
\r
60 } OsAlarmActionType;
\r
63 enum OsAlarmAutostartTypeType {
64 // Start with SetAbsAlarm()
65 ALARM_AUTOSTART_ABSOLUTE,
66 // Start with SetRelAlarm()
67 ALARM_AUTOSTART_RELATIVE,
71 /* STD container : OsAlarmAutostart
72 * OsAlarmAlarmTime: 1 Int
73 * OsAlarmAutoStartType: 1 Int, ABSOLUTE, RELATIVE
74 * OsAlarmCycleTime: 1 Int
75 * OsAlarmAppModeRef: 1..*
77 typedef struct OsAlarmAutostart {
79 enum OsAlarmAutostartTypeType autostartType;
\r
82 } OsAlarmAutostartType;
\r
84 /* STD container : OsAlarm
85 * OsAlarmAccessionApplication: 0..* Ref to OS application
86 * OsAlamCounterRef: 1 Ref to counter
87 * OsAlarmAction[C] 1 Action when alarm expires
88 * OsAlarmAutostart[C] 0..1 Autostart
90 typedef struct OsAlarm {
\r
92 /* Reference to counter */
\r
93 struct OsCounter *counter;
\r
95 CounterType counter_id;
\r
96 /* cycle, 0 = no cycle */
\r
99 // uint32 appmode_mask;
\r
103 /* if the alarm is active or not */
\r
107 /* Action attributes when alarm expires. */
\r
108 OsAlarmActionType action;
\r
111 const struct OsAlarmAutostart *autostartPtr;
113 /* List of alarms connected to the same counter */
\r
114 SLIST_ENTRY(OsAlarm) alarm_list;
\r
116 #if (OS_SC1 == STD_ON)
117 #warning Alarm callbacks NOT implemented
118 /* TODO: OS242, callback in scalability class 1 only..*/
124 #endif /*ALARM_I_H_*/
\r