]> rtime.felk.cvut.cz Git - arc.git/blob - diagnostic/Dem/Dem_Lcfg.h
Updated after mcaltest run
[arc.git] / diagnostic / Dem / Dem_Lcfg.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\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
9  *\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
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 \r
17 \r
18 \r
19 \r
20 \r
21 \r
22 \r
23 /*\r
24  *  General requirements\r
25  */\r
26 /** @req DEM128 */\r
27 \r
28 \r
29 \r
30 #ifndef DEM_LCFG_H_\r
31 #define DEM_LCFG_H_\r
32 \r
33 #include "Dem_Types.h"\r
34 #if defined(USE_DCM)\r
35 #include "Dcm_Types.h"   /** @req DEM176.Dcm */\r
36 #endif\r
37 \r
38 \r
39 /*\r
40  * Callback function prototypes\r
41  */\r
42 \r
43 // InitMonitorForEvent\r
44 typedef Std_ReturnType (*Dem_CallbackInitMonitorForEventFncType)(Dem_InitMonitorKindType InitMonitorKind); /** @req DEM256 */\r
45 \r
46 // InitMonitorForFunction\r
47 typedef Std_ReturnType (*Dem_CallbackInitMonitorForFunctionFncType)(void); /** @req DEM258 */\r
48 \r
49 // EventStatusChanged\r
50 typedef Std_ReturnType (*Dem_CallbackEventStatusChangedFncType)(Dem_EventStatusExtendedType EventStatusOld, Dem_EventStatusExtendedType EventStatusNew); /** @req DEM259 */\r
51 \r
52 // DTCStatusChanged\r
53 typedef Std_ReturnType (*Dem_CallbackDTCStatusChangedFncType)(uint8 DTCStatusOld, uint8 DTCStatusNew); /** @req DEM260 */\r
54 \r
55 // DIDServices /** @req DEM261 */\r
56 #if defined(USE_DCM)\r
57 typedef Std_ReturnType (*Dem_CallbackConditionCheckReadFncType)(Dcm_NegativeResponseCodeType *Nrc);\r
58 typedef Std_ReturnType (*Dem_CallbackReadDataFncType)(uint8 *Data);\r
59 typedef Std_ReturnType (*Dem_CallbackReadDataLength)(uint16 *DidLength);\r
60 #else\r
61 typedef Std_ReturnType (*Dem_CallbackConditionCheckReadFncType)(uint8 *Nrc);\r
62 typedef Std_ReturnType (*Dem_CallbackReadDataFncType)(uint8 *Data);\r
63 typedef Std_ReturnType (*Dem_CallbackReadDataLength)(uint16 *DidLength);\r
64 #endif\r
65 \r
66 // GetExtendedDataRecord\r
67 typedef Std_ReturnType (*Dem_CallbackGetExtDataRecordFncType)(uint8 *ExtendedDataRecord); /** @req DEM262 */\r
68 \r
69 // GetFaultDetectionCounter\r
70 typedef Std_ReturnType (*Dem_CallbackGetFaultDetectionCounterFncType)(sint8 *EventIdFaultDetectionCounter); /** @req DEM263 */\r
71 \r
72 // GetPIDValue\r
73 typedef Std_ReturnType (*Dem_CallbackGetPIDValueFncType)(uint8 *DataValueBuffer); /** @req DEM326 */\r
74 \r
75 /*\r
76  * DemGeneral types\r
77  */\r
78 /** @req DEM128 */\r
79 \r
80 // 10.2.25 DemEnableCondition\r
81 typedef struct {\r
82         boolean EnableConditionStatus;          //\r
83         // uint16       EnableConditionID;              // Optional\r
84 } Dem_EnableConditionType;\r
85 \r
86 // 10.2.30 DemExtendedDataRecordClass\r
87 typedef struct {\r
88         uint16  RecordNumber;                                           // (1)\r
89         uint16  DataSize;                                                       // (1)\r
90         Dem_CallbackGetExtDataRecordFncType     CallbackGetExtDataRecord;// (1)  /** @req DEM139 */\r
91 } Dem_ExtendedDataRecordClassType; /** @req DEM135 */\r
92 \r
93 // 10.2.13 DemExtendedDataClass\r
94 typedef struct {\r
95         const Dem_ExtendedDataRecordClassType *const ExtendedDataRecordClassRef[DEM_MAX_NR_OF_RECORDS_IN_EXTENDED_DATA+1]; // (1..253)\r
96 } Dem_ExtendedDataClassType; /** @req DEM135 */\r
97 \r
98 // 10.2.8 DemPidOrDid\r
99 typedef struct {\r
100 //      boolean                                                                 PidOrDidUsePort;                        // (1) Not used in current implementation\r
101         uint8                                                                   PidOrDidSize;                           // (1)\r
102         const uint16                                                    *DidIdentifier;                         // (0..1)\r
103         Dem_CallbackConditionCheckReadFncType   DidConditionCheckReadFnc;       // (0..1)\r
104         Dem_CallbackReadDataLength                              DidReadDataLengthFnc;           // (0..1)\r
105         Dem_CallbackReadDataFncType                             DidReadFnc;                                     // (0..1)\r
106         const uint8                                                             *PidIndentifier;                        // (0..1)\r
107         Dem_CallbackGetPIDValueFncType                  PidReadFnc;                                     // (0..1)\r
108         boolean                                                                 Arc_EOL;\r
109 } Dem_PidOrDidType; /** @req DEM136 */\r
110 \r
111 // 10.2.18 DemFreezeFrameClass\r
112 typedef struct {\r
113         Dem_FreezeFrameKindType FFKind;                 // (1)\r
114         uint8                                   FFRecordNumber; // (1)\r
115         const Dem_PidOrDidType  *FFIdClassRef;  // (1..255)\r
116 } Dem_FreezeFrameClassType; /** @req DEM136 */\r
117 \r
118 // 10.2.4 DemIndicator\r
119 typedef struct {\r
120         uint16  Indicator;              // (1)\r
121 } Dem_IndicatorType; /** @req DEM129 */\r
122 \r
123 // 10.2.28 DemNvramBlockId\r
124 typedef struct {\r
125         // TODO: Fill out\r
126 } Dem_NvramBlockIdType;\r
127 \r
128 /*\r
129  * DemConfigSetType types\r
130  */\r
131 \r
132 // 10.2.6 DemCallbackDTCStatusChanged\r
133 typedef struct {\r
134         Dem_CallbackDTCStatusChangedFncType CallbackDTCStatusChangedFnc;        // (0..1)\r
135 } Dem_CallbackDTCStatusChangedType; /** @req DEM140 */\r
136 \r
137 // 10.2.26 DemCallbackInitMForF\r
138 typedef struct {\r
139         Dem_CallbackInitMonitorForFunctionFncType       CallbackInitMForF;              // (0..1)\r
140 } Dem_CallbackInitMForFType;\r
141 \r
142 // 10.2.17 DemDTCClass\r
143 typedef struct {\r
144         uint32                                                                  DTC;                                            // (1)\r
145         uint8                                                                   DTCFunctionalUnit;                      // (1)\r
146         Dem_DTCKindType                                                 DTCKind;                                        // (1)\r
147         const Dem_CallbackDTCStatusChangedType  *CallbackDTCStatusChanged;      // (0..*)\r
148         const Dem_CallbackInitMForFType                 *CallbackInitMForF;                     // (0..*)\r
149         // Dem_DTCSeverityType                                  DTCSeverity                                     // (0..1)  Optional\r
150         boolean                                                                 Arc_EOL;\r
151 } Dem_DTCClassType; /** @req DEM132 */\r
152 \r
153 // 10.2.5 DemCallbackEventStatusChanged\r
154 typedef struct {\r
155         Dem_CallbackEventStatusChangedFncType   CallbackEventStatusChangedFnc;  // (0..1)\r
156 } Dem_CallbackEventStatusChangedType; /** @req DEM140 */\r
157 \r
158 // 10.2.27 DemCallbackInitMForE\r
159 typedef struct {\r
160         Dem_CallbackInitMonitorForEventFncType  CallbackInitMForEFnc;   // (0..1)\r
161 } Dem_CallbackInitMforEType; /** @req DEM130 */\r
162 \r
163 // 10.2.15\r
164 typedef struct {\r
165         Dem_IndicatorStatusType IndicatorBehaviour;                     // (1)\r
166         Dem_IndicatorType               *LinkedIndicator;                       // (1)\r
167 } Dem_IndicatorAttributeType; /** @req DEM133 */\r
168 \r
169 // 10.2.23 DemPreDebounceMonitorInternal\r
170 typedef struct {\r
171         Dem_CallbackGetFaultDetectionCounterFncType     CallbackGetFDCntFnc;    // (1)\r
172 } Dem_PreDebounceMonitorInternalType; /** @req DEM146 */\r
173 \r
174 // 10.2.21 DemPreDebounceCounterBased\r
175 typedef struct {\r
176         boolean JumpUp;\r
177         boolean JumpDown;\r
178         uint8   CountInStepSize;\r
179         uint8   CountOutStepSize;\r
180 } Dem_PreDebounceCounterBasedType; /** @req DEM144 */\r
181 \r
182 // 10.2.22 DemPreDebounceFrequencyBased\r
183 typedef struct {\r
184         // TODO: Fill out\r
185 } Dem_PreDebounceFrequencyBasedType;\r
186 \r
187 // 10.2.24 DemPreDebounceTimeBased\r
188 typedef struct {\r
189         // TODO: Fill out\r
190 } Dem_PreDebounceTimeBasedType;\r
191 \r
192 // 10.2.20\r
193 typedef struct {\r
194         Dem_PreDebounceNameType                                         PreDebounceName;                                // (1)\r
195         union {\r
196         const Dem_PreDebounceMonitorInternalType        *PreDebounceMonitorInternal;    // (0..1)\r
197         const Dem_PreDebounceCounterBasedType           *PreDebounceCounterBased;               // (0..1)\r
198         const Dem_PreDebounceFrequencyBasedType         *PreDebounceFrequencyBased;             // (0..1)\r
199         const Dem_PreDebounceTimeBasedType                      *PreDebounceTimeBased;                  // (0..1)\r
200         } PreDebounceAlgorithm;\r
201 } Dem_PreDebounceAlgorithmClassType;\r
202 \r
203 // 10.2.14 DemEventClass\r
204 typedef struct {\r
205         boolean                                         ConsiderPtoStatus;                                                                      // (1)\r
206         const Dem_DTCOriginType         EventDestination[DEM_MAX_NR_OF_EVENT_DESTINATION+1];// (0..4)\r
207         uint8                                           EventPriority;                                                                          // (1)\r
208         boolean                                         FFPrestorageSupported;                                                          // (1)\r
209         boolean                                         HealingAllowed;                                                                         // (1)\r
210         Dem_OperationCycleIdType        OperationCycleRef;                                                                      // (1)\r
211 //      uint8                                   HealingCycleCounter;                                                                    // (0..1) Optional\r
212 //      const Dem_EnableConditionType   *EnableConditionRef;                                                    // (0..*) Optional\r
213 //      const Dem_OperationCycleTgtType *HealingCycleRef;                                                               // (0..1) Optional\r
214         const Dem_PreDebounceAlgorithmClassType *PreDebounceAlgorithmClass;                             // (0..255) (Only 0..1 supported)\r
215         const Dem_IndicatorAttributeType                *IndicatorAttribute;                                    // (0..255)\r
216 //      Dem_OEMSPecific\r
217 } Dem_EventClassType; /** @req DEM131 */\r
218 \r
219 // 10.2.12 DemEventParameter\r
220 typedef struct {\r
221         uint16                                                                          EventID;                                        // (1)\r
222         Dem_EventKindType                                                       EventKind;                                      // (1)\r
223         const Dem_EventClassType                                        *EventClass;                            // (1)\r
224         const Dem_ExtendedDataClassType                         *ExtendedDataClassRef;          // (0..1)\r
225         const Dem_FreezeFrameClassType                          *FreezeFrameClassRef;           // (0..255) (Only 0..1 supported)\r
226         const Dem_CallbackInitMforEType                         *CallbackInitMforE;                     // (0..1)\r
227         const Dem_CallbackEventStatusChangedType        *CallbackEventStatusChanged;// (0..*)\r
228         const Dem_DTCClassType                                          *DTCClassRef;                           // (0..1)\r
229         boolean                                                                         Arc_EOL;\r
230 } Dem_EventParameterType; /** @req DEM130 */\r
231 \r
232 // 10.2.19 DemGroupOfDTC\r
233 typedef struct {\r
234         // TODO: Fill out\r
235 } Dem_GroupOfDtcType;\r
236 \r
237 // 10.2.10 DemOemIdClass\r
238 typedef struct {\r
239         uint8   OemID;\r
240 } Dem_OemIdClassType; /** @req DEM141 */\r
241 \r
242 // 10.2.9 DemConfigSet\r
243 typedef struct {\r
244         const Dem_EventParameterType    *EventParameter;        // (0..65535)\r
245         const Dem_DTCClassType                  *DTCClass;                      // (1..16777214)\r
246         const Dem_GroupOfDtcType                *GroupOfDtc;            // (1.16777214)\r
247         const Dem_OemIdClassType                *OemIdClass;            // (0..*)\r
248 } Dem_ConfigSetType; /** @req DEM130 */\r
249 \r
250 // 10.2.2 Dem\r
251 typedef struct {\r
252         const Dem_ConfigSetType *ConfigSet;     //      (1)\r
253 } Dem_ConfigType;\r
254 \r
255 \r
256 /*\r
257  * Make the DEM_Config visible for others.\r
258  */\r
259 extern const Dem_ConfigType DEM_Config;\r
260 \r
261 \r
262 #endif /*DEM_LCFG_H_*/\r