1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
19 #include "counter_i.h"
\r
21 /* STD container : OsAlarmSetEvent
\r
22 * OsAlarmSetEventRef: 1
\r
23 * OsAlarmSetEventTaskRef: 1
\r
26 /* STD container : OsAlarmActivateTask
\r
27 * OsAlarmActivateTaskRef: 1
\r
30 /* STD container : OsAlarmCallback
\r
31 * OsAlarmCallbackName: 1 Function Ptr
\r
34 /* STD container : OsAlarmIncrementCounter
\r
35 * OsAlarmIncrementCounterRef: 1 Ref to counter
\r
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
\r
50 * OsAlarmActivateTask: 0..1
\r
51 * OsAlarmCallback: 0..1
\r
52 * OsAlarmIncrementCounter: 0..1
\r
53 * OsAlarmSetEvent: 0..1
\r
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 {
\r
64 // Start with SetAbsAlarm()
\r
65 ALARM_AUTOSTART_ABSOLUTE,
\r
66 // Start with SetRelAlarm()
\r
67 ALARM_AUTOSTART_RELATIVE
\r
71 /* STD container : OsAlarmAutostart
\r
72 * OsAlarmAlarmTime: 1 Int
\r
73 * OsAlarmAutoStartType: 1 Int, ABSOLUTE, RELATIVE
\r
74 * OsAlarmCycleTime: 1 Int
\r
75 * OsAlarmAppModeRef: 1..*
\r
77 typedef struct OsAlarmAutostart {
\r
79 enum OsAlarmAutostartTypeType autostartType;
\r
81 AppModeType appModeRef;
\r
82 } OsAlarmAutostartType;
\r
84 /* STD container : OsAlarm
\r
85 * OsAlarmAccessionApplication: 0..* Ref to OS application
\r
86 * OsAlamCounterRef: 1 Ref to counter
\r
87 * OsAlarmAction[C] 1 Action when alarm expires
\r
88 * OsAlarmAutostart[C] 0..1 Autostart
\r
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;
\r
113 /* List of alarms connected to the same counter */
\r
114 SLIST_ENTRY(OsAlarm) alarm_list;
\r
116 #if (OS_SC1 == STD_ON)
\r
117 /* TODO: OS242, callback in scalability class 1 only..*/
\r
118 /** Missing req OS242 */
\r
124 void Os_AlarmCheck(OsCounterType *c_p);
\r
125 void Os_AlarmAutostart(void);
\r
127 #endif /*ALARM_I_H_*/
\r