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 Port Port Driver
20 * API and type definitions for Port Driver.
26 #define PORT_SW_MAJOR_VERSION 1
27 #define PORT_SW_MINOR_VERSION 0
28 #define PORT_SW_PATCH_VERSION 0
30 #define PORT_AR_MAJOR_VERSION 3
31 #define PORT_AR_MINOR_VERSION 1
32 #define PORT_AR_PATCH_VERSION 0
34 #include "Port_Cfg.h" /** @req PORT130 */
36 #if (PORT_VERSION_INFO_API == STD_ON)
38 Port_GetVersionInfo(Std_VersionInfoType *versionInfo);
41 /** @name Error Codes */
44 #define PORT_E_PARAM_PIN 0x0a
45 #define PORT_E_DIRECTION_UNCHANGEABLE 0x0b
46 #define PORT_E_PARAM_CONFIG 0x0c
47 #define PORT_E_PARAM_INVALID_MODE 0x0d
48 #define PORT_E_MODE_UNCHANGEABLE 0x0e
49 #define PORT_E_UNINIT 0x0f
52 /** @name Service id's */
54 #define PORT_INIT_ID 0x00
55 #define PORT_SET_PIN_DIRECTION_ID 0x01
56 #define PORT_REFRESH_PORT_DIRECTION_ID 0x02
57 #define PORT_GET_VERSION_INFO_ID 0x03
58 #define PORT_SET_PIN_MODE_ID 0x04
62 * The type Port_PinDirectionType is a type for defining the direction of a Port Pin.
63 * PORT_PIN_IN Sets port pin as input.
64 * PORT_PIN_OUT Sets port pin as output.
68 PORT_PIN_IN = 0, PORT_PIN_OUT,
69 } Port_PinDirectionType;
72 Port_Init(const Port_ConfigType *configType);
73 #if ( PORT_PIN_DIRECTION_CHANGES_ALLOWED == STD_ON )
75 Port_SetPinDirection(Port_PinType pin, Port_PinDirectionType direction);
78 Port_RefreshPortDirection(void);
79 #if (PORT_SET_PIN_MODE_API == STD_ON)
81 Port_SetPinMode(Port_PinType Pin, Port_PinModeType Mode);