]> rtime.felk.cvut.cz Git - arc.git/blobdiff - include/Dio.h
LED Blinker running on TMS570LS31x Hercules Development Kit (HDK) (TMS570LS3137ZWT)
[arc.git] / include / Dio.h
index 9f8e6d4b817ae32a163de326265ff3b9ab887cf9..999d96d9e88f5e00d473d41e3dfbc27b6955372a 100644 (file)
-/* -------------------------------- Arctic Core ------------------------------\r
- * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
- *\r
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
- *\r
- * This source code is free software; you can redistribute it and/or modify it\r
- * under the terms of the GNU General Public License version 2 as published by the\r
- * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
- *\r
- * This program is distributed in the hope that it will be useful, but\r
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
- * for more details.\r
- * -------------------------------- Arctic Core ------------------------------*/\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-#ifndef DIO_H_\r
-#define DIO_H_\r
-\r
-#include "Std_Types.h"\r
-\r
-// API Service ID's\r
-#define DIO_READCHANNEL_ID                     0x00\r
-#define DIO_WRITECHANNEL_ID                    0x01\r
-#define DIO_READPORT_ID                                0x02\r
-#define DIO_WRITEPORT_ID                       0x03\r
-#define DIO_READCHANNELGROUP_ID                0x04\r
-#define DIO_WRITECHANNELGROUP_ID       0x05\r
-#define DIO_GETVERSIONINFO_ID          0x12\r
-\r
-#define DIO_E_PARAM_INVALID_CHANNEL_ID                 10\r
-#define DIO_E_PARAM_INVALID_PORT_ID            20\r
-#define DIO_E_PARAM_INVALID_GROUP_ID           31\r
-\r
-typedef uint32 Dio_ChannelType;\r
-typedef uint32 Dio_PortType;\r
-typedef struct\r
-{\r
-  Dio_PortType port;\r
-  uint8 offset;\r
-  uint32 mask;\r
-} Dio_ChannelGroupType;\r
-\r
-#if 0 // Gone from 3.0\r
-typedef enum\r
-{\r
-  STD_LOW,\r
-  STD_HIGH,\r
-}Dio_LevelType;\r
-#endif\r
-\r
-typedef uint32 Dio_LevelType;\r
-\r
-typedef uint16 Dio_PortLevelType;\r
-\r
-#define DIO_SW_MAJOR_VERSION   1\r
-#define DIO_SW_MINOR_VERSION   0\r
-#define DIO_SW_PATCH_VERSION   0\r
-\r
-#define DIO_AR_MAJOR_VERSION     2\r
-#define DIO_AR_MINOR_VERSION     2 \r
-#define DIO_AR_PATCH_VERSION     1 \r
-\r
-#include "Dio_Cfg.h"\r
-\r
-\r
-#if ( DIO_VERSION_INFO_API == STD_ON)\r
-void Dio_GetVersionInfo( Std_VersionInfoType *versionInfo );\r
-#endif\r
-\r
-Dio_LevelType Dio_ReadChannel(Dio_ChannelType channelId);\r
-void Dio_WriteChannel(Dio_ChannelType channelId, Dio_LevelType level);\r
-Dio_PortLevelType Dio_ReadPort(Dio_PortType portId);\r
-void Dio_WritePort(Dio_PortType portId, Dio_PortLevelType level);\r
-Dio_PortLevelType Dio_ReadChannelGroup( const Dio_ChannelGroupType *channelGroupIdPtr );\r
-void Dio_WriteChannelGroup(const Dio_ChannelGroupType *channelGroupIdPtr, Dio_PortLevelType level);\r
-\r
-#endif /*DIO_H_*/\r
+/* -------------------------------- Arctic Core ------------------------------
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com
+ *
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
+ *
+ * This source code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ * -------------------------------- Arctic Core ------------------------------*/
+
+
+
+
+
+
+
+
+#ifndef DIO_H_
+#define DIO_H_
+
+#include "Modules.h"
+#include "Std_Types.h"
+
+
+// API Service ID's
+#define DIO_READCHANNEL_ID                     0x00
+#define DIO_WRITECHANNEL_ID                    0x01
+#define DIO_READPORT_ID                                0x02
+#define DIO_WRITEPORT_ID                       0x03
+#define DIO_READCHANNELGROUP_ID                0x04
+#define DIO_WRITECHANNELGROUP_ID       0x05
+#define DIO_GETVERSIONINFO_ID          0x12
+
+#define DIO_E_PARAM_INVALID_CHANNEL_ID                 10
+#define DIO_E_PARAM_INVALID_PORT_ID            20
+#define DIO_E_PARAM_INVALID_GROUP_ID           31
+
+#if defined(CFG_HC1X) || defined(CFG_TMS570)
+typedef uint8 Dio_ChannelType;
+typedef uint8 Dio_PortType;
+
+/** @req DIO021 */
+/** @req DIO022 */
+typedef struct
+{
+  Dio_PortType port;
+  uint8 offset;
+  uint8 mask;
+} Dio_ChannelGroupType;
+
+/** @req DIO023 */
+typedef uint8 Dio_LevelType;
+
+/** @req DIO024 */
+typedef uint8 Dio_PortLevelType;
+
+#else  // CFG_PPC, CFG_STM32_STAMP and others
+typedef uint32 Dio_ChannelType;
+typedef uint32 Dio_PortType;
+typedef struct
+{
+  Dio_PortType port;
+  uint8 offset;
+  uint32 mask;
+} Dio_ChannelGroupType;
+
+typedef uint32 Dio_LevelType;
+
+typedef uint32 Dio_PortLevelType;
+#endif
+
+
+#define DIO_MODULE_ID                  MODULE_ID_DIO
+#define DIO_VENDOR_ID                  1
+
+#define DIO_SW_MAJOR_VERSION   1
+#define DIO_SW_MINOR_VERSION   0
+#define DIO_SW_PATCH_VERSION   0
+
+#define DIO_AR_MAJOR_VERSION   2
+#define DIO_AR_MINOR_VERSION   2 
+#define DIO_AR_PATCH_VERSION   1 
+
+#include "Dio_Cfg.h"
+
+/** @req DIO124 */
+#if ( DIO_VERSION_INFO_API == STD_ON)
+/** @req DIO139 */
+#define Dio_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,DIO)
+#endif
+
+/** @req DIO133 */
+/** @req DIO027 */
+Dio_LevelType Dio_ReadChannel(Dio_ChannelType channelId);
+
+/** @req DIO134 */
+void Dio_WriteChannel(Dio_ChannelType channelId, Dio_LevelType level);
+
+/** @req DIO135 */
+/** @req DIO031 */
+Dio_PortLevelType Dio_ReadPort(Dio_PortType portId);
+
+/** @req DIO136 */
+void Dio_WritePort(Dio_PortType portId, Dio_PortLevelType level);
+
+/** @req DIO137 */
+Dio_PortLevelType Dio_ReadChannelGroup( const Dio_ChannelGroupType *channelGroupIdPtr );
+
+/** @req DIO138 */
+void Dio_WriteChannelGroup(const Dio_ChannelGroupType *channelGroupIdPtr, Dio_PortLevelType level);
+
+#endif /*DIO_H_*/