]> rtime.felk.cvut.cz Git - arc.git/blob - include/Dem.h
EcuM: Added more on the statemachine
[arc.git] / include / Dem.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 #ifndef DEM_H_\r
24 #define DEM_H_\r
25 \r
26 #define DEM_MODULE_ID                   MODULE_ID_DEM\r
27 #define DEM_VENDOR_ID                   1\r
28 \r
29 #define DEM_SW_MAJOR_VERSION    1\r
30 #define DEM_SW_MINOR_VERSION    0\r
31 #define DEM_SW_PATCH_VERSION    0\r
32 #define DEM_AR_MAJOR_VERSION    3\r
33 #define DEM_AR_MINOR_VERSION    0\r
34 #define DEM_AR_PATCH_VERSION    1\r
35 \r
36 /** @req DCM067.Cfg-files */\r
37 #include "Dem_Types.h"\r
38 #include "Dem_Cfg.h"\r
39 #include "Dem_Lcfg.h"\r
40 #include "Dem_IntErrId.h" /** @req DEM115 */\r
41 #include "Dem_IntEvtId.h"\r
42 /** @req DEM153 */ /** @req DEM154 */ /* Realized in Dem_IntErrId.h and Dem_IntEvtId.h */\r
43 // #include "Rte_Dem.h"\r
44 \r
45 \r
46 #if (DEM_DEV_ERROR_DETECT == STD_ON)\r
47 // Error codes reported by this module defined by AUTOSAR /** @req DEM116 */ /** @req DEM173 */\r
48 #define DEM_E_PARAM_CONFIG                                      0x10\r
49 #define DEM_E_PARAM_ADDRESS                                     0x11\r
50 #define DEM_E_PARAM_DATA                                        0x12\r
51 #define DEM_E_PARAM_LENGTH                                      0x13\r
52 #define DEM_E_UNINIT                                            0x20\r
53 #define DEM_E_NODATAAVAILABLE                           0x30\r
54 \r
55 // Other error codes reported by this module\r
56 #define DEM_E_CONFIG_PTR_INVALID                        0x40\r
57 #define DEM_E_EVENT_STATUS_BUFF_FULL            0x41\r
58 #define DEM_E_EXT_DATA_TOO_BIG                          0x42\r
59 #define DEM_E_PRE_INIT_EXT_DATA_BUFF_FULL       0x43\r
60 #define DEM_E_PRI_MEM_EVENT_BUFF_FULL           0x44\r
61 #define DEM_E_PRI_MEM_EXT_DATA_BUFF_FULL        0x45\r
62 \r
63 #define DEM_E_UNEXPECTED_EXECUTION                      0xfe\r
64 #define DEM_E_NOT_IMPLEMENTED_YET                       0xff\r
65 \r
66 // Service ID in this module\r
67 #define DEM_PREINIT_ID                                                  0x01\r
68 #define DEM_INIT_ID                                                             0x02\r
69 #define DEM_SHUTDOWN_ID                                                 0x03\r
70 #define DEM_SETEVENTSTATUS_ID                                   0x04\r
71 #define DEM_RESETEVENTSTATUS_ID                                 0x05\r
72 #define DEM_SETOPERATIONCYCLESTATE_ID                   0x08\r
73 #define DEM_GETEVENTSTATUS_ID                                   0x0A\r
74 #define DEM_GETEVENTFAILED_ID                                   0x0B\r
75 #define DEM_GETEVENTTESTED_ID                                   0x0C\r
76 #define DEM_GETDTCOFEVENT_ID                                    0x0D\r
77 #define DEM_REPORTERRORSTATUS_ID                                0x0F\r
78 #define DEM_SETDTCFILTER_ID                                             0x13\r
79 #define DEM_GETSTATUSOFDTC_ID                                   0x15\r
80 #define DEM_GETDTCSTATUSAVAILABILITYMASK_ID             0x16\r
81 #define DEM_GETNUMBEROFFILTEREDDTC_ID                   0x17\r
82 #define DEM_GETNEXTFILTEREDDTC_ID                               0x18\r
83 #define DEM_GETEXTENDEDDATARECORDBYDTC_ID               0x20\r
84 #define DEM_GETSIZEOFEXTENDEDDATARECORDBYDTC_ID 0x21\r
85 #define DEM_CLEARDTC_ID                                                 0x22\r
86 #define DEM_DISABLEDTCSTORAGE_ID                                0x24\r
87 #define DEM_ENABLEDTCSTORAGE_ID                                 0x25\r
88 #define DEM_GETTRANSLATIONTYPE_ID                               0x3c\r
89 #define DEM_GETFAULTDETECTIONCOUNTER_ID                 0x3E\r
90 #define DEM_MAINFUNCTION_ID                                             0x55\r
91 \r
92 #define DEM_UPDATE_EVENT_STATUS_ID                              0x80\r
93 #define DEM_MERGE_EVENT_STATUS_ID                               0x81\r
94 #define DEM_GET_EXTENDED_DATA_ID                                0x82\r
95 #define DEM_STORE_EXT_DATA_PRE_INIT_ID                  0x83\r
96 #define DEM_STORE_EVENT_PRI_MEM_ID                              0x84\r
97 #define DEM_STORE_EXT_DATA_PRI_MEM_ID                   0x85\r
98 #define DEM_PREDEBOUNCE_NONE_ID                                 0x86\r
99 #define DEM_PREDEBOUNCE_COUNTER_BASED_ID                0x87\r
100 #define DEM_GLOBAL_ID                                                   0xff\r
101 \r
102 #endif\r
103 \r
104 \r
105 /*\r
106  * Interface for upper layer modules (8.3.1)\r
107  */\r
108 #if ( DEM_VERSION_INFO_API == STD_ON ) /** @req DEM111 */\r
109 #define Dem_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,DEM) /** @req DEM177 */ /** @req DEM110 */ /** @req DEM178 */\r
110 #endif /* DEM_VERSION_INFO_API */\r
111 \r
112 /*\r
113  * Interface ECU State Manager <-> DEM (8.3.2)\r
114  */\r
115 void Dem_PreInit( void ); /** @req DEM179 */\r
116 void Dem_Init( void ); /** @req DEM181 */\r
117 void Dem_Shutdown( void ); /** @req DEM182 */\r
118 \r
119 \r
120 /*\r
121  * Interface for basic software scheduler\r
122  */\r
123 void Dem_MainFunction( void ); /** @req DEM266 */\r
124 \r
125 \r
126 /*\r
127  * Interface SW-Components via RTE <-> DEM (8.3.3)\r
128  */\r
129 Std_ReturnType Dem_SetEventStatus(Dem_EventIdType eventId, uint8 eventStatus); /** @req DEM183 */\r
130 Std_ReturnType Dem_ResetEventStatus(Dem_EventIdType eventId); /** @req DEM185 */\r
131 Std_ReturnType Dem_GetEventStatus(Dem_EventIdType eventId, Dem_EventStatusExtendedType *eventStatusExtended); /** @req DEM195 */\r
132 Std_ReturnType Dem_GetEventFailed(Dem_EventIdType eventId, boolean *eventFailed); /** @req DEM196 */\r
133 Std_ReturnType Dem_GetEventTested(Dem_EventIdType eventId, boolean *eventTested); /** @req DEM197 */\r
134 Std_ReturnType Dem_GetFaultDetectionCounter(Dem_EventIdType eventId, sint8 *counter); /** @req DEM203 */\r
135 Std_ReturnType Dem_SetOperationCycleState(Dem_OperationCycleIdType operationCycleId, Dem_OperationCycleStateType cycleState); /** @req DEM194 */\r
136 Std_ReturnType Dem_GetDTCOfEvent(Dem_EventIdType eventId, Dem_DTCKindType dtcKind, uint32* dtcOfEvent); /** @req DEM198 */\r
137 \r
138 \r
139 /*\r
140  * Interface BSW-Components <-> DEM (8.3.4)\r
141  */\r
142 void Dem_ReportErrorStatus(Dem_EventIdType eventId ,uint8 eventStatus); /** @req DEM206 */\r
143 \r
144 \r
145 /*\r
146  * Interface DCM <-> DEM (8.3.5)\r
147  */\r
148 Dem_ReturnClearDTCType Dem_ClearDTC(uint32 dtc, Dem_DTCKindType dtcKind, Dem_DTCOriginType dtcOrigin); /** @req DEM241 */\r
149 Dem_ReturnSetDTCFilterType Dem_SetDTCFilter(uint8 dtcStatusMask, Dem_DTCKindType dtcKind, Dem_DTCOriginType dtcOrigin, Dem_FilterWithSeverityType filterWithSeverity, Dem_DTCSeverityType dtcSeverityMask, Dem_FilterForFDCType filterForFaultDetectionCounter);  /** @req DEM208 */\r
150 Dem_ReturnGetStatusOfDTCType Dem_GetStatusOfDTC(uint32 dtc, Dem_DTCKindType dtcKind, Dem_DTCOriginType dtcOrigin, Dem_EventStatusExtendedType* status); /** @req DEM212 */\r
151 Std_ReturnType Dem_GetDTCStatusAvailabilityMask(uint8 *dtcStatusMask); /** @req DEM213 */\r
152 Dem_ReturnGetNumberOfFilteredDTCType Dem_GetNumberOfFilteredDtc(uint16* numberOfFilteredDTC); /** @req DEM214 */\r
153 Dem_ReturnGetNextFilteredDTCType Dem_GetNextFilteredDTC(uint32* dtc, Dem_EventStatusExtendedType* dtcStatus); /** @req DEM215 */\r
154 Dem_ReturnTypeOfDtcSupportedType Dem_GetTranslationType(void); /** @req DEM230 */\r
155 Dem_ReturnControlDTCStorageType Dem_DisableDTCStorage(Dem_DTCGroupType dtcGroup, Dem_DTCKindType dtcKind); /** @req DEM242 */\r
156 Dem_ReturnControlDTCStorageType Dem_EnableDTCStorage(Dem_DTCGroupType dtcGroup, Dem_DTCKindType dtcKind); /** @req DEM243 */\r
157 Dem_ReturnGetExtendedDataRecordByDTCType Dem_GetExtendedDataRecordByDTC(uint32 dtc, Dem_DTCKindType dtcKind, Dem_DTCOriginType dtcOrigin, uint8 extendedDataNumber, uint8 *destBuffer, uint16 *bufSize); /** @req DEM239 */\r
158 Dem_ReturnGetSizeOfExtendedDataRecordByDTCType Dem_GetSizeOfExtendedDataRecordByDTC(uint32 dtc, Dem_DTCKindType dtcKind, Dem_DTCOriginType dtcOrigin, uint8 extendedDataNumber, uint16 *sizeOfExtendedDataRecord); /** @req DEM240 */\r
159 \r
160 \r
161 \r
162 /*\r
163  * OBD-specific Interfaces (8.3.6)\r
164  */\r
165 \r
166 #endif /*DEM_H_*/\r