]> rtime.felk.cvut.cz Git - arc.git/blob - include/EcuM.h
Updated for service ports
[arc.git] / include / EcuM.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 /** @addtogroup EcuM ECU State Manager\r
17  *  @{ */\r
18 \r
19 /** @file EcuM.h\r
20  * API and type definitions for ECU State Manager.\r
21  */\r
22 \r
23 #ifndef ECUM_H_\r
24 #define ECUM_H_\r
25 \r
26 #define ECUM_MODULE_ID                  MODULE_ID_ECUM\r
27 #define ECUM_VENDOR_ID                  1\r
28 \r
29 #define ECUM_SW_MAJOR_VERSION   2\r
30 #define ECUM_SW_MINOR_VERSION   0\r
31 #define ECUM_SW_PATCH_VERSION   0\r
32 \r
33 #define ECUM_AR_MAJOR_VERSION   1\r
34 #define ECUM_AR_MINOR_VERSION   2\r
35 #define ECUM_AR_PATCH_VERSION   2\r
36 \r
37 #include "EcuM_Cfg.h"\r
38 \r
39 #if defined(USE_COM)\r
40 #include "ComStack_Types.h"\r
41 #endif\r
42 #if (ECUM_USE_SERVICE_PORTS == STD_ON) && defined(USE_RTE)\r
43 #include "Rte_Type.h"\r
44 #endif\r
45 \r
46 #include "EcuM_Types.h"\r
47 \r
48 \r
49 /** @name Error Codes */\r
50 //@{\r
51 #define ECUM_E_NOT_INITIATED (0x10)\r
52 #define ECUM_E_SERVICE_DISABLED (0x11)\r
53 #define ECUM_E_NULL_POINTER (0x12)\r
54 #define ECUM_E_INVALID_PAR (0x13)\r
55 #define ECUM_E_MULTIPLE_RUN_REQUESTS (0x14)\r
56 #define ECUM_E_MISMATCHED_RUN_RELEASE (0x15)\r
57 #define ECUM_E_STATE_PAR_OUT_OF_RANGE (0x16)\r
58 #define ECUM_E_UNKNOWN_WAKEUP_SOURCE (0x17)\r
59 #define ECUM_E_ARC_TIMERERROR (0x18)\r
60 //@}\r
61 \r
62 /** @name Service id's */\r
63 //@{\r
64 #define ECUM_REQUESTRUN_ID (0x03)\r
65 #define ECUM_RELEASERUN_ID (0x04)\r
66 #define ECUM_SELECTSHUTDOWNTARGET_ID (0x06)\r
67 #define ECUM_GETSTATE_ID (0x07)\r
68 #define ECUM_GETSHUTDOWNTARGET_ID (0x09)\r
69 #define ECUM_COMM_REQUESTRUN_ID (0x0e)\r
70 #define ECUM_REQUESTPOSTRUN_ID (0x0a)\r
71 #define ECUM_RELEASEPOSTRUN_ID (0x0b)\r
72 #define ECUM_SELECTAPPMODE_ID (0x0f)\r
73 #define ECUM_COMM_RELEASERUN_ID (0x10)\r
74 #define ECUM_GETAPPMODE_ID (0x11)\r
75 #define ECUM_SELECT_BOOTARGET_ID (0x12)\r
76 #define ECUM_GET_BOOTARGET_ID (0x13)\r
77 #define ECUM_MAINFUNCTION_ID (0x18)\r
78 #define ECUM_COMM_HASREQUESTEDRUN_ID (0x1b)\r
79 #define ECUM_ARC_STARTUPTWO_ID (0x20)\r
80 \r
81 \r
82 #define ECUM_MODULE_ID                  MODULE_ID_ECUM\r
83 #define ECUM_VENDOR_ID                  1\r
84 \r
85 #define ECUM_SW_MAJOR_VERSION   2\r
86 #define ECUM_SW_MINOR_VERSION   0\r
87 #define ECUM_SW_PATCH_VERSION   0\r
88 \r
89 #define ECUM_AR_MAJOR_VERSION   1\r
90 #define ECUM_AR_MINOR_VERSION   2\r
91 #define ECUM_AR_PATCH_VERSION   2\r
92 \r
93 #include "EcuM_Cfg.h"\r
94 \r
95 #if ( ECUM_VERSION_INFO_API == STD_ON)\r
96 #define EcuM_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,ECUM)\r
97 #endif\r
98 \r
99 void EcuM_Init( void );\r
100 void EcuM_StartupTwo(void);\r
101 void EcuM_Shutdown(void);\r
102 \r
103 Std_ReturnType EcuM_GetState(EcuM_StateType* state);\r
104 \r
105 Std_ReturnType EcuM_RequestRUN(EcuM_UserType user);\r
106 Std_ReturnType EcuM_ReleaseRUN(EcuM_UserType user);\r
107 \r
108 Std_ReturnType EcuM_RequestPOST_RUN(EcuM_UserType user);\r
109 Std_ReturnType EcuM_ReleasePOST_RUN(EcuM_UserType user);\r
110 \r
111 void EcuM_KillAllRUNRequests(void);\r
112 \r
113 #if defined(USE_COMM)\r
114 Std_ReturnType EcuM_ComM_RequestRUN(NetworkHandleType channel);\r
115 Std_ReturnType EcuM_ComM_ReleaseRUN(NetworkHandleType channel);\r
116 boolean EcuM_ComM_HasRequestedRUN(NetworkHandleType channel);\r
117 #endif\r
118 \r
119 Std_ReturnType EcuM_SelectShutdownTarget(EcuM_StateType shutdownTarget, uint8 sleepMode);\r
120 Std_ReturnType EcuM_GetShutdownTarget(EcuM_StateType* shutdownTarget, uint8* sleepMode);\r
121 Std_ReturnType EcuM_GetLastShutdownTarget(EcuM_StateType* shutdownTarget, uint8* sleepMode);\r
122 \r
123 EcuM_WakeupSourceType EcuM_GetPendingWakeupEvents(void);\r
124 void EcuM_ClearWakeupEvent(EcuM_WakeupSourceType sources);\r
125 EcuM_WakeupSourceType EcuM_GetValidatedWakeupEvents(void);\r
126 EcuM_WakeupSourceType EcuM_GetExpiredWakeupEvents(void);\r
127 EcuM_WakeupStatusType EcuM_GetStatusOfWakeupSource(EcuM_WakeupSourceType sources);\r
128 \r
129 Std_ReturnType EcuM_SelectApplicationMode(AppModeType appMode);\r
130 Std_ReturnType EcuM_GetApplicationMode(AppModeType* appMode);\r
131 \r
132 Std_ReturnType EcuM_SelectBootTarget(EcuM_BootTargetType target);\r
133 Std_ReturnType EcuM_GetBootTarget(EcuM_BootTargetType* target);\r
134 \r
135 void EcuM_MainFunction(void);\r
136 \r
137 #endif /*ECUM_H_*/\r
138 /** @} */\r