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
17 /** @addtogroup General General
\r
20 /** @file Std_Types.h
\r
21 * Definitions of General types.
\r
27 // Autosar include files....
\r
28 // TODO: we haven't really defined the autosar types yet.
\r
29 // the standard types are uint8, etc.
\r
32 #include "Platform_Types.h" // TODO: move
\r
33 #include "Compiler.h"
\r
36 //lint -esym(960,20.2) // PC-Lint LINT EXCEPTION
\r
40 //typedef uint8_t uint8;
\r
41 //typedef uint16_t uint16;
\r
42 //typedef uint32_t uint32;
\r
51 uint8 sw_major_version; /**< Vendor numbers */
\r
52 uint8 sw_minor_version; /**< Vendor numbers */
\r
53 uint8 sw_patch_version; /**< Vendor numbers */
\r
55 uint8 ar_major_version; /**< Autosar spec. numbers */
\r
56 uint8 ar_minor_version; /**< Autosar spec. numbers */
\r
57 uint8 ar_patch_version; /**< Autosar spec. numbers */
\r
58 } Std_VersionInfoType;
\r
60 /** make compare number... #if version > 10203 ( 1.2.3 ) */
\r
61 #define STD_GET_VERSION (_major,_minor,_patch) (_major * 10000 + _minor * 100 + _patch)
\r
63 /** Create Std_VersionInfoType */
\r
64 // PC-Lint Exception MISRA rule 19.12
\r
65 //lint -save -esym(960,19.12)
\r
66 #define STD_GET_VERSION_INFO(_vi,_module) \
\r
68 ((_vi)->vendorID = _module ## _VENDOR_ID);\
\r
69 ((_vi)->moduleID = _module ## _MODULE_ID);\
\r
70 ((_vi)->sw_major_version = _module ## _SW_MAJOR_VERSION);\
\r
71 ((_vi)->sw_minor_version = _module ## _SW_MINOR_VERSION);\
\r
72 ((_vi)->sw_patch_version = _module ## _SW_PATCH_VERSION);\
\r
73 ((_vi)->ar_major_version = _module ## _AR_MAJOR_VERSION);\
\r
74 ((_vi)->ar_minor_version = _module ## _AR_MINOR_VERSION);\
\r
75 ((_vi)->ar_patch_version = _module ## _AR_PATCH_VERSION);\
\r
80 #define MIN(_x,_y) (((_x) < (_y)) ? (_x) : (_y))
\r
83 #define MAX(_x,_y) (((_x) > (_y)) ? (_x) : (_y))
\r
87 typedef uint8 Std_ReturnType;
\r
89 #define E_OK (Std_ReturnType)0
\r
90 #define E_NOT_OK (Std_ReturnType)1
\r
92 #define E_NO_DTC_AVAILABLE (Std_ReturnType)2
\r
93 #define E_SESSION_NOT_ALLOWED (Std_ReturnType)4
\r
94 #define E_PROTOCOL_NOT_ALLOWED (Std_ReturnType)5
\r
95 #define E_REQUEST_NOT_ACCEPTED (Std_ReturnType)8
\r
96 #define E_REQUEST_ENV_NOK (Std_ReturnType)9
\r
97 #define E_PENDING (Std_ReturnType)10
\r
98 #define E_COMPARE_KEY_FAILED (Std_ReturnType)11
\r
99 #define E_FORCE_RCRRP (Std_ReturnType)12
\r
101 #define STD_HIGH 0x01
\r
102 #define STD_LOW 0x00
\r
104 #define STD_ACTIVE 0x01
\r
105 #define STD_IDLE 0x00
\r
107 #define STD_ON 0x01
\r
108 #define STD_OFF 0x00
\r