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 ------------------------------*/
26 #include "Std_Types.h" /** @req DIO131 */
29 #define DIO_READCHANNEL_ID 0x00
30 #define DIO_WRITECHANNEL_ID 0x01
31 #define DIO_READPORT_ID 0x02
32 #define DIO_WRITEPORT_ID 0x03
33 #define DIO_READCHANNELGROUP_ID 0x04
34 #define DIO_WRITECHANNELGROUP_ID 0x05
35 #define DIO_GETVERSIONINFO_ID 0x12
37 #define DIO_E_PARAM_INVALID_CHANNEL_ID 10
38 #define DIO_E_PARAM_INVALID_PORT_ID 20
39 #define DIO_E_PARAM_INVALID_GROUP_ID 31
41 #if defined(CFG_HC1X) || defined(CFG_TMS570)
42 typedef uint8 Dio_ChannelType;
43 typedef uint8 Dio_PortType;
52 } Dio_ChannelGroupType;
55 typedef uint8 Dio_LevelType;
58 typedef uint8 Dio_PortLevelType;
60 #else // CFG_PPC, CFG_STM32_STAMP and others
61 typedef uint32 Dio_ChannelType;
62 typedef uint32 Dio_PortType;
68 } Dio_ChannelGroupType;
70 typedef uint32 Dio_LevelType;
72 typedef uint16 Dio_PortLevelType;
76 #define DIO_MODULE_ID MODULE_ID_DIO
77 #define DIO_VENDOR_ID 1
79 #define DIO_SW_MAJOR_VERSION 1
80 #define DIO_SW_MINOR_VERSION 0
81 #define DIO_SW_PATCH_VERSION 0
83 #define DIO_AR_MAJOR_VERSION 2
84 #define DIO_AR_MINOR_VERSION 2
85 #define DIO_AR_PATCH_VERSION 1
90 #if ( DIO_VERSION_INFO_API == STD_ON)
92 #define Dio_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,DIO)
97 Dio_LevelType Dio_ReadChannel(Dio_ChannelType channelId);
100 void Dio_WriteChannel(Dio_ChannelType channelId, Dio_LevelType level);
104 Dio_PortLevelType Dio_ReadPort(Dio_PortType portId);
107 void Dio_WritePort(Dio_PortType portId, Dio_PortLevelType level);
110 Dio_PortLevelType Dio_ReadChannelGroup( const Dio_ChannelGroupType *channelGroupIdPtr );
113 void Dio_WriteChannelGroup(const Dio_ChannelGroupType *channelGroupIdPtr, Dio_PortLevelType level);