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
24 #ifndef _STD_TYPES_H
\r
25 #define _STD_TYPES_H
\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
39 //typedef uint8_t uint8;
\r
40 //typedef uint16_t uint16;
\r
41 //typedef uint32_t uint32;
\r
50 uint8 sw_major_version; /**< Vendor numbers */
\r
51 uint8 sw_minor_version; /**< Vendor numbers */
\r
52 uint8 sw_patch_version; /**< Vendor numbers */
\r
54 uint8 ar_major_version; /**< Autosar spec. numbers */
\r
55 uint8 ar_minor_version; /**< Autosar spec. numbers */
\r
56 uint8 ar_patch_version; /**< Autosar spec. numbers */
\r
57 } Std_VersionInfoType;
\r
59 /** make compare number... #if version > 10203 ( 1.2.3 ) */
\r
60 #define STD_GET_VERSION (_major,_minor,_patch) (_major * 10000 + _minor * 100 + _patch)
\r
62 /** Create Std_VersionInfoType */
\r
63 #define STD_GET_VERSION_INFO(_vi,_module) \
\r
64 ((_vi)->vendorID = _module ## _VENDOR_ID);\
\r
65 ((_vi)->moduleID = _module ## _MODULE_ID);\
\r
66 ((_vi)->sw_major_version = _module ## _SW_MAJOR_VERSION);\
\r
67 ((_vi)->sw_minor_version = _module ## _SW_MINOR_VERSION);\
\r
68 ((_vi)->sw_patch_version = _module ## _SW_PATCH_VERSION);\
\r
69 ((_vi)->ar_major_version = _module ## _AR_MAJOR_VERSION);\
\r
70 ((_vi)->ar_minor_version = _module ## _AR_MINOR_VERSION);\
\r
71 ((_vi)->ar_patch_version = _module ## _AR_PATCH_VERSION);
\r
74 // TODO: Move to OSEK implementation, See 8.2 in SWS_StandardTypes
\r
76 #define STATUSTYPEDEFINED
\r
79 E_OS_ACCESS = 1, /**< STD OSEK */
\r
80 E_OS_CALLEVEL = 2, /**< STD OSEK */
\r
81 E_OS_ID = 3, /**< STD OSEK */
\r
82 E_OS_LIMIT = 4, /**< STD OSEK */
\r
83 E_OS_NOFUNC = 5, /**< STD OSEK */
\r
84 E_OS_RESOURCE = 6, /**< STD OSEK */
\r
85 E_OS_STATE = 7, /**< STD OSEK */
\r
86 E_OS_VALUE = 8, /**< STD OSEK */
\r
88 E_OS_SERVICEID, /**< AUTOSAR, see 7.10 */
\r
89 E_OS_RATE , /**< AUTOSAR, see 7.10 */
\r
90 E_OS_ILLEGAL_ADDRESS , /**< AUTOSAR, see 7.10 */
\r
91 E_OS_MISSINGEND , /**< AUTOSAR, see 7.10 */
\r
92 E_OS_DISABLEDINT , /**< AUTOSAR, see 7.10 */
\r
93 E_OS_STACKFAULT , /**< AUTOSAR, see 7.10 */
\r
94 E_OS_PROTECTION_MEMORY , /**< AUTOSAR, see 7.10 */
\r
95 E_OS_PROTECTION_TIME , /**< AUTOSAR, see 7.10 */
\r
96 E_OS_PROTECTION_LOCKED , /**< AUTOSAR, see 7.10 */
\r
97 E_OS_PROTECTION_EXCEPTION , /**< AUTOSAR, see 7.10 */
\r
98 E_OS_PROTECTION_RATE, /**< AUTOSAR, see 7.10 */
\r
100 /* COM.. TODO: move ?? */
\r
104 /** Implementation specific */
\r
110 typedef uint8 Std_ReturnType;
\r
113 #ifndef STATUSTYPEDEFINED
\r
114 #define STATUSTYPEDEFINED
\r
116 typedef unsigned char StatusType;
\r
121 #define E_NO_DTC_AVAILABLE 2
\r
122 #define E_SESSION_NOT_ALLOWED 4
\r
123 #define E_PROTOCOL_NOT_ALLOWED 5
\r
124 #define E_REQUEST_NOT_ACCEPTED 8
\r
125 #define E_REQUEST_ENV_NOK 9
\r
126 #define E_PENDING 10
\r
127 #define E_COMPARE_KEY_FAILED 11
\r
128 #define E_FORCE_RCRRP 12
\r
130 #define STD_HIGH 0x01
\r
131 #define STD_LOW 0x00
\r
133 #define STD_ACTIVE 0x01
\r
134 #define STD_IDLE 0x00
\r
136 #define STD_ON 0x01
\r
137 #define STD_OFF 0x00
\r