]> rtime.felk.cvut.cz Git - arc.git/blob - include/Dio.h
Fix ticket #14. Added/updated/moved *_SW_*_VERSION for build-time cfg version testing
[arc.git] / include / Dio.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 DIO_H_\r
24 #define DIO_H_\r
25 \r
26 #include "Std_Types.h"\r
27 \r
28 // API Service ID's\r
29 #define DIO_READCHANNEL_ID                      0x00\r
30 #define DIO_WRITECHANNEL_ID                     0x01\r
31 #define DIO_READPORT_ID                         0x02\r
32 #define DIO_WRITEPORT_ID                        0x03\r
33 #define DIO_READCHANNELGROUP_ID         0x04\r
34 #define DIO_WRITECHANNELGROUP_ID        0x05\r
35 #define DIO_GETVERSIONINFO_ID           0x12\r
36 \r
37 #define DIO_E_PARAM_INVALID_CHANNEL_ID          10\r
38 #define DIO_E_PARAM_INVALID_PORT_ID             20\r
39 #define DIO_E_PARAM_INVALID_GROUP_ID            31\r
40 \r
41 typedef uint32 Dio_ChannelType;\r
42 typedef uint32 Dio_PortType;\r
43 typedef struct\r
44 {\r
45   Dio_PortType port;\r
46   uint8 offset;\r
47   uint32 mask;\r
48 } Dio_ChannelGroupType;\r
49 \r
50 #if 0 // Gone from 3.0\r
51 typedef enum\r
52 {\r
53   STD_LOW,\r
54   STD_HIGH,\r
55 }Dio_LevelType;\r
56 #endif\r
57 \r
58 typedef uint32 Dio_LevelType;\r
59 \r
60 typedef uint16 Dio_PortLevelType;\r
61
62 #define DIO_SW_MAJOR_VERSION    1
63 #define DIO_SW_MINOR_VERSION    0
64 #define DIO_SW_PATCH_VERSION    0
65
66 #define DIO_AR_MAJOR_VERSION     2
67 #define DIO_AR_MINOR_VERSION     2 
68 #define DIO_AR_PATCH_VERSION     1 
69 \r
70 #include "Dio_Cfg.h"\r
71 \r
72
73 #if ( DIO_VERSION_INFO_API == STD_ON)\r
74 void Dio_GetVersionInfo( Std_VersionInfoType *versionInfo );\r
75 #endif\r
76 \r
77 Dio_LevelType Dio_ReadChannel(Dio_ChannelType channelId);\r
78 void Dio_WriteChannel(Dio_ChannelType channelId, Dio_LevelType level);\r
79 Dio_PortLevelType Dio_ReadPort(Dio_PortType portId);\r
80 void Dio_WritePort(Dio_PortType portId, Dio_PortLevelType level);\r
81 Dio_PortLevelType Dio_ReadChannelGroup( const Dio_ChannelGroupType *channelGroupIdPtr );\r
82 void Dio_WriteChannelGroup(const Dio_ChannelGroupType *channelGroupIdPtr, Dio_PortLevelType level);\r
83 \r
84 #endif /*DIO_H_*/\r