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
24 * General requirements
\r
32 #include "Dem_Types.h"
\r
33 #if defined(USE_DCM)
\r
34 #include "Dcm_Types.h" /** @req DEM176.Dcm */
\r
35 #include "Dcm_Lcfg.h" /** @req DEM136.Dcm */
\r
37 //#if defined(USE_NVRam)
\r
38 #include "NvM_ConfigTypes.h" /** @req Dem147.Nvm */
\r
42 * Callback function prototypes
\r
45 // InitMonitorForEvent
\r
46 typedef Std_ReturnType (*Dem_CallbackInitMonitorForEventFncType)(Dem_InitMonitorKindType InitMonitorKind); /** @req DEM256 */
\r
48 // InitMonitorForFunction
\r
49 typedef Std_ReturnType (*Dem_CallbackInitMonitorForFunctionFncType)(void); /** @req DEM258 */
\r
51 // EventStatusChanged
\r
52 typedef Std_ReturnType (*Dem_CallbackEventStatusChangedFncType)(Dem_EventStatusExtendedType EventStatusOld, Dem_EventStatusExtendedType EventStatusNew); /** @req DEM259 */
\r
55 typedef Std_ReturnType (*Dem_CallbackDTCStatusChangedFncType)(uint8 DTCStatusOld, uint8 DTCStatusNew); /** @req DEM260 */
\r
57 // DIDServices /** @req DEM261 */
\r
58 #if defined(USE_DCM)
\r
59 typedef Std_ReturnType (*Dem_CallbackConditionCheckReadFncType)(Dcm_NegativeResponseCodeType *Nrc);
\r
60 typedef Std_ReturnType (*Dem_CallbackReadDataFncType)(uint8 *Data);
\r
61 typedef Std_ReturnType (*Dem_CallbackReadDataLength)(uint16 *DidLength);
\r
63 typedef Std_ReturnType (*Dem_CallbackConditionCheckReadFncType)(uint8 *Nrc);
\r
64 typedef Std_ReturnType (*Dem_CallbackReadDataFncType)(uint8 *Data);
\r
65 typedef Std_ReturnType (*Dem_CallbackReadDataLength)(uint16 *DidLength);
\r
68 // GetExtendedDataRecord
\r
69 typedef Std_ReturnType (*Dem_CallbackGetExtDataRecordFncType)(uint8 *ExtendedDataRecord); /** @req DEM262 */
\r
71 // GetFaultDetectionCounter
\r
72 typedef Std_ReturnType (*Dem_CallbackGetFaultDetectionCounterFncType)(sint8 *EventIdFaultDetectionCounter); /** @req DEM263 */
\r
75 typedef Std_ReturnType (*Dem_CallbackGetPIDValueFncType)(uint8 *DataValueBuffer); /** @req DEM326 */
\r
78 FF_STORAGE_CONDITION_WRONG = 0, //FF storage condition is wrong
\r
79 PREFAILED = 1, //store FF when the event status is prefailed
\r
80 FAILED = 2 //store FF when the event status is failed
\r
81 }Dem_FreezeFrameStorageConditonType; /** @req Dem001_private */
\r
87 // 10.2.25 DemEnableCondition
\r
89 boolean EnableConditionStatus; //
\r
90 // uint16 EnableConditionID; // Optional
\r
91 } Dem_EnableConditionType;
\r
93 // 10.2.30 DemExtendedDataRecordClass
\r
95 uint16 RecordNumber; // (1)
\r
96 uint16 DataSize; // (1)
\r
97 Dem_CallbackGetExtDataRecordFncType CallbackGetExtDataRecord;// (1) /** @req DEM139 */
\r
98 } Dem_ExtendedDataRecordClassType; /** @req DEM135 */
\r
100 // 10.2.13 DemExtendedDataClass
\r
102 const Dem_ExtendedDataRecordClassType *const ExtendedDataRecordClassRef[DEM_MAX_NR_OF_RECORDS_IN_EXTENDED_DATA+1]; // (1..253)
\r
103 } Dem_ExtendedDataClassType; /** @req DEM135 */
\r
105 // 10.2.8 DemPidOrDid
\r
107 Dem_CallbackConditionCheckReadFncType DidConditionCheckReadFnc; // (0..1)
\r
108 const uint16 DidIdentifier; // (0..1)
\r
109 Dem_CallbackReadDataLength DidReadDataLengthFnc; // (0..1)
\r
110 Dem_CallbackReadDataFncType DidReadFnc; // (0..1)
\r
111 const uint8 PidIndentifier; // (0..1)
\r
112 uint8 PidOrDidSize; // (1)
\r
113 boolean PidOrDidUsePort; // (1) Not used in current implementation
\r
114 Dem_CallbackGetPIDValueFncType PidReadFnc; // (0..1)
\r
116 } Dem_PidOrDidType; /** @req DEM136 */
\r
118 // 10.2.18 DemFreezeFrameClass
\r
120 Dem_FreezeFrameKindType FFKind; // (1)
\r
121 uint8 FFRecordNumber; // (1)/** @req DEM040 */
\r
122 Dem_FreezeFrameStorageConditonType FFStorageCondition;/** @req Dem001_private */
\r
123 const Dem_PidOrDidType **FFIdClassRef; // (1..255)/** @req DEM039 */
\r
124 } Dem_FreezeFrameClassType; /** @req DEM136 */
\r
127 // 10.2.4 DemIndicator
\r
129 uint16 Indicator; // (1)
\r
130 } Dem_IndicatorType; /** @req DEM129 */
\r
132 // 10.2.28 DemNvramBlockId
\r
135 //#if defined(USE_NVRam)
\r
136 const NvM_BlockDescriptorType *BlockDescriptor;/** @req FIM083 *//** @req Dem697_Conf AutoSAR 4.2.0*/
\r
139 } Dem_NvramBlockIdType;/** @req Dem147 *//** @req Dem696_Conf AutoSAR 4.2.0*/
\r
142 * DemConfigSetType types
\r
145 // 10.2.6 DemCallbackDTCStatusChanged
\r
147 Dem_CallbackDTCStatusChangedFncType CallbackDTCStatusChangedFnc; // (0..1)
\r
148 } Dem_CallbackDTCStatusChangedType; /** @req DEM140 */
\r
150 // 10.2.26 DemCallbackInitMForF
\r
152 Dem_CallbackInitMonitorForFunctionFncType CallbackInitMForF; // (0..1)
\r
153 } Dem_CallbackInitMForFType;
\r
155 // 10.2.17 DemDTCClass
\r
158 uint8 DTCFunctionalUnit; // (1)
\r
159 Dem_DTCKindType DTCKind; // (1)
\r
160 const Dem_CallbackDTCStatusChangedType *CallbackDTCStatusChanged; // (0..*)
\r
161 const Dem_CallbackInitMForFType *CallbackInitMForF; // (0..*)
\r
162 // Dem_DTCSeverityType DTCSeverity // (0..1) Optional
\r
164 } Dem_DTCClassType; /** @req DEM132 */
\r
166 // 10.2.5 DemCallbackEventStatusChanged
\r
168 Dem_CallbackEventStatusChangedFncType CallbackEventStatusChangedFnc; // (0..1)
\r
169 } Dem_CallbackEventStatusChangedType; /** @req DEM140 */
\r
171 // 10.2.27 DemCallbackInitMForE
\r
173 Dem_CallbackInitMonitorForEventFncType CallbackInitMForEFnc; // (0..1)
\r
174 } Dem_CallbackInitMforEType; /** @req DEM130 */
\r
178 Dem_IndicatorStatusType IndicatorBehaviour; // (1)
\r
179 Dem_IndicatorType *LinkedIndicator; // (1)
\r
180 } Dem_IndicatorAttributeType; /** @req DEM133 */
\r
182 // 10.2.23 DemPreDebounceMonitorInternal
\r
184 Dem_CallbackGetFaultDetectionCounterFncType CallbackGetFDCntFnc; // (1)
\r
185 } Dem_PreDebounceMonitorInternalType; /** @req DEM146 */
\r
187 // 10.2.21 DemPreDebounceCounterBased
\r
191 uint8 CountInStepSize;
\r
192 uint8 CountOutStepSize;
\r
193 } Dem_PreDebounceCounterBasedType; /** @req DEM144 */
\r
195 // 10.2.22 DemPreDebounceFrequencyBased
\r
198 } Dem_PreDebounceFrequencyBasedType;
\r
200 // 10.2.24 DemPreDebounceTimeBased
\r
203 } Dem_PreDebounceTimeBasedType;
\r
207 Dem_PreDebounceNameType PreDebounceName; // (1)
\r
209 const Dem_PreDebounceMonitorInternalType *PreDebounceMonitorInternal; // (0..1)
\r
210 const Dem_PreDebounceCounterBasedType *PreDebounceCounterBased; // (0..1)
\r
211 const Dem_PreDebounceFrequencyBasedType *PreDebounceFrequencyBased; // (0..1)
\r
212 const Dem_PreDebounceTimeBasedType *PreDebounceTimeBased; // (0..1)
\r
213 } PreDebounceAlgorithm;
\r
214 } Dem_PreDebounceAlgorithmClassType;
\r
216 // 10.2.14 DemEventClass
\r
218 boolean ConsiderPtoStatus; // (1)
\r
219 const Dem_DTCOriginType EventDestination[DEM_MAX_NR_OF_EVENT_DESTINATION+1];// (0..4)
\r
220 uint8 EventPriority; // (1)
\r
221 boolean FFPrestorageSupported; // (1)
\r
222 boolean HealingAllowed; // (1)
\r
223 Dem_OperationCycleIdType OperationCycleRef; // (1)
\r
224 Dem_OperationCycleIdType HealingCycleRef; // (1)
\r
225 uint8 HealingCycleCounter; // (0..1) Optional
\r
226 // const Dem_EnableConditionType *EnableConditionRef; // (0..*) Optional
\r
227 const Dem_PreDebounceAlgorithmClassType *PreDebounceAlgorithmClass; // (0..255) (Only 0..1 supported)
\r
228 const Dem_IndicatorAttributeType *IndicatorAttribute; // (0..255)
\r
230 } Dem_EventClassType; /** @req DEM131 */
\r
232 // 10.2.12 DemEventParameter
\r
234 uint16 EventID; // (1)
\r
235 Dem_EventKindType EventKind; // (1)
\r
236 const Dem_EventClassType *EventClass; // (1)
\r
237 const Dem_ExtendedDataClassType *ExtendedDataClassRef; // (0..1)
\r
238 const Dem_FreezeFrameClassType **FreezeFrameClassRef; //[DEM_MAX_NR_OF_CLASSES_IN_FREEZEFRAME_DATA+1]; // (0..255) (Only 0..1 supported)/** @req DEM021 */
\r
239 const Dem_CallbackInitMforEType *CallbackInitMforE; // (0..1)
\r
240 const Dem_CallbackEventStatusChangedType *CallbackEventStatusChanged;// (0..*)
\r
241 const Dem_DTCClassType *DTCClassRef; // (0..1)
\r
243 } Dem_EventParameterType; /** @req DEM130 */
\r
247 // 10.2.19 DemGroupOfDTC
\r
250 } Dem_GroupOfDtcType;
\r
252 // 10.2.10 DemOemIdClass
\r
255 } Dem_OemIdClassType; /** @req DEM141 */
\r
257 // 10.2.9 DemConfigSet
\r
259 const Dem_EventParameterType *EventParameter; // (0..65535)
\r
260 const Dem_DTCClassType *DTCClass; // (1..16777214)
\r
261 const Dem_GroupOfDtcType *GroupOfDtc; // (1.16777214)
\r
262 const Dem_OemIdClassType *OemIdClass; // (0..*)
\r
263 } Dem_ConfigSetType; /** @req DEM130 */
\r
267 const Dem_ConfigSetType *ConfigSet; // (1)
\r
271 typedef uint16 ChecksumType;
\r
273 Dem_EventIdType eventId;
\r
276 uint8 recordNumber;
\r
278 uint8 data[DEM_MAX_SIZE_FF_DATA];
\r
279 ChecksumType checksum;
\r
280 } FreezeFrameRecType;
\r
282 // Types for storing different event aging counter
\r
284 Dem_EventIdType eventId;
\r
285 uint8 agingCounter;/** @req Dem019 */
\r
286 ChecksumType checksum;
\r
290 * Make the DEM_Config visible for others.
\r
292 extern const Dem_ConfigType DEM_Config;
\r
294 #endif /*DEM_LCFG_H_*/
\r