]> rtime.felk.cvut.cz Git - arc.git/blob - include/Port.h
Initial commit.
[arc.git] / include / Port.h
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
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>.
9  *
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
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16
17
18
19
20
21
22
23 #ifndef PORT_H_\r
24 #define PORT_H_\r
25 \r
26 #include "Port_Cfg.h"\r
27 #if PORT_VERSION_INFO_API == STD_ON\r
28 \r
29 #define PORT_SW_MAJOR_VERSION           1 \r
30 #define PORT_SW_MINOR_VERSION           0 \r
31 #define PORT_SW_PATCH_VERSION           0 \r
32 #define PORT_AR_MAJOR_VERSION     3\r
33 #define PORT_AR_MINOR_VERSION     0 \r
34 #define PORT_AR_PATCH_VERSION     2 \r
35 \r
36 void Port_GetVersionInfo( Std_VersionInfoType *versionInfo );\r
37 #endif \r
38 \r
39 #define PORT_E_PARAM_PIN                                               0x0a\r
40 #define PORT_E_DIRECTION_UNCHANGEABLE            0x0b\r
41 #define PORT_E_PARAM_CONFIG                                          0x0c\r
42 #define PORT_E_PARAM_INVALID_MODE                          0x0d\r
43 #define PORT_E_MODE_UNCHANGEABLE                           0x0e\r
44 #define PORT_E_UNINIT                                                    0x0f\r
45 \r
46 #define PORT_INIT_ID                                                     0x00\r
47 #define PORT_SET_PIN_DIRECTION_ID                          0x01\r
48 #define PORT_REFRESH_PORT_DIRECTION_ID   0x02\r
49 #define PORT_GET_VERSION_INFO_ID         0x03\r
50 #define PORT_SET_PIN_MODE_ID                           0x04\r
51 \r
52 /*\r
53  * PORT046: The type Port_PinDirectionType is a type for defining the direction of a Port Pin. \r
54  * PORT_PIN_IN Sets port pin as input. \r
55  * PORT_PIN_OUT  Sets port pin as output. \r
56  */\r
57 typedef enum\r
58 {\r
59   PORT_PIN_IN = 0,\r
60   PORT_PIN_OUT,\r
61 } Port_PinDirectionType;\r
62 \r
63 typedef uint32 Port_PinModeType;\r
64 typedef enum\r
65 {\r
66   PORT_UNINITIALIZED = 0,\r
67   PORT_INITIALIZED,\r
68 } Port_StateType;\r
69 \r
70 void Port_Init( const Port_ConfigType *configType );\r
71 void Port_SetPinDirection( Port_PinType pin, Port_PinDirectionType direction );\r
72 void Port_RefreshPortDirection( void );\r
73 void Port_SetPinMode( Port_PinType Pin, Port_PinModeType Mode );\r
74 \r
75 #endif /*PORT_H_*/\r