]> rtime.felk.cvut.cz Git - arc.git/blob - include/LinSM.h
EcuM: More SchM,Gpt stuff
[arc.git] / include / LinSM.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 LINSM_H_\r
24 #define LINSM_H_\r
25 \r
26 #define LINSM_SW_MAJOR_VERSION    1\r
27 #define LINSM_SW_MINOR_VERSION    0\r
28 #define LINSM_SW_PATCH_VERSION    0\r
29 #define LINSM_AR_MAJOR_VERSION    1\r
30 #define LINSM_AR_MINOR_VERSION    0\r
31 #define LINSM_AR_PATCH_VERSION    1\r
32 \r
33 #include "ComStack_Types.h"\r
34 #include "Std_Types.h"\r
35 #include "LinSM_Cfg.h"\r
36 #include "Com_Types.h"\r
37 #if defined(USE_COM)\r
38 #include "Com.h"\r
39 #endif\r
40 #include "ComM_Types.h"\r
41 #include "LinIf.h"\r
42 \r
43 #define LINSM_INIT_SERVICE_ID 0x01\r
44 #define LINSM_REQUEST_COM_MODE_SERVICE_ID 0x10\r
45 #define LINSM_GET_CURRENT_COM_MODE_SERVICE_ID 0x11\r
46 #define LINSM_SCHEDULE_REQUEST_SERVICE_ID 0x12\r
47 #define LINSM_GOTO_SLEEP_CONF_SERVICE_ID 0x20\r
48 #define LINSM_WAKEUP_CONF_SERVICE_ID 0x21\r
49 #define LINSM_SCHEDULE_REQUEST_CONF_SERVICE_ID 0x22\r
50 \r
51 /* --- Error codes --- */\r
52 #define LINSM_E_UNINIT                  0x00\r
53 #define LINSM_E_ALREADY_INITIALIZED             0x10\r
54 #define LINSM_E_NOXEXISTENT_CHANNEL             0x20\r
55 #define LINSM_E_PARAMETER                               0x30\r
56 #define LINSM_E_PARAMETER_POINTER               0x40\r
57 #define LINSM_E_NOT_IN_RUN_SCHEDULE             0x50\r
58 #define LINSM_E_CONFIRMATION_TIMEOUT    0x60 //Assigned by DEM\r
59 \r
60 typedef enum {\r
61         LINSM_UNINIT,\r
62         LINSM_INIT,\r
63         LINSM_NO_COM,\r
64         LINSM_FULL_COM,\r
65         LINSM_RUN_SCHEDULE,\r
66         LINSM_GOTO_SLEEP,\r
67 }LinSM_StatusType;\r
68 \r
69 #if (LINSM_VERSION_INFO_API == STD_ON)\r
70 void LinSM_GetVersionInfo( Std_VersionInfoType *versionInfo );\r
71 #define LinSM_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,LINSM)\r
72 #endif\r
73 \r
74 void LinSM_Init(const void* ConfigPtr);\r
75 void LinSM_DeInit();\r
76 \r
77 Std_ReturnType LinSM_ScheduleRequest(NetworkHandleType channel,LinIf_SchHandleType schedule);\r
78 \r
79 Std_ReturnType LinSM_GetCurrentComMode(NetworkHandleType network,ComM_ModeType* mode);\r
80 \r
81 Std_ReturnType LinSM_RequestComMode(NetworkHandleType network,ComM_ModeType mode);\r
82 \r
83 \r
84 #endif\r