]> rtime.felk.cvut.cz Git - arc.git/blob - include/Dcm.h
Added example of CAN communication for the TMS570LS31x HDK
[arc.git] / include / Dcm.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 DCM_H_\r
24 #define DCM_H_\r
25 \r
26 #define DCM_MODULE_ID                   MODULE_ID_DCM /** @req DCM052 */\r
27 #define DCM_VENDOR_ID                   1\r
28 \r
29 #define DCM_SW_MAJOR_VERSION    1\r
30 #define DCM_SW_MINOR_VERSION    0\r
31 #define DCM_SW_PATCH_VERSION    0\r
32 #define DCM_AR_MAJOR_VERSION    3\r
33 #define DCM_AR_MINOR_VERSION    0\r
34 #define DCM_AR_PATCH_VERSION    1\r
35 \r
36 #include "Dcm_Types.h"\r
37 #include "Dcm_Cfg.h"\r
38 #include "Dcm_Lcfg.h"\r
39 #include "ComStack_Types.h"\r
40 #include "Dcm_Cbk.h"\r
41 \r
42 #if (DCM_DEV_ERROR_DETECT == STD_ON)\r
43 // Error codes produced by this module defined by Autosar\r
44 #define DCM_E_INTERFACE_TIMEOUT                         0x01\r
45 #define DCM_E_INTERFACE_VALUE_OUT_OF_RANGE      0x02\r
46 #define DCM_E_INTERFACE_BUFFER_OVERFLOW         0x03\r
47 #define DCM_E_INTERFACE_PROTOCOL_MISMATCH       0x04\r
48 #define DCM_E_UNINIT                                            0x05\r
49 #define DCM_E_PARAM                                                     0x06\r
50 \r
51 // Other error codes reported by this module\r
52 #define DCM_E_CONFIG_INVALID                            0x40\r
53 #define DCM_E_NOT_SUPPORTED                                     0xfe\r
54 #define DCM_E_NOT_IMPLEMENTED_YET                       0xff\r
55 \r
56 // Service IDs in this module defined by Autosar\r
57 #define DCM_INIT_ID                                                     0x01\r
58 #define DCM_PROVIDE_RX_BUFFER_ID                        0x02\r
59 #define DCM_RX_INDICATION_ID                            0x03\r
60 #define DCM_PROVIDE_TX_BUFFER_ID                        0x04\r
61 #define DCM_TX_CONFIRMATION_ID                          0x05\r
62 #define DCM_GET_SES_CTRL_TYPE_ID                        0x06\r
63 #define DCM_GET_SECURITY_LEVEL_ID                       0x0d\r
64 #define DCM_GET_ACTIVE_PROTOCOL_ID                      0x0f\r
65 #define DCM_COMM_NO_COM_MODE_ENTERED_ID         0x21\r
66 #define DCM_COMM_SILENT_COM_MODE_ENTERED_ID     0x22\r
67 #define DCM_COMM_FULL_COM_MODE_ENTERED_ID       0x23\r
68 #define DCM_MAIN_ID                                                     0x25\r
69 \r
70 // Other service IDs reported by this module\r
71 #define DCM_HANDLE_RESPONSE_TRANSMISSION_ID     0x80\r
72 #define DCM_UDS_READ_DTC_INFO_ID                        0x81\r
73 #define DCM_UDS_RESET_ID                                        0x82\r
74 #define DCM_CHANGE_DIAGNOSTIC_SESSION_ID        0x88\r
75 #define DCM_GLOBAL_ID                                           0xff\r
76 \r
77 #endif\r
78 \r
79 /*\r
80  * Interfaces for BSW components (8.3.1)\r
81  */\r
82 #if ( DCM_VERSION_INFO_API == STD_ON ) /** @req DCM337 */\r
83 #define Dcm_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,DCM) /** @req DCM065 */ /** @req DCM335 */ /** @req DCM336 */\r
84 #endif /* DCM_VERSION_INFO_API */\r
85 \r
86 void Dcm_Init( void ); /** @req DCM037 */\r
87 \r
88 \r
89 /*\r
90  * Interfaces for BSW modules and to SW-Cs (8.3.2)\r
91  */\r
92 Std_ReturnType Dcm_GetSecurityLevel(Dcm_SecLevelType *secLevel); /** @req DCM338 */\r
93 Std_ReturnType Dcm_GetSesCtrlType(Dcm_SesCtrlType *sesCtrlType); /** @req DCM339 */\r
94 Std_ReturnType Dcm_GetActiveProtocol(Dcm_ProtocolType *activeProtocol); /** @req DCM340 */\r
95 \r
96 /*\r
97  * Interface for basic software scheduler (8.5)\r
98  */\r
99 void Dcm_MainFunction( void ); /** @req DCM053 */\r
100 \r
101 \r
102 #endif /*DCM_H_*/\r