1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
16 /** @addtogroup General General
20 * Definitions of General types.
23 #ifndef _STD_TYPES_H
\r
24 #define _STD_TYPES_H
\r
26 // Autosar include files....
\r
27 // TODO: we haven't really defined the autosar types yet.
\r
28 // the standard types are uint8, etc.
\r
34 #if !defined(USE_KERNEL)
\r
35 #include "typedefs.h"
\r
40 #include "Platform_Types.h" // TODO: move
\r
41 #include "Compiler.h"
\r
43 //typedef uint8_t uint8;
\r
44 //typedef uint16_t uint16;
\r
45 //typedef uint32_t uint32;
\r
54 uint8 sw_major_version; /**< Vendor numbers */
55 uint8 sw_minor_version; /**< Vendor numbers */
56 uint8 sw_patch_version; /**< Vendor numbers */
58 uint8 ar_major_version; /**< Autosar spec. numbers */
59 uint8 ar_minor_version; /**< Autosar spec. numbers */
60 uint8 ar_patch_version; /**< Autosar spec. numbers */
61 } Std_VersionInfoType;
\r
63 /** make compare number... #if version > 10203 ( 1.2.3 ) */
64 #define STD_GET_VERSION (_major,_minor,_patch) (_major * 10000 + _minor * 100 + _patch)
\r
66 /** Create Std_VersionInfoType */
67 #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
78 // TODO: Move to OSEK implementation, See 8.2 in SWS_StandardTypes
\r
80 #define STATUSTYPEDEFINED
\r
83 E_OS_ACCESS = 1, /**< STD OSEK */
84 E_OS_CALLEVEL = 2, /**< STD OSEK */
85 E_OS_ID = 3, /**< STD OSEK */
86 E_OS_LIMIT = 4, /**< STD OSEK */
87 E_OS_NOFUNC = 5, /**< STD OSEK */
88 E_OS_RESOURCE = 6, /**< STD OSEK */
89 E_OS_STATE = 7, /**< STD OSEK */
90 E_OS_VALUE = 8, /**< STD OSEK */
92 E_OS_SERVICEID, /**< AUTOSAR, see 7.10 */
93 E_OS_RATE , /**< AUTOSAR, see 7.10 */
94 E_OS_ILLEGAL_ADDRESS , /**< AUTOSAR, see 7.10 */
95 E_OS_MISSINGEND , /**< AUTOSAR, see 7.10 */
96 E_OS_DISABLEDINT , /**< AUTOSAR, see 7.10 */
97 E_OS_STACKFAULT , /**< AUTOSAR, see 7.10 */
98 E_OS_PROTECTION_MEMORY , /**< AUTOSAR, see 7.10 */
99 E_OS_PROTECTION_TIME , /**< AUTOSAR, see 7.10 */
100 E_OS_PROTECTION_LOCKED , /**< AUTOSAR, see 7.10 */
101 E_OS_PROTECTION_EXCEPTION , /**< AUTOSAR, see 7.10 */
102 E_OS_PROTECTION_RATE, /**< AUTOSAR, see 7.10 */
104 /* COM.. TODO: move ?? */
\r
108 /** Implementation specific */
115 // TODO: really ???
\r
116 typedef uint8 Std_ReturnType;
\r
119 #ifndef STATUSTYPEDEFINED
\r
120 #define STATUSTYPEDEFINED
\r
122 typedef unsigned char StatusType;
\r
127 #define STD_HIGH 0x01
\r
128 #define STD_LOW 0x00
\r
130 #define STD_ACTIVE 0x01
\r
131 #define STD_IDLE 0x00
\r
133 #define STD_ON 0x01
\r
134 #define STD_OFF 0x00
\r