]> 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 022643b7216a08192f67f3a997105c828f17498c..999d96d9e88f5e00d473d41e3dfbc27b6955372a 100644 (file)
  * for more details.
  * -------------------------------- Arctic Core ------------------------------*/
 
+
+
+
+
+
+
+
 #ifndef DIO_H_
 #define DIO_H_
 
-#include "Std_Types.h" /** @req DIO131 */
+#include "Modules.h"
+#include "Std_Types.h"
+
 
 // API Service ID's
 #define DIO_READCHANNEL_ID                     0x00
 #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     
-#define DIO_AR_PATCH_VERSION     
+#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 */
-void Dio_GetVersionInfo( Std_VersionInfoType *versionInfo );
+#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);