提交 e0ca0595 编写于 作者: G Greg Kroah-Hartman

Staging: epl: run Lindent on *.h files

It's a start, still a mess...

Cc: Daniel Krueger <daniel.krueger@systec-electronic.com>
Cc: Ronald Sieber <Ronald.Sieber@systec-electronic.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 bd5cd82d
...@@ -73,31 +73,30 @@ ...@@ -73,31 +73,30 @@
#include "global.h" #include "global.h"
#if (TARGET_SYSTEM == _NO_OS_) && (DEV_SYSTEM == _DEV_GNU_CF548X_) #if (TARGET_SYSTEM == _NO_OS_) && (DEV_SYSTEM == _DEV_GNU_CF548X_)
#include "common.h" #include "common.h"
#elif (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) #elif (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__)
// #include <linux/config.h> // #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#ifdef CONFIG_COLDFIRE #ifdef CONFIG_COLDFIRE
#include <asm/coldfire.h> #include <asm/coldfire.h>
#include <asm/m5485gpio.h> #include <asm/m5485gpio.h>
#define BENCHMARK_SET(x) MCF_GPIO_PODR_PCIBG |= (1 << (x)) // (x+1) #define BENCHMARK_SET(x) MCF_GPIO_PODR_PCIBG |= (1 << (x)) // (x+1)
#define BENCHMARK_RESET(x) MCF_GPIO_PODR_PCIBG &= ~(1 << (x)) // (x+1) #define BENCHMARK_RESET(x) MCF_GPIO_PODR_PCIBG &= ~(1 << (x)) // (x+1)
#define BENCHMARK_TOGGLE(x) MCF_GPIO_PODR_PCIBR ^= (1 << (x - 5)) #define BENCHMARK_TOGGLE(x) MCF_GPIO_PODR_PCIBR ^= (1 << (x - 5))
#else #else
#undef BENCHMARK_MODULES #undef BENCHMARK_MODULES
#define BENCHMARK_MODULES 0x00000000 #define BENCHMARK_MODULES 0x00000000
#endif #endif
#else #else
// disable Benchmarking // disable Benchmarking
#undef BENCHMARK_MODULES #undef BENCHMARK_MODULES
#define BENCHMARK_MODULES 0x00000000 #define BENCHMARK_MODULES 0x00000000
#endif #endif
/***************************************************************************/ /***************************************************************************/
...@@ -149,295 +148,290 @@ ...@@ -149,295 +148,290 @@
#define BENCHMARK_MOD_31 0x40000000 #define BENCHMARK_MOD_31 0x40000000
#define BENCHMARK_MOD_32 0x80000000 #define BENCHMARK_MOD_32 0x80000000
#if (BENCHMARK_MODULES & BENCHMARK_MOD_01) #if (BENCHMARK_MODULES & BENCHMARK_MOD_01)
#define BENCHMARK_MOD_01_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_01_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_01_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_01_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_01_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_01_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_01_SET(x) #define BENCHMARK_MOD_01_SET(x)
#define BENCHMARK_MOD_01_RESET(x) #define BENCHMARK_MOD_01_RESET(x)
#define BENCHMARK_MOD_01_TOGGLE(x) #define BENCHMARK_MOD_01_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_02) #if (BENCHMARK_MODULES & BENCHMARK_MOD_02)
#define BENCHMARK_MOD_02_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_02_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_02_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_02_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_02_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_02_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_02_SET(x) #define BENCHMARK_MOD_02_SET(x)
#define BENCHMARK_MOD_02_RESET(x) #define BENCHMARK_MOD_02_RESET(x)
#define BENCHMARK_MOD_02_TOGGLE(x) #define BENCHMARK_MOD_02_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_03) #if (BENCHMARK_MODULES & BENCHMARK_MOD_03)
#define BENCHMARK_MOD_03_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_03_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_03_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_03_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_03_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_03_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_03_SET(x) #define BENCHMARK_MOD_03_SET(x)
#define BENCHMARK_MOD_03_RESET(x) #define BENCHMARK_MOD_03_RESET(x)
#define BENCHMARK_MOD_03_TOGGLE(x) #define BENCHMARK_MOD_03_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_04) #if (BENCHMARK_MODULES & BENCHMARK_MOD_04)
#define BENCHMARK_MOD_04_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_04_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_04_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_04_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_04_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_04_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_04_SET(x) #define BENCHMARK_MOD_04_SET(x)
#define BENCHMARK_MOD_04_RESET(x) #define BENCHMARK_MOD_04_RESET(x)
#define BENCHMARK_MOD_04_TOGGLE(x) #define BENCHMARK_MOD_04_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_05) #if (BENCHMARK_MODULES & BENCHMARK_MOD_05)
#define BENCHMARK_MOD_05_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_05_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_05_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_05_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_05_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_05_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_05_SET(x) #define BENCHMARK_MOD_05_SET(x)
#define BENCHMARK_MOD_05_RESET(x) #define BENCHMARK_MOD_05_RESET(x)
#define BENCHMARK_MOD_05_TOGGLE(x) #define BENCHMARK_MOD_05_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_06) #if (BENCHMARK_MODULES & BENCHMARK_MOD_06)
#define BENCHMARK_MOD_06_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_06_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_06_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_06_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_06_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_06_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_06_SET(x) #define BENCHMARK_MOD_06_SET(x)
#define BENCHMARK_MOD_06_RESET(x) #define BENCHMARK_MOD_06_RESET(x)
#define BENCHMARK_MOD_06_TOGGLE(x) #define BENCHMARK_MOD_06_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_07) #if (BENCHMARK_MODULES & BENCHMARK_MOD_07)
#define BENCHMARK_MOD_07_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_07_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_07_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_07_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_07_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_07_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_07_SET(x) #define BENCHMARK_MOD_07_SET(x)
#define BENCHMARK_MOD_07_RESET(x) #define BENCHMARK_MOD_07_RESET(x)
#define BENCHMARK_MOD_07_TOGGLE(x) #define BENCHMARK_MOD_07_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_08) #if (BENCHMARK_MODULES & BENCHMARK_MOD_08)
#define BENCHMARK_MOD_08_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_08_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_08_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_08_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_08_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_08_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_08_SET(x) #define BENCHMARK_MOD_08_SET(x)
#define BENCHMARK_MOD_08_RESET(x) #define BENCHMARK_MOD_08_RESET(x)
#define BENCHMARK_MOD_08_TOGGLE(x) #define BENCHMARK_MOD_08_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_09) #if (BENCHMARK_MODULES & BENCHMARK_MOD_09)
#define BENCHMARK_MOD_09_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_09_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_09_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_09_RESET(x) BENCHMARK_RESET(x)
#define BENCHMARK_MOD_09_TOGGLE(x) BENCHMARK_TOGGLE(x) #define BENCHMARK_MOD_09_TOGGLE(x) BENCHMARK_TOGGLE(x)
#else #else
#define BENCHMARK_MOD_09_SET(x) #define BENCHMARK_MOD_09_SET(x)
#define BENCHMARK_MOD_09_RESET(x) #define BENCHMARK_MOD_09_RESET(x)
#define BENCHMARK_MOD_09_TOGGLE(x) #define BENCHMARK_MOD_09_TOGGLE(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_10) #if (BENCHMARK_MODULES & BENCHMARK_MOD_10)
#define BENCHMARK_MOD_10_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_10_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_10_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_10_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_10_SET(x) #define BENCHMARK_MOD_10_SET(x)
#define BENCHMARK_MOD_10_RESET(x) #define BENCHMARK_MOD_10_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_11) #if (BENCHMARK_MODULES & BENCHMARK_MOD_11)
#define BENCHMARK_MOD_11_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_11_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_11_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_11_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_11_SET(x) #define BENCHMARK_MOD_11_SET(x)
#define BENCHMARK_MOD_11_RESET(x) #define BENCHMARK_MOD_11_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_12) #if (BENCHMARK_MODULES & BENCHMARK_MOD_12)
#define BENCHMARK_MOD_12_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_12_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_12_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_12_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_12_SET(x) #define BENCHMARK_MOD_12_SET(x)
#define BENCHMARK_MOD_12_RESET(x) #define BENCHMARK_MOD_12_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_13) #if (BENCHMARK_MODULES & BENCHMARK_MOD_13)
#define BENCHMARK_MOD_13_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_13_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_13_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_13_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_13_SET(x) #define BENCHMARK_MOD_13_SET(x)
#define BENCHMARK_MOD_13_RESET(x) #define BENCHMARK_MOD_13_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_14) #if (BENCHMARK_MODULES & BENCHMARK_MOD_14)
#define BENCHMARK_MOD_14_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_14_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_14_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_14_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_14_SET(x) #define BENCHMARK_MOD_14_SET(x)
#define BENCHMARK_MOD_14_RESET(x) #define BENCHMARK_MOD_14_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_15) #if (BENCHMARK_MODULES & BENCHMARK_MOD_15)
#define BENCHMARK_MOD_15_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_15_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_15_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_15_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_15_SET(x) #define BENCHMARK_MOD_15_SET(x)
#define BENCHMARK_MOD_15_RESET(x) #define BENCHMARK_MOD_15_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_16) #if (BENCHMARK_MODULES & BENCHMARK_MOD_16)
#define BENCHMARK_MOD_16_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_16_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_16_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_16_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_16_SET(x) #define BENCHMARK_MOD_16_SET(x)
#define BENCHMARK_MOD_16_RESET(x) #define BENCHMARK_MOD_16_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_17) #if (BENCHMARK_MODULES & BENCHMARK_MOD_17)
#define BENCHMARK_MOD_17_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_17_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_17_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_17_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_17_SET(x) #define BENCHMARK_MOD_17_SET(x)
#define BENCHMARK_MOD_17_RESET(x) #define BENCHMARK_MOD_17_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_18) #if (BENCHMARK_MODULES & BENCHMARK_MOD_18)
#define BENCHMARK_MOD_18_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_18_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_18_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_18_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_18_SET(x) #define BENCHMARK_MOD_18_SET(x)
#define BENCHMARK_MOD_18_RESET(x) #define BENCHMARK_MOD_18_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_19) #if (BENCHMARK_MODULES & BENCHMARK_MOD_19)
#define BENCHMARK_MOD_19_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_19_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_19_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_19_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_19_SET(x) #define BENCHMARK_MOD_19_SET(x)
#define BENCHMARK_MOD_19_RESET(x) #define BENCHMARK_MOD_19_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_20) #if (BENCHMARK_MODULES & BENCHMARK_MOD_20)
#define BENCHMARK_MOD_20_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_20_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_20_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_20_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_20_SET(x) #define BENCHMARK_MOD_20_SET(x)
#define BENCHMARK_MOD_20_RESET(x) #define BENCHMARK_MOD_20_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_21) #if (BENCHMARK_MODULES & BENCHMARK_MOD_21)
#define BENCHMARK_MOD_21_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_21_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_21_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_21_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_21_SET(x) #define BENCHMARK_MOD_21_SET(x)
#define BENCHMARK_MOD_21_RESET(x) #define BENCHMARK_MOD_21_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_22) #if (BENCHMARK_MODULES & BENCHMARK_MOD_22)
#define BENCHMARK_MOD_22_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_22_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_22_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_22_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_22_SET(x) #define BENCHMARK_MOD_22_SET(x)
#define BENCHMARK_MOD_22_RESET(x) #define BENCHMARK_MOD_22_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_23) #if (BENCHMARK_MODULES & BENCHMARK_MOD_23)
#define BENCHMARK_MOD_23_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_23_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_23_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_23_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_23_SET(x) #define BENCHMARK_MOD_23_SET(x)
#define BENCHMARK_MOD_23_RESET(x) #define BENCHMARK_MOD_23_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_24) #if (BENCHMARK_MODULES & BENCHMARK_MOD_24)
#define BENCHMARK_MOD_24_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_24_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_24_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_24_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_24_SET(x) #define BENCHMARK_MOD_24_SET(x)
#define BENCHMARK_MOD_24_RESET(x) #define BENCHMARK_MOD_24_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_25) #if (BENCHMARK_MODULES & BENCHMARK_MOD_25)
#define BENCHMARK_MOD_25_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_25_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_25_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_25_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_25_SET(x) #define BENCHMARK_MOD_25_SET(x)
#define BENCHMARK_MOD_25_RESET(x) #define BENCHMARK_MOD_25_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_26) #if (BENCHMARK_MODULES & BENCHMARK_MOD_26)
#define BENCHMARK_MOD_26_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_26_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_26_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_26_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_26_SET(x) #define BENCHMARK_MOD_26_SET(x)
#define BENCHMARK_MOD_26_RESET(x) #define BENCHMARK_MOD_26_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_27) #if (BENCHMARK_MODULES & BENCHMARK_MOD_27)
#define BENCHMARK_MOD_27_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_27_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_27_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_27_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_27_SET(x) #define BENCHMARK_MOD_27_SET(x)
#define BENCHMARK_MOD_27_RESET(x) #define BENCHMARK_MOD_27_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_28) #if (BENCHMARK_MODULES & BENCHMARK_MOD_28)
#define BENCHMARK_MOD_28_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_28_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_28_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_28_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_28_SET(x) #define BENCHMARK_MOD_28_SET(x)
#define BENCHMARK_MOD_28_RESET(x) #define BENCHMARK_MOD_28_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_29) #if (BENCHMARK_MODULES & BENCHMARK_MOD_29)
#define BENCHMARK_MOD_29_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_29_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_29_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_29_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_29_SET(x) #define BENCHMARK_MOD_29_SET(x)
#define BENCHMARK_MOD_29_RESET(x) #define BENCHMARK_MOD_29_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_30) #if (BENCHMARK_MODULES & BENCHMARK_MOD_30)
#define BENCHMARK_MOD_30_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_30_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_30_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_30_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_30_SET(x) #define BENCHMARK_MOD_30_SET(x)
#define BENCHMARK_MOD_30_RESET(x) #define BENCHMARK_MOD_30_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_31) #if (BENCHMARK_MODULES & BENCHMARK_MOD_31)
#define BENCHMARK_MOD_31_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_31_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_31_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_31_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_31_SET(x) #define BENCHMARK_MOD_31_SET(x)
#define BENCHMARK_MOD_31_RESET(x) #define BENCHMARK_MOD_31_RESET(x)
#endif #endif
#if (BENCHMARK_MODULES & BENCHMARK_MOD_32) #if (BENCHMARK_MODULES & BENCHMARK_MOD_32)
#define BENCHMARK_MOD_32_SET(x) BENCHMARK_SET(x) #define BENCHMARK_MOD_32_SET(x) BENCHMARK_SET(x)
#define BENCHMARK_MOD_32_RESET(x) BENCHMARK_RESET(x) #define BENCHMARK_MOD_32_RESET(x) BENCHMARK_RESET(x)
#else #else
#define BENCHMARK_MOD_32_SET(x) #define BENCHMARK_MOD_32_SET(x)
#define BENCHMARK_MOD_32_RESET(x) #define BENCHMARK_MOD_32_RESET(x)
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// modul global types // modul global types
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// local vars // local vars
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// local function prototypes // local function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // _BENCHMARK_H_ #endif // _BENCHMARK_H_
此差异已折叠。
...@@ -73,40 +73,32 @@ ...@@ -73,40 +73,32 @@
#ifndef _EDRVFEC_H_ #ifndef _EDRVFEC_H_
#define _EDRVFEC_H_ #define _EDRVFEC_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// do this in config header // do this in config header
#define TARGET_HARDWARE TGTHW_SPLC_CF54 #define TARGET_HARDWARE TGTHW_SPLC_CF54
// base addresses // base addresses
#if ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5282) #if ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5282)
#elif ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5485) #elif ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5485)
#else #else
#error 'ERROR: Target was never implemented!' #error 'ERROR: Target was never implemented!'
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// types // types
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Rx and Tx buffer descriptor format // Rx and Tx buffer descriptor format
typedef struct typedef struct {
{ WORD m_wStatus; // control / status --- used by edrv, do not change in application
WORD m_wStatus; // control / status --- used by edrv, do not change in application WORD m_wLength; // transfer length
WORD m_wLength; // transfer length BYTE *m_pbData; // buffer address
BYTE * m_pbData; // buffer address
} tBufferDescr; } tBufferDescr;
#if ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5282) #if ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5282)
...@@ -119,8 +111,4 @@ typedef struct ...@@ -119,8 +111,4 @@ typedef struct
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EDRV_FEC_H_
#endif // #ifndef _EDRV_FEC_H_
...@@ -73,94 +73,93 @@ ...@@ -73,94 +73,93 @@
#ifndef _EDRVFEC_H_ #ifndef _EDRVFEC_H_
#define _EDRVFEC_H_ #define _EDRVFEC_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// base addresses // base addresses
#define FEC0_ADDR 0x0000 #define FEC0_ADDR 0x0000
#define FEC1_ADDR 0x0000 //tbd #define FEC1_ADDR 0x0000 //tbd
// control / status registers // control / status registers
#define FEC_EIR 0x1004 // interrupt event register #define FEC_EIR 0x1004 // interrupt event register
#define FEC_EIMR 0x1008 // interrupt mask register #define FEC_EIMR 0x1008 // interrupt mask register
#define FEC_RDAR 0x1010 // receive descriptor active register #define FEC_RDAR 0x1010 // receive descriptor active register
#define FEC_TDAR 0x1014 // transmit descriptor active register #define FEC_TDAR 0x1014 // transmit descriptor active register
#define FEC_ECR 0x1024 // ethernet control register #define FEC_ECR 0x1024 // ethernet control register
#define FEC_MMFR 0x1040 // MII data register #define FEC_MMFR 0x1040 // MII data register
#define FEC_MSCR 0x1044 // MII speed register #define FEC_MSCR 0x1044 // MII speed register
#define FEC_MIBC 0x1064 // MIB control/status register #define FEC_MIBC 0x1064 // MIB control/status register
#define FEC_RCR 0x1084 // receive control register #define FEC_RCR 0x1084 // receive control register
#define FEC_TCR 0x10C4 // transmit control register #define FEC_TCR 0x10C4 // transmit control register
#define FEC_PALR 0x10E4 // physical address low register #define FEC_PALR 0x10E4 // physical address low register
#define FEC_PAUR 0x10E8 // physical address high + type register #define FEC_PAUR 0x10E8 // physical address high + type register
#define FEC_OPD 0x10EC // opcode + pause register #define FEC_OPD 0x10EC // opcode + pause register
#define FEC_IAUR 0x1118 // upper 32 bit of individual hash table #define FEC_IAUR 0x1118 // upper 32 bit of individual hash table
#define FEC_IALR 0x111C // lower 32 bit of individual hash table #define FEC_IALR 0x111C // lower 32 bit of individual hash table
#define FEC_GAUR 0x1120 // upper 32 bit of group hash table #define FEC_GAUR 0x1120 // upper 32 bit of group hash table
#define FEC_GALR 0x1124 // lower 32 bit of group hash table #define FEC_GALR 0x1124 // lower 32 bit of group hash table
#define FEC_TFWR 0x1144 // transmit FIFO watermark #define FEC_TFWR 0x1144 // transmit FIFO watermark
#define FEC_FRBR 0x114C // FIFO receive bound register #define FEC_FRBR 0x114C // FIFO receive bound register
#define FEC_FRSR 0x1150 // FIFO receive FIFO start register #define FEC_FRSR 0x1150 // FIFO receive FIFO start register
#define FEC_ERDSR 0x1180 // pointer to receive descriptor ring #define FEC_ERDSR 0x1180 // pointer to receive descriptor ring
#define FEC_ETDSR 0x1184 // pointer to transmit descriptor ring #define FEC_ETDSR 0x1184 // pointer to transmit descriptor ring
#define FEC_EMRBR 0x1188 // maximum receive buffer size #define FEC_EMRBR 0x1188 // maximum receive buffer size
// mib block counters memory map // mib block counters memory map
#define FEC_RMON_T_DROP 0x1200 // count of frames not counted correctly #define FEC_RMON_T_DROP 0x1200 // count of frames not counted correctly
#define FEC_RMON_T_PACKETS 0x1204 // RMON tx packet count #define FEC_RMON_T_PACKETS 0x1204 // RMON tx packet count
#define FEC_RMON_T_BC_PKT 0x1208 // RMON tx broadcast packets #define FEC_RMON_T_BC_PKT 0x1208 // RMON tx broadcast packets
#define FEC_RMON_T_MC_PKT 0x120C // RMON tx multicast packets #define FEC_RMON_T_MC_PKT 0x120C // RMON tx multicast packets
#define FEC_RMON_T_CRC_ALIGN 0x1210 // RMON tx packets w CRC/align error #define FEC_RMON_T_CRC_ALIGN 0x1210 // RMON tx packets w CRC/align error
#define FEC_RMON_T_UNDERSIZE 0x1214 // RMON tx packets < 64 bytes, good CRC #define FEC_RMON_T_UNDERSIZE 0x1214 // RMON tx packets < 64 bytes, good CRC
#define FEC_RMON_T_OVERSIZE 0x1218 // RMON tx packets > MAX_FL bytes, good CRC #define FEC_RMON_T_OVERSIZE 0x1218 // RMON tx packets > MAX_FL bytes, good CRC
#define FEC_RMON_T_FRAG 0x121C // RMON tx packets < 64 bytes, bad CRC #define FEC_RMON_T_FRAG 0x121C // RMON tx packets < 64 bytes, bad CRC
#define FEC_RMON_T_JAB 0x1220 // RMON tx packets > MAX_FL bytes, bad CRC #define FEC_RMON_T_JAB 0x1220 // RMON tx packets > MAX_FL bytes, bad CRC
#define FEC_RMON_T_COL 0x1224 // RMON tx collision count #define FEC_RMON_T_COL 0x1224 // RMON tx collision count
#define FEC_RMON_T_P64 0x1228 // RMON tx 64 byte packets #define FEC_RMON_T_P64 0x1228 // RMON tx 64 byte packets
#define FEC_RMON_T_P65TO127 0x122C // RMON tx 65 to 127 byte packets #define FEC_RMON_T_P65TO127 0x122C // RMON tx 65 to 127 byte packets
#define FEC_RMON_T_P128TO255 0x1230 // RMON tx 128 to 255 byte packets #define FEC_RMON_T_P128TO255 0x1230 // RMON tx 128 to 255 byte packets
#define FEC_RMON_T_P256TO511 0x1234 // RMON tx 256 to 511 byte packets #define FEC_RMON_T_P256TO511 0x1234 // RMON tx 256 to 511 byte packets
#define FEC_RMON_T_P512TO1023 0x1238 // RMON tx 512 to 1023 byte packets #define FEC_RMON_T_P512TO1023 0x1238 // RMON tx 512 to 1023 byte packets
#define FEC_RMON_T_P1024TO2047 0x123C // RMON tx 1024 to 2047 byte packets #define FEC_RMON_T_P1024TO2047 0x123C // RMON tx 1024 to 2047 byte packets
#define FEC_RMON_T_P_GTE2048 0x1240 // RMON tx w > 2048 bytes #define FEC_RMON_T_P_GTE2048 0x1240 // RMON tx w > 2048 bytes
#define FEC_RMON_T_OCTETS 0x1244 // RMON tx octets #define FEC_RMON_T_OCTETS 0x1244 // RMON tx octets
#define FEC_IEEE_T_DROP 0x1248 // count of frames not counted correctly #define FEC_IEEE_T_DROP 0x1248 // count of frames not counted correctly
#define FEC_IEEE_T_FRAME_OK 0x124C // frames transmitted OK #define FEC_IEEE_T_FRAME_OK 0x124C // frames transmitted OK
#define FEC_IEEE_T_1COL 0x1250 // frames transmitted with single collision #define FEC_IEEE_T_1COL 0x1250 // frames transmitted with single collision
#define FEC_IEEE_T_MCOL 0x1254 // frames transmitted with multiple collisions #define FEC_IEEE_T_MCOL 0x1254 // frames transmitted with multiple collisions
#define FEC_IEEE_T_DEF 0x1258 // frames transmitted after deferral delay #define FEC_IEEE_T_DEF 0x1258 // frames transmitted after deferral delay
#define FEC_IEEE_T_LCOL 0x125C // frames transmitted with late collisions #define FEC_IEEE_T_LCOL 0x125C // frames transmitted with late collisions
#define FEC_IEEE_T_EXCOL 0x1260 // frames transmitted with excessive collisions #define FEC_IEEE_T_EXCOL 0x1260 // frames transmitted with excessive collisions
#define FEC_IEEE_T_MACERR 0x1264 // frames transmitted with tx-FIFO underrun #define FEC_IEEE_T_MACERR 0x1264 // frames transmitted with tx-FIFO underrun
#define FEC_IEEE_T_CSERR 0x1268 // frames transmitted with carrier sense error #define FEC_IEEE_T_CSERR 0x1268 // frames transmitted with carrier sense error
#define FEC_IEEE_T_SQE 0x126C // frames transmitted with SQE error #define FEC_IEEE_T_SQE 0x126C // frames transmitted with SQE error
#define FEC_IEEE_T_FDXFC 0x1270 // flow control pause frames transmitted #define FEC_IEEE_T_FDXFC 0x1270 // flow control pause frames transmitted
#define FEC_IEEE_T_OCTETS_OK 0x1274 // octet count for frames transmitted w/o error #define FEC_IEEE_T_OCTETS_OK 0x1274 // octet count for frames transmitted w/o error
#define FEC_RMON_R_PACKETS 0x1284 // RMON rx packet count #define FEC_RMON_R_PACKETS 0x1284 // RMON rx packet count
#define FEC_RMON_R_BC_PKT 0x1288 // RMON rx broadcast packets #define FEC_RMON_R_BC_PKT 0x1288 // RMON rx broadcast packets
#define FEC_RMON_R_MC_PKT 0x128C // RMON rx multicast packets #define FEC_RMON_R_MC_PKT 0x128C // RMON rx multicast packets
#define FEC_RMON_R_CRC_ALIGN 0x1290 // RMON rx packets w CRC/align error #define FEC_RMON_R_CRC_ALIGN 0x1290 // RMON rx packets w CRC/align error
#define FEC_RMON_R_UNDERSIZE 0x1294 // RMON rx packets < 64 bytes, good CRC #define FEC_RMON_R_UNDERSIZE 0x1294 // RMON rx packets < 64 bytes, good CRC
#define FEC_RMON_R_OVERSIZE 0x1298 // RMON rx packets > MAX_FL bytes, good CRC #define FEC_RMON_R_OVERSIZE 0x1298 // RMON rx packets > MAX_FL bytes, good CRC
#define FEC_RMON_R_FRAG 0x129C // RMON rx packets < 64 bytes, bad CRC #define FEC_RMON_R_FRAG 0x129C // RMON rx packets < 64 bytes, bad CRC
#define FEC_RMON_R_JAB 0x12A0 // RMON rx packets > MAX_FL bytes, bad CRC #define FEC_RMON_R_JAB 0x12A0 // RMON rx packets > MAX_FL bytes, bad CRC
#define FEC_RMON_R_RESVD_0 0x12A4 // #define FEC_RMON_R_RESVD_0 0x12A4 //
#define FEC_RMON_R_P64 0x12A8 // RMON rx 64 byte packets #define FEC_RMON_R_P64 0x12A8 // RMON rx 64 byte packets
#define FEC_RMON_R_P65T0127 0x12AC // RMON rx 65 to 127 byte packets #define FEC_RMON_R_P65T0127 0x12AC // RMON rx 65 to 127 byte packets
#define FEC_RMON_R_P128TO255 0x12B0 // RMON rx 128 to 255 byte packets #define FEC_RMON_R_P128TO255 0x12B0 // RMON rx 128 to 255 byte packets
#define FEC_RMON_R_P256TO511 0x12B4 // RMON rx 256 to 511 byte packets #define FEC_RMON_R_P256TO511 0x12B4 // RMON rx 256 to 511 byte packets
#define FEC_RMON_R_P512TO1023 0x12B8 // RMON rx 512 to 1023 byte packets #define FEC_RMON_R_P512TO1023 0x12B8 // RMON rx 512 to 1023 byte packets
#define FEC_RMON_R_P1024TO2047 0x12BC // RMON rx 1024 to 2047 byte packets #define FEC_RMON_R_P1024TO2047 0x12BC // RMON rx 1024 to 2047 byte packets
#define FEC_RMON_R_GTE2048 0x12C0 // RMON rx w > 2048 bytes #define FEC_RMON_R_GTE2048 0x12C0 // RMON rx w > 2048 bytes
#define FEC_RMON_R_OCTETS 0x12C4 // RMON rx octets #define FEC_RMON_R_OCTETS 0x12C4 // RMON rx octets
#define FEC_IEEE_R_DROP 0x12C8 // count of frames not counted correctly #define FEC_IEEE_R_DROP 0x12C8 // count of frames not counted correctly
#define FEC_IEEE_R_FRAME_OK 0x12CC // frames received OK #define FEC_IEEE_R_FRAME_OK 0x12CC // frames received OK
#define FEC_IEEE_R_CRC 0x12D0 // frames received with CRC error #define FEC_IEEE_R_CRC 0x12D0 // frames received with CRC error
#define FEC_IEEE_R_ALIGN 0x12D4 // frames received with alignment error #define FEC_IEEE_R_ALIGN 0x12D4 // frames received with alignment error
#define FEC_IEEE_R_MACERR 0x12D8 // receive FIFO overflow count #define FEC_IEEE_R_MACERR 0x12D8 // receive FIFO overflow count
#define FEC_IEEE_R_FDXFC 0x12DC // flow control pause frames received #define FEC_IEEE_R_FDXFC 0x12DC // flow control pause frames received
#define FEC_IEEE_R_OCTETS_OK 0x12E0 // octet count for frames rcvd w/o error #define FEC_IEEE_R_OCTETS_OK 0x12E0 // octet count for frames rcvd w/o error
// register bit definitions and macros // register bit definitions and macros
#define FEC_EIR_UN (0x00080000) #define FEC_EIR_UN (0x00080000)
...@@ -315,11 +314,10 @@ ...@@ -315,11 +314,10 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Rx and Tx buffer descriptor format // Rx and Tx buffer descriptor format
typedef struct typedef struct {
{ WORD m_wStatus; // control / status --- used by edrv, do not change in application
WORD m_wStatus; // control / status --- used by edrv, do not change in application WORD m_wLength; // transfer length
WORD m_wLength; // transfer length BYTE *m_pbData; // buffer address
BYTE * m_pbData; // buffer address
} tBufferDescr; } tBufferDescr;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -327,21 +325,16 @@ typedef struct ...@@ -327,21 +325,16 @@ typedef struct
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#if (NO_OF_INSTANCES > 1) #if (NO_OF_INSTANCES > 1)
#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[off]) = val) #define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[off]) = val)
#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[off])) #define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[off]))
#else
#if (EDRV_USED_ETH_CTRL == 0)
#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]) = val)
#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]))
#else #else
#if (EDRV_USED_ETH_CTRL == 0) #define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]) = val)
#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]) = val) #define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]))
#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off])) #endif
#else
#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]) = val)
#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]))
#endif
#endif #endif
#endif // #ifndef _EDRV_FEC_H_
#endif // #ifndef _EDRV_FEC_H_
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
#ifndef _EDRVSIM_H_ #ifndef _EDRVSIM_H_
#define _EDRVSIM_H_ #define _EDRVSIM_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -80,15 +79,11 @@ ...@@ -80,15 +79,11 @@
// types // types
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void EdrvRxInterruptHandler (BYTE bBufferInFrame_p, BYTE * pbEthernetData_p, WORD wDataLen_p); void EdrvRxInterruptHandler(BYTE bBufferInFrame_p, BYTE * pbEthernetData_p,
WORD wDataLen_p);
#endif // #ifndef _EDRVSIM_H_
#endif // #ifndef _EDRVSIM_H_
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
2006/05/22 d.k.: start of the implementation, version 1.00 2006/05/22 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_API_H_ #ifndef _EPL_API_H_
...@@ -82,223 +81,193 @@ ...@@ -82,223 +81,193 @@
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef struct {
typedef struct unsigned int m_uiNodeId;
{ tEplNmtState m_NmtState;
unsigned int m_uiNodeId; tEplNmtNodeEvent m_NodeEvent;
tEplNmtState m_NmtState; WORD m_wErrorCode; // EPL error code if m_NodeEvent == kEplNmtNodeEventError
tEplNmtNodeEvent m_NodeEvent; BOOL m_fMandatory;
WORD m_wErrorCode; // EPL error code if m_NodeEvent == kEplNmtNodeEventError
BOOL m_fMandatory;
} tEplApiEventNode; } tEplApiEventNode;
typedef struct {
typedef struct tEplNmtState m_NmtState; // local NMT state
{ tEplNmtBootEvent m_BootEvent;
tEplNmtState m_NmtState; // local NMT state WORD m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError
tEplNmtBootEvent m_BootEvent;
WORD m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError
} tEplApiEventBoot; } tEplApiEventBoot;
typedef struct {
typedef struct tEplLedType m_LedType; // type of the LED (e.g. Status or Error)
{ BOOL m_fOn; // state of the LED (e.g. on or off)
tEplLedType m_LedType; // type of the LED (e.g. Status or Error)
BOOL m_fOn; // state of the LED (e.g. on or off)
} tEplApiEventLed; } tEplApiEventLed;
typedef enum {
typedef enum kEplApiEventNmtStateChange = 0x10, // m_NmtStateChange
{
kEplApiEventNmtStateChange = 0x10, // m_NmtStateChange
// kEplApiEventRequestNmt = 0x11, // m_bNmtCmd // kEplApiEventRequestNmt = 0x11, // m_bNmtCmd
kEplApiEventCriticalError = 0x12, // m_InternalError, Stack halted kEplApiEventCriticalError = 0x12, // m_InternalError, Stack halted
kEplApiEventWarning = 0x13, // m_InternalError, Stack running kEplApiEventWarning = 0x13, // m_InternalError, Stack running
kEplApiEventNode = 0x20, // m_Node kEplApiEventNode = 0x20, // m_Node
kEplApiEventBoot = 0x21, // m_Boot kEplApiEventBoot = 0x21, // m_Boot
kEplApiEventSdo = 0x62, // m_Sdo kEplApiEventSdo = 0x62, // m_Sdo
kEplApiEventObdAccess = 0x69, // m_ObdCbParam kEplApiEventObdAccess = 0x69, // m_ObdCbParam
kEplApiEventLed = 0x70, // m_Led kEplApiEventLed = 0x70, // m_Led
} tEplApiEventType; } tEplApiEventType;
typedef union {
typedef union tEplEventNmtStateChange m_NmtStateChange;
{ tEplEventError m_InternalError;
tEplEventNmtStateChange m_NmtStateChange; tEplSdoComFinished m_Sdo;
tEplEventError m_InternalError; tEplObdCbParam m_ObdCbParam;
tEplSdoComFinished m_Sdo; tEplApiEventNode m_Node;
tEplObdCbParam m_ObdCbParam; tEplApiEventBoot m_Boot;
tEplApiEventNode m_Node; tEplApiEventLed m_Led;
tEplApiEventBoot m_Boot;
tEplApiEventLed m_Led;
} tEplApiEventArg; } tEplApiEventArg;
typedef tEplKernel(PUBLIC ROM * tEplApiCbEvent) (tEplApiEventType EventType_p, // IN: event type (enum)
typedef tEplKernel (PUBLIC ROM* tEplApiCbEvent) ( tEplApiEventArg * pEventArg_p, // IN: event argument (union)
tEplApiEventType EventType_p, // IN: event type (enum) void GENERIC * pUserArg_p);
tEplApiEventArg* pEventArg_p, // IN: event argument (union)
void GENERIC* pUserArg_p); typedef struct {
unsigned int m_uiSizeOfStruct;
BOOL m_fAsyncOnly; // do not need to register PRes
typedef struct unsigned int m_uiNodeId; // local node ID
{ BYTE m_abMacAddress[6]; // local MAC address
unsigned int m_uiSizeOfStruct;
BOOL m_fAsyncOnly; // do not need to register PRes // 0x1F82: NMT_FeatureFlags_U32
unsigned int m_uiNodeId; // local node ID DWORD m_dwFeatureFlags;
BYTE m_abMacAddress[6]; // local MAC address // Cycle Length (0x1006: NMT_CycleLen_U32) in [us]
DWORD m_dwCycleLen; // required for error detection
// 0x1F82: NMT_FeatureFlags_U32 // 0x1F98: NMT_CycleTiming_REC
DWORD m_dwFeatureFlags; // 0x1F98.1: IsochrTxMaxPayload_U16
// Cycle Length (0x1006: NMT_CycleLen_U32) in [us] unsigned int m_uiIsochrTxMaxPayload; // const
DWORD m_dwCycleLen; // required for error detection // 0x1F98.2: IsochrRxMaxPayload_U16
// 0x1F98: NMT_CycleTiming_REC unsigned int m_uiIsochrRxMaxPayload; // const
// 0x1F98.1: IsochrTxMaxPayload_U16 // 0x1F98.3: PResMaxLatency_U32
unsigned int m_uiIsochrTxMaxPayload; // const DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes
// 0x1F98.2: IsochrRxMaxPayload_U16 // 0x1F98.4: PReqActPayloadLimit_U16
unsigned int m_uiIsochrRxMaxPayload; // const unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+28 bytes)
// 0x1F98.3: PResMaxLatency_U32 // 0x1F98.5: PResActPayloadLimit_U16
DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+28 bytes)
// 0x1F98.4: PReqActPayloadLimit_U16 // 0x1F98.6: ASndMaxLatency_U32
unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+28 bytes) DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes
// 0x1F98.5: PResActPayloadLimit_U16 // 0x1F98.7: MultiplCycleCnt_U8
unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+28 bytes) unsigned int m_uiMultiplCycleCnt; // required for error detection
// 0x1F98.6: ASndMaxLatency_U32 // 0x1F98.8: AsyncMTU_U16
DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes unsigned int m_uiAsyncMtu; // required to set up max frame size
// 0x1F98.7: MultiplCycleCnt_U8 // 0x1F98.9: Prescaler_U16
unsigned int m_uiMultiplCycleCnt; // required for error detection unsigned int m_uiPrescaler; // required for sync
// 0x1F98.8: AsyncMTU_U16 // $$$ Multiplexed Slot
unsigned int m_uiAsyncMtu; // required to set up max frame size
// 0x1F98.9: Prescaler_U16 // 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns]
unsigned int m_uiPrescaler; // required for sync DWORD m_dwLossOfFrameTolerance;
// $$$ Multiplexed Slot
// 0x1F8A: NMT_MNCycleTiming_REC
// 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns] // 0x1F8A.1: WaitSoCPReq_U32 in [ns]
DWORD m_dwLossOfFrameTolerance; DWORD m_dwWaitSocPreq;
// 0x1F8A: NMT_MNCycleTiming_REC // 0x1F8A.2: AsyncSlotTimeout_U32 in [ns]
// 0x1F8A.1: WaitSoCPReq_U32 in [ns] DWORD m_dwAsyncSlotTimeout;
DWORD m_dwWaitSocPreq;
DWORD m_dwDeviceType; // NMT_DeviceType_U32
// 0x1F8A.2: AsyncSlotTimeout_U32 in [ns] DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32
DWORD m_dwAsyncSlotTimeout; DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32
DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32
DWORD m_dwDeviceType; // NMT_DeviceType_U32 DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32
DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32 QWORD m_qwVendorSpecificExt1;
DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32 DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32
DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32 DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32
DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32 DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device
QWORD m_qwVendorSpecificExt1; DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device
DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32 DWORD m_dwIpAddress;
DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32 DWORD m_dwSubnetMask;
DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device DWORD m_dwDefaultGateway;
DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device BYTE m_sHostname[32];
DWORD m_dwIpAddress; BYTE m_abVendorSpecificExt2[48];
DWORD m_dwSubnetMask;
DWORD m_dwDefaultGateway; char *m_pszDevName; // NMT_ManufactDevName_VS (0x1008/0 local OD)
BYTE m_sHostname[32]; char *m_pszHwVersion; // NMT_ManufactHwVers_VS (0x1009/0 local OD)
BYTE m_abVendorSpecificExt2[48]; char *m_pszSwVersion; // NMT_ManufactSwVers_VS (0x100A/0 local OD)
char* m_pszDevName; // NMT_ManufactDevName_VS (0x1008/0 local OD) tEplApiCbEvent m_pfnCbEvent;
char* m_pszHwVersion; // NMT_ManufactHwVers_VS (0x1009/0 local OD) void *m_pEventUserArg;
char* m_pszSwVersion; // NMT_ManufactSwVers_VS (0x100A/0 local OD) tEplSyncCb m_pfnCbSync;
tEplApiCbEvent m_pfnCbEvent;
void* m_pEventUserArg;
tEplSyncCb m_pfnCbSync;
} tEplApiInitParam; } tEplApiInitParam;
typedef struct {
typedef struct void *m_pImage;
{ unsigned int m_uiSize;
void* m_pImage;
unsigned int m_uiSize;
} tEplApiProcessImage; } tEplApiProcessImage;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
tEplKernel PUBLIC EplApiInitialize(tEplApiInitParam* pInitParam_p); tEplKernel PUBLIC EplApiInitialize(tEplApiInitParam * pInitParam_p);
tEplKernel PUBLIC EplApiShutdown(void); tEplKernel PUBLIC EplApiShutdown(void);
tEplKernel PUBLIC EplApiReadObject( tEplKernel PUBLIC EplApiReadObject(tEplSdoComConHdl * pSdoComConHdl_p,
tEplSdoComConHdl* pSdoComConHdl_p, unsigned int uiNodeId_p,
unsigned int uiNodeId_p, unsigned int uiIndex_p,
unsigned int uiIndex_p, unsigned int uiSubindex_p,
unsigned int uiSubindex_p, void *pDstData_le_p,
void* pDstData_le_p, unsigned int *puiSize_p,
unsigned int* puiSize_p, tEplSdoType SdoType_p, void *pUserArg_p);
tEplSdoType SdoType_p,
void* pUserArg_p); tEplKernel PUBLIC EplApiWriteObject(tEplSdoComConHdl * pSdoComConHdl_p,
unsigned int uiNodeId_p,
tEplKernel PUBLIC EplApiWriteObject( unsigned int uiIndex_p,
tEplSdoComConHdl* pSdoComConHdl_p, unsigned int uiSubindex_p,
unsigned int uiNodeId_p, void *pSrcData_le_p,
unsigned int uiIndex_p, unsigned int uiSize_p,
unsigned int uiSubindex_p, tEplSdoType SdoType_p, void *pUserArg_p);
void* pSrcData_le_p,
unsigned int uiSize_p, tEplKernel PUBLIC EplApiFreeSdoChannel(tEplSdoComConHdl SdoComConHdl_p);
tEplSdoType SdoType_p,
void* pUserArg_p); tEplKernel PUBLIC EplApiReadLocalObject(unsigned int uiIndex_p,
unsigned int uiSubindex_p,
tEplKernel PUBLIC EplApiFreeSdoChannel( void *pDstData_p,
tEplSdoComConHdl SdoComConHdl_p); unsigned int *puiSize_p);
tEplKernel PUBLIC EplApiReadLocalObject( tEplKernel PUBLIC EplApiWriteLocalObject(unsigned int uiIndex_p,
unsigned int uiIndex_p, unsigned int uiSubindex_p,
unsigned int uiSubindex_p, void *pSrcData_p,
void* pDstData_p, unsigned int uiSize_p);
unsigned int* puiSize_p);
tEplKernel PUBLIC EplApiCbObdAccess(tEplObdCbParam MEM * pParam_p);
tEplKernel PUBLIC EplApiWriteLocalObject(
unsigned int uiIndex_p, tEplKernel PUBLIC EplApiLinkObject(unsigned int uiObjIndex_p,
unsigned int uiSubindex_p, void *pVar_p,
void* pSrcData_p, unsigned int *puiVarEntries_p,
unsigned int uiSize_p); tEplObdSize * pEntrySize_p,
unsigned int uiFirstSubindex_p);
tEplKernel PUBLIC EplApiCbObdAccess(tEplObdCbParam MEM* pParam_p);
tEplKernel PUBLIC EplApiLinkObject( unsigned int uiObjIndex_p,
void* pVar_p,
unsigned int* puiVarEntries_p,
tEplObdSize* pEntrySize_p,
unsigned int uiFirstSubindex_p);
tEplKernel PUBLIC EplApiExecNmtCommand(tEplNmtEvent NmtEvent_p); tEplKernel PUBLIC EplApiExecNmtCommand(tEplNmtEvent NmtEvent_p);
tEplKernel PUBLIC EplApiProcess(void); tEplKernel PUBLIC EplApiProcess(void);
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
tEplKernel PUBLIC EplApiMnTriggerStateChange(unsigned int uiNodeId_p, tEplKernel PUBLIC EplApiMnTriggerStateChange(unsigned int uiNodeId_p,
tEplNmtNodeCommand NodeCommand_p); tEplNmtNodeCommand NodeCommand_p);
#endif #endif
tEplKernel PUBLIC EplApiGetIdentResponse( tEplKernel PUBLIC EplApiGetIdentResponse(unsigned int uiNodeId_p,
unsigned int uiNodeId_p, tEplIdentResponse **
tEplIdentResponse** ppIdentResponse_p); ppIdentResponse_p);
// functions for process image will be implemented in separate file // functions for process image will be implemented in separate file
tEplKernel PUBLIC EplApiProcessImageSetup(void); tEplKernel PUBLIC EplApiProcessImageSetup(void);
tEplKernel PUBLIC EplApiProcessImageExchangeIn(tEplApiProcessImage* pPI_p); tEplKernel PUBLIC EplApiProcessImageExchangeIn(tEplApiProcessImage * pPI_p);
tEplKernel PUBLIC EplApiProcessImageExchangeOut(tEplApiProcessImage* pPI_p); tEplKernel PUBLIC EplApiProcessImageExchangeOut(tEplApiProcessImage * pPI_p);
#endif // #ifndef _EPL_API_H_
#endif // #ifndef _EPL_API_H_
...@@ -86,46 +86,43 @@ ...@@ -86,46 +86,43 @@
#ifndef _EPLAMI_H_ #ifndef _EPLAMI_H_
#define _EPLAMI_H_ #define _EPLAMI_H_
#if ((DEV_SYSTEM & _DEV_64BIT_SUPPORT_) == 0) #if ((DEV_SYSTEM & _DEV_64BIT_SUPPORT_) == 0)
// #ifdef USE_VAR64 // #ifdef USE_VAR64
#error 'ERROR: development system does not support 64 bit operations!' #error 'ERROR: development system does not support 64 bit operations!'
// #endif // #endif
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// types // types
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Prototypen // Prototypen
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if (TARGET_SYSTEM == _WIN32_) #if (TARGET_SYSTEM == _WIN32_)
#if defined(INLINE_FUNCTION_DEF) #if defined(INLINE_FUNCTION_DEF)
#undef INLINE_FUNCTION #undef INLINE_FUNCTION
#define INLINE_FUNCTION INLINE_FUNCTION_DEF #define INLINE_FUNCTION INLINE_FUNCTION_DEF
#define INLINE_ENABLED TRUE #define INLINE_ENABLED TRUE
#define EPL_AMI_INLINED #define EPL_AMI_INLINED
#include "../EplStack/amix86.c" #include "../EplStack/amix86.c"
#endif #endif
#elif (TARGET_SYSTEM == _LINUX_) #elif (TARGET_SYSTEM == _LINUX_)
#if defined(__m68k__) // it is an big endian machine #if defined(__m68k__) // it is an big endian machine
#if defined(INLINE_FUNCTION_DEF) #if defined(INLINE_FUNCTION_DEF)
#undef INLINE_FUNCTION #undef INLINE_FUNCTION
#define INLINE_FUNCTION INLINE_FUNCTION_DEF #define INLINE_FUNCTION INLINE_FUNCTION_DEF
#define INLINE_ENABLED TRUE #define INLINE_ENABLED TRUE
#define EPL_AMI_INLINED #define EPL_AMI_INLINED
#include "../EplStack/amibe.c" #include "../EplStack/amibe.c"
#endif #endif
#endif #endif
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -140,13 +137,12 @@ ...@@ -140,13 +137,12 @@
#define AmiSetByteToLe(pAddr_p, bByteVal_p) {*(BYTE FAR*)(pAddr_p) = (bByteVal_p);} #define AmiSetByteToLe(pAddr_p, bByteVal_p) {*(BYTE FAR*)(pAddr_p) = (bByteVal_p);}
#if !defined(INLINE_ENABLED) #if !defined(INLINE_ENABLED)
void PUBLIC AmiSetWordToBe (void FAR* pAddr_p, WORD wWordVal_p); void PUBLIC AmiSetWordToBe(void FAR * pAddr_p, WORD wWordVal_p);
void PUBLIC AmiSetDwordToBe (void FAR* pAddr_p, DWORD dwDwordVal_p); void PUBLIC AmiSetDwordToBe(void FAR * pAddr_p, DWORD dwDwordVal_p);
void PUBLIC AmiSetWordToLe (void FAR* pAddr_p, WORD wWordVal_p); void PUBLIC AmiSetWordToLe(void FAR * pAddr_p, WORD wWordVal_p);
void PUBLIC AmiSetDwordToLe (void FAR* pAddr_p, DWORD dwDwordVal_p); void PUBLIC AmiSetDwordToLe(void FAR * pAddr_p, DWORD dwDwordVal_p);
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// read functions // read functions
...@@ -160,10 +156,10 @@ void PUBLIC AmiSetDwordToLe (void FAR* pAddr_p, DWORD dwDwordVal_p); ...@@ -160,10 +156,10 @@ void PUBLIC AmiSetDwordToLe (void FAR* pAddr_p, DWORD dwDwordVal_p);
#if !defined(INLINE_ENABLED) #if !defined(INLINE_ENABLED)
WORD PUBLIC AmiGetWordFromBe (void FAR* pAddr_p); WORD PUBLIC AmiGetWordFromBe(void FAR * pAddr_p);
DWORD PUBLIC AmiGetDwordFromBe (void FAR* pAddr_p); DWORD PUBLIC AmiGetDwordFromBe(void FAR * pAddr_p);
WORD PUBLIC AmiGetWordFromLe (void FAR* pAddr_p); WORD PUBLIC AmiGetWordFromLe(void FAR * pAddr_p);
DWORD PUBLIC AmiGetDwordFromLe (void FAR* pAddr_p); DWORD PUBLIC AmiGetDwordFromLe(void FAR * pAddr_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -178,9 +174,8 @@ DWORD PUBLIC AmiGetDwordFromLe (void FAR* pAddr_p); ...@@ -178,9 +174,8 @@ DWORD PUBLIC AmiGetDwordFromLe (void FAR* pAddr_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiSetDword24ToBe (void FAR* pAddr_p, DWORD dwDwordVal_p); void PUBLIC AmiSetDword24ToBe(void FAR * pAddr_p, DWORD dwDwordVal_p);
void PUBLIC AmiSetDword24ToLe (void FAR* pAddr_p, DWORD dwDwordVal_p); void PUBLIC AmiSetDword24ToLe(void FAR * pAddr_p, DWORD dwDwordVal_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -194,9 +189,8 @@ void PUBLIC AmiSetDword24ToLe (void FAR* pAddr_p, DWORD dwDwordVal_p); ...@@ -194,9 +189,8 @@ void PUBLIC AmiSetDword24ToLe (void FAR* pAddr_p, DWORD dwDwordVal_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
DWORD PUBLIC AmiGetDword24FromBe (void FAR* pAddr_p); DWORD PUBLIC AmiGetDword24FromBe(void FAR * pAddr_p);
DWORD PUBLIC AmiGetDword24FromLe (void FAR* pAddr_p); DWORD PUBLIC AmiGetDword24FromLe(void FAR * pAddr_p);
//#ifdef USE_VAR64 //#ifdef USE_VAR64
...@@ -213,9 +207,8 @@ DWORD PUBLIC AmiGetDword24FromLe (void FAR* pAddr_p); ...@@ -213,9 +207,8 @@ DWORD PUBLIC AmiGetDword24FromLe (void FAR* pAddr_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiSetQword40ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword40ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);
void PUBLIC AmiSetQword40ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword40ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -229,9 +222,8 @@ void PUBLIC AmiSetQword40ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); ...@@ -229,9 +222,8 @@ void PUBLIC AmiSetQword40ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
QWORD PUBLIC AmiGetQword40FromBe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword40FromBe(void FAR * pAddr_p);
QWORD PUBLIC AmiGetQword40FromLe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword40FromLe(void FAR * pAddr_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -246,9 +238,8 @@ QWORD PUBLIC AmiGetQword40FromLe (void FAR* pAddr_p); ...@@ -246,9 +238,8 @@ QWORD PUBLIC AmiGetQword40FromLe (void FAR* pAddr_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiSetQword48ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword48ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);
void PUBLIC AmiSetQword48ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword48ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -262,9 +253,8 @@ void PUBLIC AmiSetQword48ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); ...@@ -262,9 +253,8 @@ void PUBLIC AmiSetQword48ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
QWORD PUBLIC AmiGetQword48FromBe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword48FromBe(void FAR * pAddr_p);
QWORD PUBLIC AmiGetQword48FromLe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword48FromLe(void FAR * pAddr_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -279,9 +269,8 @@ QWORD PUBLIC AmiGetQword48FromLe (void FAR* pAddr_p); ...@@ -279,9 +269,8 @@ QWORD PUBLIC AmiGetQword48FromLe (void FAR* pAddr_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiSetQword56ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword56ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);
void PUBLIC AmiSetQword56ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword56ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -295,9 +284,8 @@ void PUBLIC AmiSetQword56ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); ...@@ -295,9 +284,8 @@ void PUBLIC AmiSetQword56ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
QWORD PUBLIC AmiGetQword56FromBe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword56FromBe(void FAR * pAddr_p);
QWORD PUBLIC AmiGetQword56FromLe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword56FromLe(void FAR * pAddr_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -312,9 +300,8 @@ QWORD PUBLIC AmiGetQword56FromLe (void FAR* pAddr_p); ...@@ -312,9 +300,8 @@ QWORD PUBLIC AmiGetQword56FromLe (void FAR* pAddr_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiSetQword64ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword64ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);
void PUBLIC AmiSetQword64ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); void PUBLIC AmiSetQword64ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -328,9 +315,8 @@ void PUBLIC AmiSetQword64ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p); ...@@ -328,9 +315,8 @@ void PUBLIC AmiSetQword64ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
QWORD PUBLIC AmiGetQword64FromBe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword64FromBe(void FAR * pAddr_p);
QWORD PUBLIC AmiGetQword64FromLe (void FAR* pAddr_p); QWORD PUBLIC AmiGetQword64FromLe(void FAR * pAddr_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -345,8 +331,8 @@ QWORD PUBLIC AmiGetQword64FromLe (void FAR* pAddr_p); ...@@ -345,8 +331,8 @@ QWORD PUBLIC AmiGetQword64FromLe (void FAR* pAddr_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiSetTimeOfDay (void FAR* pAddr_p, tTimeOfDay FAR* pTimeOfDay_p); void PUBLIC AmiSetTimeOfDay(void FAR * pAddr_p,
tTimeOfDay FAR * pTimeOfDay_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
...@@ -361,20 +347,16 @@ void PUBLIC AmiSetTimeOfDay (void FAR* pAddr_p, tTimeOfDay FAR* pTimeOfDay_p); ...@@ -361,20 +347,16 @@ void PUBLIC AmiSetTimeOfDay (void FAR* pAddr_p, tTimeOfDay FAR* pTimeOfDay_p);
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void PUBLIC AmiGetTimeOfDay (void FAR* pAddr_p, tTimeOfDay FAR* pTimeOfDay_p); void PUBLIC AmiGetTimeOfDay(void FAR * pAddr_p,
tTimeOfDay FAR * pTimeOfDay_p);
#endif #endif
#undef INLINE_ENABLED // disable actual inlining of functions
#undef INLINE_ENABLED // disable actual inlining of functions
#define EPL_AMI_INCLUDED #define EPL_AMI_INCLUDED
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // ifndef _EPLAMI_H_
// Die letzte Zeile mu unbedingt eine leere Zeile sein, weil manche Compiler// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).
#endif // ifndef _EPLAMI_H_
// Die letzte Zeile mu unbedingt eine leere Zeile sein, weil manche Compiler
// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).
...@@ -66,79 +66,71 @@ ...@@ -66,79 +66,71 @@
2006/10/11 d.k.: start of the implementation, version 1.00 2006/10/11 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_API_LINUX_H_ #ifndef _EPL_API_LINUX_H_
#define _EPL_API_LINUX_H_ #define _EPL_API_LINUX_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#define EPLLIN_DEV_NAME "epl" // used for "/dev" and "/proc" entry #define EPLLIN_DEV_NAME "epl" // used for "/dev" and "/proc" entry
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Commands for <ioctl> // Commands for <ioctl>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#define EPLLIN_CMD_INITIALIZE 0 // ulArg_p ~ tEplApiInitParam* #define EPLLIN_CMD_INITIALIZE 0 // ulArg_p ~ tEplApiInitParam*
#define EPLLIN_CMD_PI_IN 1 // ulArg_p ~ tEplApiProcessImage* #define EPLLIN_CMD_PI_IN 1 // ulArg_p ~ tEplApiProcessImage*
#define EPLLIN_CMD_PI_OUT 2 // ulArg_p ~ tEplApiProcessImage* #define EPLLIN_CMD_PI_OUT 2 // ulArg_p ~ tEplApiProcessImage*
#define EPLLIN_CMD_WRITE_OBJECT 3 // ulArg_p ~ tEplLinSdoObject* #define EPLLIN_CMD_WRITE_OBJECT 3 // ulArg_p ~ tEplLinSdoObject*
#define EPLLIN_CMD_READ_OBJECT 4 // ulArg_p ~ tEplLinSdoObject* #define EPLLIN_CMD_READ_OBJECT 4 // ulArg_p ~ tEplLinSdoObject*
#define EPLLIN_CMD_WRITE_LOCAL_OBJECT 5 // ulArg_p ~ tEplLinLocalObject* #define EPLLIN_CMD_WRITE_LOCAL_OBJECT 5 // ulArg_p ~ tEplLinLocalObject*
#define EPLLIN_CMD_READ_LOCAL_OBJECT 6 // ulArg_p ~ tEplLinLocalObject* #define EPLLIN_CMD_READ_LOCAL_OBJECT 6 // ulArg_p ~ tEplLinLocalObject*
#define EPLLIN_CMD_FREE_SDO_CHANNEL 7 // ulArg_p ~ tEplSdoComConHdl #define EPLLIN_CMD_FREE_SDO_CHANNEL 7 // ulArg_p ~ tEplSdoComConHdl
#define EPLLIN_CMD_NMT_COMMAND 8 // ulArg_p ~ tEplNmtEvent #define EPLLIN_CMD_NMT_COMMAND 8 // ulArg_p ~ tEplNmtEvent
#define EPLLIN_CMD_GET_EVENT 9 // ulArg_p ~ tEplLinEvent* #define EPLLIN_CMD_GET_EVENT 9 // ulArg_p ~ tEplLinEvent*
#define EPLLIN_CMD_MN_TRIGGER_STATE_CHANGE 10 // ulArg_p ~ tEplLinNodeCmdObject* #define EPLLIN_CMD_MN_TRIGGER_STATE_CHANGE 10 // ulArg_p ~ tEplLinNodeCmdObject*
#define EPLLIN_CMD_PI_SETUP 11 // ulArg_p ~ 0 #define EPLLIN_CMD_PI_SETUP 11 // ulArg_p ~ 0
#define EPLLIN_CMD_SHUTDOWN 12 // ulArg_p ~ 0 #define EPLLIN_CMD_SHUTDOWN 12 // ulArg_p ~ 0
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef struct typedef struct {
{ unsigned int m_uiEventArgSize;
unsigned int m_uiEventArgSize; tEplApiEventArg *m_pEventArg;
tEplApiEventArg* m_pEventArg; tEplApiEventType *m_pEventType;
tEplApiEventType* m_pEventType; tEplKernel m_RetCbEvent;
tEplKernel m_RetCbEvent;
} tEplLinEvent; } tEplLinEvent;
typedef struct typedef struct {
{ tEplSdoComConHdl m_SdoComConHdl;
tEplSdoComConHdl m_SdoComConHdl; BOOL m_fValidSdoComConHdl;
BOOL m_fValidSdoComConHdl; unsigned int m_uiNodeId;
unsigned int m_uiNodeId; unsigned int m_uiIndex;
unsigned int m_uiIndex; unsigned int m_uiSubindex;
unsigned int m_uiSubindex; void *m_le_pData;
void* m_le_pData; unsigned int m_uiSize;
unsigned int m_uiSize; tEplSdoType m_SdoType;
tEplSdoType m_SdoType; void *m_pUserArg;
void* m_pUserArg;
} tEplLinSdoObject; } tEplLinSdoObject;
typedef struct typedef struct {
{ unsigned int m_uiIndex;
unsigned int m_uiIndex; unsigned int m_uiSubindex;
unsigned int m_uiSubindex; void *m_pData;
void* m_pData; unsigned int m_uiSize;
unsigned int m_uiSize;
} tEplLinLocalObject; } tEplLinLocalObject;
typedef struct typedef struct {
{ unsigned int m_uiNodeId;
unsigned int m_uiNodeId; tEplNmtNodeCommand m_NodeCommand;
tEplNmtNodeCommand m_NodeCommand;
} tEplLinNodeCmdObject; } tEplLinNodeCmdObject;
...@@ -146,8 +138,4 @@ typedef struct ...@@ -146,8 +138,4 @@ typedef struct
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_API_LINUX_H_
#endif // #ifndef _EPL_API_LINUX_H_
...@@ -71,9 +71,6 @@ ...@@ -71,9 +71,6 @@
#ifndef _EPLCFG_H_ #ifndef _EPLCFG_H_
#define _EPLCFG_H_ #define _EPLCFG_H_
// ========================================================================= // =========================================================================
// generic defines which for whole EPL Stack // generic defines which for whole EPL Stack
// ========================================================================= // =========================================================================
...@@ -100,7 +97,7 @@ ...@@ -100,7 +97,7 @@
#define EPL_NO_USER_KERNEL #define EPL_NO_USER_KERNEL
#ifndef BENCHMARK_MODULES #ifndef BENCHMARK_MODULES
#define BENCHMARK_MODULES 0 //0xEE800042L #define BENCHMARK_MODULES 0 //0xEE800042L
#endif #endif
// Default defug level: // Default defug level:
...@@ -113,7 +110,6 @@ ...@@ -113,7 +110,6 @@
// * EPL_DBGLVL_ERROR = 0x40000000L // * EPL_DBGLVL_ERROR = 0x40000000L
// * EPL_DBGLVL_ALWAYS = 0x80000000L // * EPL_DBGLVL_ALWAYS = 0x80000000L
// EPL_MODULE_INTEGRATION defines all modules which are included in // EPL_MODULE_INTEGRATION defines all modules which are included in
// EPL application. Please add or delete modules for your application. // EPL application. Please add or delete modules for your application.
#define EPL_MODULE_INTEGRATION EPL_MODULE_OBDK \ #define EPL_MODULE_INTEGRATION EPL_MODULE_OBDK \
...@@ -155,7 +151,6 @@ ...@@ -155,7 +151,6 @@
// number of used ethernet controller // number of used ethernet controller
//#define EDRV_USED_ETH_CTRL 1 //#define EDRV_USED_ETH_CTRL 1
// ========================================================================= // =========================================================================
// Data Link Layer (DLL) specific defines // Data Link Layer (DLL) specific defines
// ========================================================================= // =========================================================================
...@@ -170,7 +165,6 @@ ...@@ -170,7 +165,6 @@
#define EPL_DLL_PRES_READY_AFTER_SOA FALSE #define EPL_DLL_PRES_READY_AFTER_SOA FALSE
//#define EPL_DLL_PRES_READY_AFTER_SOA TRUE //#define EPL_DLL_PRES_READY_AFTER_SOA TRUE
// ========================================================================= // =========================================================================
// OBD specific defines // OBD specific defines
// ========================================================================= // =========================================================================
...@@ -188,7 +182,6 @@ ...@@ -188,7 +182,6 @@
#define EPL_OBD_USE_VARIABLE_SUBINDEX_TAB TRUE #define EPL_OBD_USE_VARIABLE_SUBINDEX_TAB TRUE
// ========================================================================= // =========================================================================
// Timer module specific defines // Timer module specific defines
// ========================================================================= // =========================================================================
...@@ -200,8 +193,4 @@ ...@@ -200,8 +193,4 @@
#define EPL_TIMER_USE_HIGHRES TRUE #define EPL_TIMER_USE_HIGHRES TRUE
//#define EPL_TIMER_USE_HIGHRES FALSE //#define EPL_TIMER_USE_HIGHRES FALSE
#endif //_EPLCFG_H_ #endif //_EPLCFG_H_
...@@ -66,81 +66,77 @@ ...@@ -66,81 +66,77 @@
2006/05/22 d.k.: start of the implementation, version 1.00 2006/05/22 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_DEF_H_ #ifndef _EPL_DEF_H_
#define _EPL_DEF_H_ #define _EPL_DEF_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#define EPL_C_ADR_BROADCAST 0xFF // EPL broadcast address #define EPL_C_ADR_BROADCAST 0xFF // EPL broadcast address
#define EPL_C_ADR_DIAG_DEF_NODE_ID 0xFD // EPL default address of dignostic device #define EPL_C_ADR_DIAG_DEF_NODE_ID 0xFD // EPL default address of dignostic device
#define EPL_C_ADR_DUMMY_NODE_ID 0xFC // EPL dummy node address #define EPL_C_ADR_DUMMY_NODE_ID 0xFC // EPL dummy node address
#define EPL_C_ADR_INVALID 0x00 // invalid EPL address #define EPL_C_ADR_INVALID 0x00 // invalid EPL address
#define EPL_C_ADR_MN_DEF_NODE_ID 0xF0 // EPL default address of MN #define EPL_C_ADR_MN_DEF_NODE_ID 0xF0 // EPL default address of MN
#define EPL_C_ADR_RT1_DEF_NODE_ID 0xFE // EPL default address of router type 1 #define EPL_C_ADR_RT1_DEF_NODE_ID 0xFE // EPL default address of router type 1
#define EPL_C_DLL_ASND_PRIO_NMTRQST 7 // increased ASnd request priority to be used by NMT Requests #define EPL_C_DLL_ASND_PRIO_NMTRQST 7 // increased ASnd request priority to be used by NMT Requests
#define EPL_C_DLL_ASND_PRIO_STD 0 // standard ASnd request priority #define EPL_C_DLL_ASND_PRIO_STD 0 // standard ASnd request priority
#define EPL_C_DLL_ETHERTYPE_EPL 0x88AB #define EPL_C_DLL_ETHERTYPE_EPL 0x88AB
#define EPL_C_DLL_ISOCHR_MAX_PAYL 1490 // Byte: maximum size of PReq and PRes payload data, requires C_IP_MAX_MTU #define EPL_C_DLL_ISOCHR_MAX_PAYL 1490 // Byte: maximum size of PReq and PRes payload data, requires C_IP_MAX_MTU
#define EPL_C_DLL_MAX_ASYNC_MTU 1500 // Byte: maximum asynchronous payload in bytes #define EPL_C_DLL_MAX_ASYNC_MTU 1500 // Byte: maximum asynchronous payload in bytes
#define EPL_C_DLL_MAX_PAYL_OFFSET 1499 // Byte: maximum offset of Ethernet frame payload, requires C_IP_MAX_MTU #define EPL_C_DLL_MAX_PAYL_OFFSET 1499 // Byte: maximum offset of Ethernet frame payload, requires C_IP_MAX_MTU
#define EPL_C_DLL_MAX_RS 7 #define EPL_C_DLL_MAX_RS 7
#define EPL_C_DLL_MIN_ASYNC_MTU 282 // Byte: minimum asynchronous payload in bytes. #define EPL_C_DLL_MIN_ASYNC_MTU 282 // Byte: minimum asynchronous payload in bytes.
#define EPL_C_DLL_MIN_PAYL_OFFSET 45 // Byte: minimum offset of Ethernet frame payload #define EPL_C_DLL_MIN_PAYL_OFFSET 45 // Byte: minimum offset of Ethernet frame payload
#define EPL_C_DLL_MULTICAST_ASND 0x01111E000004LL // EPL ASnd multicast MAC address, canonical form #define EPL_C_DLL_MULTICAST_ASND 0x01111E000004LL // EPL ASnd multicast MAC address, canonical form
#define EPL_C_DLL_MULTICAST_PRES 0x01111E000002LL // EPL PRes multicast MAC address, canonical form #define EPL_C_DLL_MULTICAST_PRES 0x01111E000002LL // EPL PRes multicast MAC address, canonical form
#define EPL_C_DLL_MULTICAST_SOA 0x01111E000003LL // EPL SoA multicast MAC address, canonical form #define EPL_C_DLL_MULTICAST_SOA 0x01111E000003LL // EPL SoA multicast MAC address, canonical form
#define EPL_C_DLL_MULTICAST_SOC 0x01111E000001LL // EPL Soc multicast MAC address, canonical form #define EPL_C_DLL_MULTICAST_SOC 0x01111E000001LL // EPL Soc multicast MAC address, canonical form
#define EPL_C_DLL_PREOP1_START_CYCLES 10 // number of unassigning SoA frames at start of NMT_MS_PRE_OPERATIONAL_1 #define EPL_C_DLL_PREOP1_START_CYCLES 10 // number of unassigning SoA frames at start of NMT_MS_PRE_OPERATIONAL_1
#define EPL_C_DLL_T_BITTIME 10 // ns: Transmission time per bit on 100 Mbit/s network #define EPL_C_DLL_T_BITTIME 10 // ns: Transmission time per bit on 100 Mbit/s network
#define EPL_C_DLL_T_EPL_PDO_HEADER 10 // Byte: size of PReq and PRes EPL PDO message header #define EPL_C_DLL_T_EPL_PDO_HEADER 10 // Byte: size of PReq and PRes EPL PDO message header
#define EPL_C_DLL_T_ETH2_WRAPPER 18 // Byte: size of Ethernet type II wrapper consisting of header and checksum #define EPL_C_DLL_T_ETH2_WRAPPER 18 // Byte: size of Ethernet type II wrapper consisting of header and checksum
#define EPL_C_DLL_T_IFG 640 // ns: Ethernet Interframe Gap #define EPL_C_DLL_T_IFG 640 // ns: Ethernet Interframe Gap
#define EPL_C_DLL_T_MIN_FRAME 5120 // ns: Size of minimum Ethernet frame (without preamble) #define EPL_C_DLL_T_MIN_FRAME 5120 // ns: Size of minimum Ethernet frame (without preamble)
#define EPL_C_DLL_T_PREAMBLE 960 // ns: Size of Ethernet frame preamble #define EPL_C_DLL_T_PREAMBLE 960 // ns: Size of Ethernet frame preamble
#define EPL_C_DLL_MINSIZE_SOC 36 // minimum size of SoC without padding and CRC #define EPL_C_DLL_MINSIZE_SOC 36 // minimum size of SoC without padding and CRC
#define EPL_C_DLL_MINSIZE_PREQ 60 // minimum size of PRec without CRC #define EPL_C_DLL_MINSIZE_PREQ 60 // minimum size of PRec without CRC
#define EPL_C_DLL_MINSIZE_PRES 60 // minimum size of PRes without CRC #define EPL_C_DLL_MINSIZE_PRES 60 // minimum size of PRes without CRC
#define EPL_C_DLL_MINSIZE_SOA 24 // minimum size of SoA without padding and CRC #define EPL_C_DLL_MINSIZE_SOA 24 // minimum size of SoA without padding and CRC
#define EPL_C_DLL_MINSIZE_IDENTRES 176 // minimum size of IdentResponse without CRC #define EPL_C_DLL_MINSIZE_IDENTRES 176 // minimum size of IdentResponse without CRC
#define EPL_C_DLL_MINSIZE_STATUSRES 72 // minimum size of StatusResponse without CRC #define EPL_C_DLL_MINSIZE_STATUSRES 72 // minimum size of StatusResponse without CRC
#define EPL_C_DLL_MINSIZE_NMTCMD 20 // minimum size of NmtCommand without CommandData, padding and CRC #define EPL_C_DLL_MINSIZE_NMTCMD 20 // minimum size of NmtCommand without CommandData, padding and CRC
#define EPL_C_DLL_MINSIZE_NMTCMDEXT 52 // minimum size of NmtCommand without padding and CRC #define EPL_C_DLL_MINSIZE_NMTCMDEXT 52 // minimum size of NmtCommand without padding and CRC
#define EPL_C_DLL_MINSIZE_NMTREQ 20 // minimum size of NmtRequest without CommandData, padding and CRC #define EPL_C_DLL_MINSIZE_NMTREQ 20 // minimum size of NmtRequest without CommandData, padding and CRC
#define EPL_C_DLL_MINSIZE_NMTREQEXT 52 // minimum size of NmtRequest without padding and CRC #define EPL_C_DLL_MINSIZE_NMTREQEXT 52 // minimum size of NmtRequest without padding and CRC
#define EPL_C_ERR_MONITOR_DELAY 10 // Error monitoring start delay (not used in DS 1.0.0) #define EPL_C_ERR_MONITOR_DELAY 10 // Error monitoring start delay (not used in DS 1.0.0)
#define EPL_C_IP_ADR_INVALID 0x00000000L // invalid IP address (0.0.0.0) used to indicate no change #define EPL_C_IP_ADR_INVALID 0x00000000L // invalid IP address (0.0.0.0) used to indicate no change
#define EPL_C_IP_INVALID_MTU 0 // Byte: invalid MTU size used to indicate no change #define EPL_C_IP_INVALID_MTU 0 // Byte: invalid MTU size used to indicate no change
#define EPL_C_IP_MAX_MTU 1518 // Byte: maximum size in bytes of the IP stack which must be processed. #define EPL_C_IP_MAX_MTU 1518 // Byte: maximum size in bytes of the IP stack which must be processed.
#define EPL_C_IP_MIN_MTU 300 // Byte: minimum size in bytes of the IP stack which must be processed. #define EPL_C_IP_MIN_MTU 300 // Byte: minimum size in bytes of the IP stack which must be processed.
#define EPL_C_NMT_STATE_TOLERANCE 5 // Cycles: maximum reaction time to NMT state commands #define EPL_C_NMT_STATE_TOLERANCE 5 // Cycles: maximum reaction time to NMT state commands
#define EPL_C_NMT_STATREQ_CYCLE 5 // sec: StatusRequest cycle time to be applied to AsyncOnly CNs #define EPL_C_NMT_STATREQ_CYCLE 5 // sec: StatusRequest cycle time to be applied to AsyncOnly CNs
#define EPL_C_SDO_EPL_PORT 3819 #define EPL_C_SDO_EPL_PORT 3819
#define EPL_C_DLL_MAX_ASND_SERVICE_IDS 5 // see tEplDllAsndServiceId in EplDll.h #define EPL_C_DLL_MAX_ASND_SERVICE_IDS 5 // see tEplDllAsndServiceId in EplDll.h
// Default configuration // Default configuration
// ====================== // ======================
#ifndef EPL_D_PDO_Granularity_U8 #ifndef EPL_D_PDO_Granularity_U8
#define EPL_D_PDO_Granularity_U8 8 // minimum size of objects to be mapped in bits UNSIGNED8 O O 1 1 #define EPL_D_PDO_Granularity_U8 8 // minimum size of objects to be mapped in bits UNSIGNED8 O O 1 1
#endif #endif
#ifndef EPL_NMT_MAX_NODE_ID #ifndef EPL_NMT_MAX_NODE_ID
#define EPL_NMT_MAX_NODE_ID 254 // maximum node-ID #define EPL_NMT_MAX_NODE_ID 254 // maximum node-ID
#endif #endif
#ifndef EPL_D_NMT_MaxCNNumber_U8 #ifndef EPL_D_NMT_MaxCNNumber_U8
#define EPL_D_NMT_MaxCNNumber_U8 239 // maximum number of supported regular CNs in the Node ID range 1 .. 239 UNSIGNED8 O O 239 239 #define EPL_D_NMT_MaxCNNumber_U8 239 // maximum number of supported regular CNs in the Node ID range 1 .. 239 UNSIGNED8 O O 239 239
#endif #endif
// defines for EPL API layer static process image // defines for EPL API layer static process image
...@@ -162,7 +158,7 @@ ...@@ -162,7 +158,7 @@
#endif #endif
#ifndef EPL_OBD_MAX_STRING_SIZE #ifndef EPL_OBD_MAX_STRING_SIZE
#define EPL_OBD_MAX_STRING_SIZE 32 // is used for objects 0x1008/0x1009/0x100A #define EPL_OBD_MAX_STRING_SIZE 32 // is used for objects 0x1008/0x1009/0x100A
#endif #endif
#ifndef EPL_OBD_USE_STORE_RESTORE #ifndef EPL_OBD_USE_STORE_RESTORE
...@@ -194,7 +190,7 @@ ...@@ -194,7 +190,7 @@
#endif #endif
#ifndef EPL_VETH_NAME #ifndef EPL_VETH_NAME
#define EPL_VETH_NAME "epl" // name of net device in Linux #define EPL_VETH_NAME "epl" // name of net device in Linux
#endif #endif
/* /*
...@@ -303,60 +299,57 @@ ...@@ -303,60 +299,57 @@
#define EPL_E_DLL_LOSS_SOA_TH 0x8244 #define EPL_E_DLL_LOSS_SOA_TH 0x8244
#define EPL_E_DLL_LOSS_SOC_TH 0x8245 #define EPL_E_DLL_LOSS_SOC_TH 0x8245
// 0x84xx BootUp Errors // 0x84xx BootUp Errors
#define EPL_E_NMT_BA1 0x8410 // other MN in MsNotActive active #define EPL_E_NMT_BA1 0x8410 // other MN in MsNotActive active
#define EPL_E_NMT_BA1_NO_MN_SUPPORT 0x8411 // MN is not supported #define EPL_E_NMT_BA1_NO_MN_SUPPORT 0x8411 // MN is not supported
#define EPL_E_NMT_BPO1 0x8420 // mandatory CN was not found or failed in BootStep1 #define EPL_E_NMT_BPO1 0x8420 // mandatory CN was not found or failed in BootStep1
#define EPL_E_NMT_BPO1_GET_IDENT 0x8421 // IdentRes was not received #define EPL_E_NMT_BPO1_GET_IDENT 0x8421 // IdentRes was not received
#define EPL_E_NMT_BPO1_DEVICE_TYPE 0x8422 // wrong device type #define EPL_E_NMT_BPO1_DEVICE_TYPE 0x8422 // wrong device type
#define EPL_E_NMT_BPO1_VENDOR_ID 0x8423 // wrong vendor ID #define EPL_E_NMT_BPO1_VENDOR_ID 0x8423 // wrong vendor ID
#define EPL_E_NMT_BPO1_PRODUCT_CODE 0x8424 // wrong product code #define EPL_E_NMT_BPO1_PRODUCT_CODE 0x8424 // wrong product code
#define EPL_E_NMT_BPO1_REVISION_NO 0x8425 // wrong revision number #define EPL_E_NMT_BPO1_REVISION_NO 0x8425 // wrong revision number
#define EPL_E_NMT_BPO1_SERIAL_NO 0x8426 // wrong serial number #define EPL_E_NMT_BPO1_SERIAL_NO 0x8426 // wrong serial number
#define EPL_E_NMT_BPO1_CF_VERIFY 0x8428 // verification of configuration failed #define EPL_E_NMT_BPO1_CF_VERIFY 0x8428 // verification of configuration failed
#define EPL_E_NMT_BPO2 0x8430 // mandatory CN failed in BootStep2 #define EPL_E_NMT_BPO2 0x8430 // mandatory CN failed in BootStep2
#define EPL_E_NMT_BRO 0x8440 // CheckCommunication failed for mandatory CN #define EPL_E_NMT_BRO 0x8440 // CheckCommunication failed for mandatory CN
#define EPL_E_NMT_WRONG_STATE 0x8480 // mandatory CN has wrong NMT state #define EPL_E_NMT_WRONG_STATE 0x8480 // mandatory CN has wrong NMT state
// Defines for object 0x1F80 NMT_StartUp_U32 // Defines for object 0x1F80 NMT_StartUp_U32
// ========================================== // ==========================================
#define EPL_NMTST_STARTALLNODES 0x00000002L // Bit 1 #define EPL_NMTST_STARTALLNODES 0x00000002L // Bit 1
#define EPL_NMTST_NO_AUTOSTART 0x00000004L // Bit 2 #define EPL_NMTST_NO_AUTOSTART 0x00000004L // Bit 2
#define EPL_NMTST_NO_STARTNODE 0x00000008L // Bit 3 #define EPL_NMTST_NO_STARTNODE 0x00000008L // Bit 3
#define EPL_NMTST_RESETALL_MAND_CN 0x00000010L // Bit 4 #define EPL_NMTST_RESETALL_MAND_CN 0x00000010L // Bit 4
#define EPL_NMTST_STOPALL_MAND_CN 0x00000040L // Bit 6 #define EPL_NMTST_STOPALL_MAND_CN 0x00000040L // Bit 6
#define EPL_NMTST_NO_AUTOPREOP2 0x00000080L // Bit 7 #define EPL_NMTST_NO_AUTOPREOP2 0x00000080L // Bit 7
#define EPL_NMTST_NO_AUTOREADYTOOP 0x00000100L // Bit 8 #define EPL_NMTST_NO_AUTOREADYTOOP 0x00000100L // Bit 8
#define EPL_NMTST_EXT_CNIDENTCHECK 0x00000200L // Bit 9 #define EPL_NMTST_EXT_CNIDENTCHECK 0x00000200L // Bit 9
#define EPL_NMTST_SWVERSIONCHECK 0x00000400L // Bit 10 #define EPL_NMTST_SWVERSIONCHECK 0x00000400L // Bit 10
#define EPL_NMTST_CONFCHECK 0x00000800L // Bit 11 #define EPL_NMTST_CONFCHECK 0x00000800L // Bit 11
#define EPL_NMTST_NO_RETURN_PREOP1 0x00001000L // Bit 12 #define EPL_NMTST_NO_RETURN_PREOP1 0x00001000L // Bit 12
#define EPL_NMTST_BASICETHERNET 0x00002000L // Bit 13 #define EPL_NMTST_BASICETHERNET 0x00002000L // Bit 13
// Defines for object 0x1F81 NMT_NodeAssignment_AU32 // Defines for object 0x1F81 NMT_NodeAssignment_AU32
// ================================================== // ==================================================
#define EPL_NODEASSIGN_NODE_EXISTS 0x00000001L // Bit 0 #define EPL_NODEASSIGN_NODE_EXISTS 0x00000001L // Bit 0
#define EPL_NODEASSIGN_NODE_IS_CN 0x00000002L // Bit 1 #define EPL_NODEASSIGN_NODE_IS_CN 0x00000002L // Bit 1
#define EPL_NODEASSIGN_START_CN 0x00000004L // Bit 2 #define EPL_NODEASSIGN_START_CN 0x00000004L // Bit 2
#define EPL_NODEASSIGN_MANDATORY_CN 0x00000008L // Bit 3 #define EPL_NODEASSIGN_MANDATORY_CN 0x00000008L // Bit 3
#define EPL_NODEASSIGN_KEEPALIVE 0x00000010L //currently not used in EPL V2 standard #define EPL_NODEASSIGN_KEEPALIVE 0x00000010L //currently not used in EPL V2 standard
#define EPL_NODEASSIGN_SWVERSIONCHECK 0x00000020L // Bit 5 #define EPL_NODEASSIGN_SWVERSIONCHECK 0x00000020L // Bit 5
#define EPL_NODEASSIGN_SWUPDATE 0x00000040L // Bit 6 #define EPL_NODEASSIGN_SWUPDATE 0x00000040L // Bit 6
#define EPL_NODEASSIGN_ASYNCONLY_NODE 0x00000100L // Bit 8 #define EPL_NODEASSIGN_ASYNCONLY_NODE 0x00000100L // Bit 8
#define EPL_NODEASSIGN_MULTIPLEXED_CN 0x00000200L // Bit 9 #define EPL_NODEASSIGN_MULTIPLEXED_CN 0x00000200L // Bit 9
#define EPL_NODEASSIGN_RT1 0x00000400L // Bit 10 #define EPL_NODEASSIGN_RT1 0x00000400L // Bit 10
#define EPL_NODEASSIGN_RT2 0x00000800L // Bit 11 #define EPL_NODEASSIGN_RT2 0x00000800L // Bit 11
#define EPL_NODEASSIGN_MN_PRES 0x00001000L // Bit 12 #define EPL_NODEASSIGN_MN_PRES 0x00001000L // Bit 12
#define EPL_NODEASSIGN_VALID 0x80000000L // Bit 31 #define EPL_NODEASSIGN_VALID 0x80000000L // Bit 31
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_DEF_H_
#endif // #ifndef _EPL_DEF_H_
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
2006/06/08 d.k.: start of the implementation, version 1.00 2006/06/08 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_DLL_H_ #ifndef _EPL_DLL_H_
...@@ -79,133 +78,123 @@ ...@@ -79,133 +78,123 @@
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifndef EPL_DLL_MAX_ASND_SERVICE_ID #ifndef EPL_DLL_MAX_ASND_SERVICE_ID
#define EPL_DLL_MAX_ASND_SERVICE_ID (EPL_C_DLL_MAX_ASND_SERVICE_IDS + 1) // last is kEplDllAsndSdo == 5 #define EPL_DLL_MAX_ASND_SERVICE_ID (EPL_C_DLL_MAX_ASND_SERVICE_IDS + 1) // last is kEplDllAsndSdo == 5
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef enum typedef enum {
{ kEplDllAsndNotDefined = 0x00,
kEplDllAsndNotDefined = 0x00, kEplDllAsndIdentResponse = 0x01,
kEplDllAsndIdentResponse = 0x01, kEplDllAsndStatusResponse = 0x02,
kEplDllAsndStatusResponse = 0x02, kEplDllAsndNmtRequest = 0x03,
kEplDllAsndNmtRequest = 0x03, kEplDllAsndNmtCommand = 0x04,
kEplDllAsndNmtCommand = 0x04, kEplDllAsndSdo = 0x05
kEplDllAsndSdo = 0x05
} tEplDllAsndServiceId; } tEplDllAsndServiceId;
typedef enum typedef enum {
{ kEplDllAsndFilterNone = 0x00,
kEplDllAsndFilterNone = 0x00, kEplDllAsndFilterLocal = 0x01, // receive only ASnd frames with local or broadcast node ID
kEplDllAsndFilterLocal = 0x01, // receive only ASnd frames with local or broadcast node ID kEplDllAsndFilterAny = 0x02, // receive any ASnd frame
kEplDllAsndFilterAny = 0x02, // receive any ASnd frame
} tEplDllAsndFilter; } tEplDllAsndFilter;
typedef enum typedef enum {
{ kEplDllReqServiceNo = 0x00,
kEplDllReqServiceNo = 0x00, kEplDllReqServiceIdent = 0x01,
kEplDllReqServiceIdent = 0x01, kEplDllReqServiceStatus = 0x02,
kEplDllReqServiceStatus = 0x02, kEplDllReqServiceNmtRequest = 0x03,
kEplDllReqServiceNmtRequest = 0x03, kEplDllReqServiceUnspecified = 0xFF,
kEplDllReqServiceUnspecified= 0xFF,
} tEplDllReqServiceId; } tEplDllReqServiceId;
typedef enum typedef enum {
{ kEplDllAsyncReqPrioNmt = 0x07, // PRIO_NMT_REQUEST
kEplDllAsyncReqPrioNmt = 0x07, // PRIO_NMT_REQUEST kEplDllAsyncReqPrio6 = 0x06,
kEplDllAsyncReqPrio6 = 0x06, kEplDllAsyncReqPrio5 = 0x05,
kEplDllAsyncReqPrio5 = 0x05, kEplDllAsyncReqPrio4 = 0x04,
kEplDllAsyncReqPrio4 = 0x04, kEplDllAsyncReqPrioGeneric = 0x03, // PRIO_GENERIC_REQUEST
kEplDllAsyncReqPrioGeneric = 0x03, // PRIO_GENERIC_REQUEST kEplDllAsyncReqPrio2 = 0x02, // till WSP 0.1.3: PRIO_ABOVE_GENERIC
kEplDllAsyncReqPrio2 = 0x02, // till WSP 0.1.3: PRIO_ABOVE_GENERIC kEplDllAsyncReqPrio1 = 0x01, // till WSP 0.1.3: PRIO_BELOW_GENERIC
kEplDllAsyncReqPrio1 = 0x01, // till WSP 0.1.3: PRIO_BELOW_GENERIC kEplDllAsyncReqPrio0 = 0x00, // till WSP 0.1.3: PRIO_GENERIC_REQUEST
kEplDllAsyncReqPrio0 = 0x00, // till WSP 0.1.3: PRIO_GENERIC_REQUEST
} tEplDllAsyncReqPriority; } tEplDllAsyncReqPriority;
typedef struct typedef struct {
{ unsigned int m_uiFrameSize;
unsigned int m_uiFrameSize; tEplFrame *m_pFrame;
tEplFrame * m_pFrame; tEplNetTime m_NetTime;
tEplNetTime m_NetTime;
} tEplFrameInfo; } tEplFrameInfo;
typedef struct typedef struct {
{ unsigned int m_uiSizeOfStruct;
unsigned int m_uiSizeOfStruct; BOOL m_fAsyncOnly; // do not need to register PRes-Frame
BOOL m_fAsyncOnly; // do not need to register PRes-Frame unsigned int m_uiNodeId; // local node ID
unsigned int m_uiNodeId; // local node ID
// 0x1F82: NMT_FeatureFlags_U32
// 0x1F82: NMT_FeatureFlags_U32 DWORD m_dwFeatureFlags;
DWORD m_dwFeatureFlags; // Cycle Length (0x1006: NMT_CycleLen_U32) in [us]
// Cycle Length (0x1006: NMT_CycleLen_U32) in [us] DWORD m_dwCycleLen; // required for error detection
DWORD m_dwCycleLen; // required for error detection // 0x1F98: NMT_CycleTiming_REC
// 0x1F98: NMT_CycleTiming_REC // 0x1F98.1: IsochrTxMaxPayload_U16
// 0x1F98.1: IsochrTxMaxPayload_U16 unsigned int m_uiIsochrTxMaxPayload; // const
unsigned int m_uiIsochrTxMaxPayload; // const // 0x1F98.2: IsochrRxMaxPayload_U16
// 0x1F98.2: IsochrRxMaxPayload_U16 unsigned int m_uiIsochrRxMaxPayload; // const
unsigned int m_uiIsochrRxMaxPayload; // const // 0x1F98.3: PResMaxLatency_U32
// 0x1F98.3: PResMaxLatency_U32 DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes
DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes // 0x1F98.4: PReqActPayloadLimit_U16
// 0x1F98.4: PReqActPayloadLimit_U16 unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+24 bytes)
unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+24 bytes) // 0x1F98.5: PResActPayloadLimit_U16
// 0x1F98.5: PResActPayloadLimit_U16 unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+24 bytes)
unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+24 bytes) // 0x1F98.6: ASndMaxLatency_U32
// 0x1F98.6: ASndMaxLatency_U32 DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes
DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes // 0x1F98.7: MultiplCycleCnt_U8
// 0x1F98.7: MultiplCycleCnt_U8 unsigned int m_uiMultiplCycleCnt; // required for error detection
unsigned int m_uiMultiplCycleCnt; // required for error detection // 0x1F98.8: AsyncMTU_U16
// 0x1F98.8: AsyncMTU_U16 unsigned int m_uiAsyncMtu; // required to set up max frame size
unsigned int m_uiAsyncMtu; // required to set up max frame size // $$$ 0x1F98.9: Prescaler_U16
// $$$ 0x1F98.9: Prescaler_U16 // $$$ Multiplexed Slot
// $$$ Multiplexed Slot
// 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns]
// 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns] DWORD m_dwLossOfFrameTolerance;
DWORD m_dwLossOfFrameTolerance;
// 0x1F8A: NMT_MNCycleTiming_REC
// 0x1F8A: NMT_MNCycleTiming_REC // 0x1F8A.1: WaitSoCPReq_U32 in [ns]
// 0x1F8A.1: WaitSoCPReq_U32 in [ns] DWORD m_dwWaitSocPreq;
DWORD m_dwWaitSocPreq;
// 0x1F8A.2: AsyncSlotTimeout_U32 in [ns]
// 0x1F8A.2: AsyncSlotTimeout_U32 in [ns] DWORD m_dwAsyncSlotTimeout;
DWORD m_dwAsyncSlotTimeout;
} tEplDllConfigParam; } tEplDllConfigParam;
typedef struct typedef struct {
{ unsigned int m_uiSizeOfStruct;
unsigned int m_uiSizeOfStruct; DWORD m_dwDeviceType; // NMT_DeviceType_U32
DWORD m_dwDeviceType; // NMT_DeviceType_U32 DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32
DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32 DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32
DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32 DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32
DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32 DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32
DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32 QWORD m_qwVendorSpecificExt1;
QWORD m_qwVendorSpecificExt1; DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32
DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32 DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32
DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32 DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device
DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device
DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device DWORD m_dwIpAddress;
DWORD m_dwIpAddress; DWORD m_dwSubnetMask;
DWORD m_dwSubnetMask; DWORD m_dwDefaultGateway;
DWORD m_dwDefaultGateway; BYTE m_sHostname[32];
BYTE m_sHostname[32]; BYTE m_abVendorSpecificExt2[48];
BYTE m_abVendorSpecificExt2[48];
} tEplDllIdentParam; } tEplDllIdentParam;
typedef struct typedef struct {
{ unsigned int m_uiNodeId;
unsigned int m_uiNodeId; WORD m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16
WORD m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16 WORD m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16
WORD m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16 DWORD m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32
DWORD m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32
} tEplDllNodeInfo; } tEplDllNodeInfo;
...@@ -213,8 +202,4 @@ typedef struct ...@@ -213,8 +202,4 @@ typedef struct
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_DLL_H_
#endif // #ifndef _EPL_DLL_H_
...@@ -66,13 +66,11 @@ ...@@ -66,13 +66,11 @@
2006/06/20 d.k.: start of the implementation, version 1.00 2006/06/20 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_DLLCAL_H_ #ifndef _EPL_DLLCAL_H_
#define _EPL_DLLCAL_H_ #define _EPL_DLLCAL_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -105,18 +103,16 @@ ...@@ -105,18 +103,16 @@
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef struct typedef struct {
{ tEplDllAsndServiceId m_ServiceId;
tEplDllAsndServiceId m_ServiceId; tEplDllAsndFilter m_Filter;
tEplDllAsndFilter m_Filter;
} tEplDllCalAsndServiceIdFilter; } tEplDllCalAsndServiceIdFilter;
typedef struct typedef struct {
{ tEplDllReqServiceId m_Service;
tEplDllReqServiceId m_Service; unsigned int m_uiNodeId;
unsigned int m_uiNodeId; BYTE m_bSoaFlag1;
BYTE m_bSoaFlag1;
} tEplDllCalIssueRequest; } tEplDllCalIssueRequest;
...@@ -124,8 +120,4 @@ typedef struct ...@@ -124,8 +120,4 @@ typedef struct
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_DLLKCAL_H_
#endif // #ifndef _EPL_DLLKCAL_H_
此差异已折叠。
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
2006/06/12 d.k.: start of the implementation, version 1.00 2006/06/12 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_EVENT_H_ #ifndef _EPL_EVENT_H_
...@@ -82,222 +81,199 @@ ...@@ -82,222 +81,199 @@
// name and size of event queues // name and size of event queues
#define EPL_EVENT_NAME_SHB_KERNEL_TO_USER "ShbKernelToUser" #define EPL_EVENT_NAME_SHB_KERNEL_TO_USER "ShbKernelToUser"
#ifndef EPL_EVENT_SIZE_SHB_KERNEL_TO_USER #ifndef EPL_EVENT_SIZE_SHB_KERNEL_TO_USER
#define EPL_EVENT_SIZE_SHB_KERNEL_TO_USER 32768 // 32 kByte #define EPL_EVENT_SIZE_SHB_KERNEL_TO_USER 32768 // 32 kByte
#endif #endif
#define EPL_EVENT_NAME_SHB_USER_TO_KERNEL "ShbUserToKernel" #define EPL_EVENT_NAME_SHB_USER_TO_KERNEL "ShbUserToKernel"
#ifndef EPL_EVENT_SIZE_SHB_USER_TO_KERNEL #ifndef EPL_EVENT_SIZE_SHB_USER_TO_KERNEL
#define EPL_EVENT_SIZE_SHB_USER_TO_KERNEL 32768 // 32 kByte #define EPL_EVENT_SIZE_SHB_USER_TO_KERNEL 32768 // 32 kByte
#endif #endif
// max size of event argument // max size of event argument
#ifndef EPL_MAX_EVENT_ARG_SIZE #ifndef EPL_MAX_EVENT_ARG_SIZE
#define EPL_MAX_EVENT_ARG_SIZE 256 // because of PDO #define EPL_MAX_EVENT_ARG_SIZE 256 // because of PDO
#endif #endif
#define EPL_DLL_ERR_MN_CRC 0x00000001L // object 0x1C00 #define EPL_DLL_ERR_MN_CRC 0x00000001L // object 0x1C00
#define EPL_DLL_ERR_MN_COLLISION 0x00000002L // object 0x1C01 #define EPL_DLL_ERR_MN_COLLISION 0x00000002L // object 0x1C01
#define EPL_DLL_ERR_MN_CYCTIMEEXCEED 0x00000004L // object 0x1C02 #define EPL_DLL_ERR_MN_CYCTIMEEXCEED 0x00000004L // object 0x1C02
#define EPL_DLL_ERR_MN_LOSS_LINK 0x00000008L // object 0x1C03 #define EPL_DLL_ERR_MN_LOSS_LINK 0x00000008L // object 0x1C03
#define EPL_DLL_ERR_MN_CN_LATE_PRES 0x00000010L // objects 0x1C04-0x1C06 #define EPL_DLL_ERR_MN_CN_LATE_PRES 0x00000010L // objects 0x1C04-0x1C06
#define EPL_DLL_ERR_MN_CN_LOSS_PRES 0x00000080L // objects 0x1C07-0x1C09 #define EPL_DLL_ERR_MN_CN_LOSS_PRES 0x00000080L // objects 0x1C07-0x1C09
#define EPL_DLL_ERR_CN_COLLISION 0x00000400L // object 0x1C0A #define EPL_DLL_ERR_CN_COLLISION 0x00000400L // object 0x1C0A
#define EPL_DLL_ERR_CN_LOSS_SOC 0x00000800L // object 0x1C0B #define EPL_DLL_ERR_CN_LOSS_SOC 0x00000800L // object 0x1C0B
#define EPL_DLL_ERR_CN_LOSS_SOA 0x00001000L // object 0x1C0C #define EPL_DLL_ERR_CN_LOSS_SOA 0x00001000L // object 0x1C0C
#define EPL_DLL_ERR_CN_LOSS_PREQ 0x00002000L // object 0x1C0D #define EPL_DLL_ERR_CN_LOSS_PREQ 0x00002000L // object 0x1C0D
#define EPL_DLL_ERR_CN_RECVD_PREQ 0x00004000L // decrement object 0x1C0D/2 #define EPL_DLL_ERR_CN_RECVD_PREQ 0x00004000L // decrement object 0x1C0D/2
#define EPL_DLL_ERR_CN_SOC_JITTER 0x00008000L // object 0x1C0E #define EPL_DLL_ERR_CN_SOC_JITTER 0x00008000L // object 0x1C0E
#define EPL_DLL_ERR_CN_CRC 0x00010000L // object 0x1C0F #define EPL_DLL_ERR_CN_CRC 0x00010000L // object 0x1C0F
#define EPL_DLL_ERR_CN_LOSS_LINK 0x00020000L // object 0x1C10 #define EPL_DLL_ERR_CN_LOSS_LINK 0x00020000L // object 0x1C10
#define EPL_DLL_ERR_MN_LOSS_STATRES 0x00040000L // objects 0x1C15-0x1C17 (should be operated by NmtMnu module) #define EPL_DLL_ERR_MN_LOSS_STATRES 0x00040000L // objects 0x1C15-0x1C17 (should be operated by NmtMnu module)
#define EPL_DLL_ERR_BAD_PHYS_MODE 0x00080000L // no object #define EPL_DLL_ERR_BAD_PHYS_MODE 0x00080000L // no object
#define EPL_DLL_ERR_MAC_BUFFER 0x00100000L // no object (NMT_GT6) #define EPL_DLL_ERR_MAC_BUFFER 0x00100000L // no object (NMT_GT6)
#define EPL_DLL_ERR_INVALID_FORMAT 0x00200000L // no object (NMT_GT6) #define EPL_DLL_ERR_INVALID_FORMAT 0x00200000L // no object (NMT_GT6)
#define EPL_DLL_ERR_ADDRESS_CONFLICT 0x00400000L // no object (remove CN from configuration) #define EPL_DLL_ERR_ADDRESS_CONFLICT 0x00400000L // no object (remove CN from configuration)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// EventType determines the argument of the event // EventType determines the argument of the event
typedef enum typedef enum {
{ kEplEventTypeNmtEvent = 0x01, // NMT event
kEplEventTypeNmtEvent = 0x01, // NMT event // arg is pointer to tEplNmtEvent
// arg is pointer to tEplNmtEvent kEplEventTypePdoRx = 0x02, // PDO frame received event (PRes/PReq)
kEplEventTypePdoRx = 0x02, // PDO frame received event (PRes/PReq) // arg is pointer to tEplFrame
// arg is pointer to tEplFrame kEplEventTypePdoTx = 0x03, // PDO frame transmitted event (PRes/PReq)
kEplEventTypePdoTx = 0x03, // PDO frame transmitted event (PRes/PReq) // arg is pointer to tEplFrameInfo
// arg is pointer to tEplFrameInfo kEplEventTypePdoSoa = 0x04, // SoA frame received event (isochronous phase completed)
kEplEventTypePdoSoa = 0x04, // SoA frame received event (isochronous phase completed) // arg is pointer to nothing
// arg is pointer to nothing kEplEventTypeSync = 0x05, // Sync event (e.g. SoC or anticipated SoC)
kEplEventTypeSync = 0x05, // Sync event (e.g. SoC or anticipated SoC) // arg is pointer to nothing
// arg is pointer to nothing kEplEventTypeTimer = 0x06, // Timer event
kEplEventTypeTimer = 0x06, // Timer event // arg is pointer to tEplTimerEventArg
// arg is pointer to tEplTimerEventArg kEplEventTypeHeartbeat = 0x07, // Heartbeat event
kEplEventTypeHeartbeat = 0x07, // Heartbeat event // arg is pointer to tEplHeartbeatEvent
// arg is pointer to tEplHeartbeatEvent kEplEventTypeDllkCreate = 0x08, // DLL kernel create event
kEplEventTypeDllkCreate = 0x08, // DLL kernel create event // arg is pointer to the new tEplNmtState
// arg is pointer to the new tEplNmtState kEplEventTypeDllkDestroy = 0x09, // DLL kernel destroy event
kEplEventTypeDllkDestroy = 0x09, // DLL kernel destroy event // arg is pointer to the old tEplNmtState
// arg is pointer to the old tEplNmtState kEplEventTypeDllkFillTx = 0x0A, // DLL kernel fill TxBuffer event
kEplEventTypeDllkFillTx = 0x0A, // DLL kernel fill TxBuffer event // arg is pointer to tEplDllAsyncReqPriority
// arg is pointer to tEplDllAsyncReqPriority kEplEventTypeDllkPresReady = 0x0B, // DLL kernel PRes ready event
kEplEventTypeDllkPresReady = 0x0B, // DLL kernel PRes ready event // arg is pointer to nothing
// arg is pointer to nothing kEplEventTypeError = 0x0C, // Error event for API layer
kEplEventTypeError = 0x0C, // Error event for API layer // arg is pointer to tEplEventError
// arg is pointer to tEplEventError kEplEventTypeNmtStateChange = 0x0D, // indicate change of NMT-State
kEplEventTypeNmtStateChange = 0x0D, // indicate change of NMT-State // arg is pointer to tEplEventNmtStateChange
// arg is pointer to tEplEventNmtStateChange kEplEventTypeDllError = 0x0E, // DLL error event for Error handler
kEplEventTypeDllError = 0x0E, // DLL error event for Error handler // arg is pointer to tEplErrorHandlerkEvent
// arg is pointer to tEplErrorHandlerkEvent kEplEventTypeAsndRx = 0x0F, // received ASnd frame for DLL user module
kEplEventTypeAsndRx = 0x0F, // received ASnd frame for DLL user module // arg is pointer to tEplFrame
// arg is pointer to tEplFrame kEplEventTypeDllkServFilter = 0x10, // configure ServiceIdFilter
kEplEventTypeDllkServFilter = 0x10, // configure ServiceIdFilter // arg is pointer to tEplDllCalServiceIdFilter
// arg is pointer to tEplDllCalServiceIdFilter kEplEventTypeDllkIdentity = 0x11, // configure Identity
kEplEventTypeDllkIdentity = 0x11, // configure Identity // arg is pointer to tEplDllIdentParam
// arg is pointer to tEplDllIdentParam kEplEventTypeDllkConfig = 0x12, // configure ConfigParam
kEplEventTypeDllkConfig = 0x12, // configure ConfigParam // arg is pointer to tEplDllConfigParam
// arg is pointer to tEplDllConfigParam kEplEventTypeDllkIssueReq = 0x13, // issue Ident/Status request
kEplEventTypeDllkIssueReq = 0x13, // issue Ident/Status request // arg is pointer to tEplDllCalIssueRequest
// arg is pointer to tEplDllCalIssueRequest kEplEventTypeDllkAddNode = 0x14, // add node to isochronous phase
kEplEventTypeDllkAddNode = 0x14, // add node to isochronous phase // arg is pointer to tEplDllNodeInfo
// arg is pointer to tEplDllNodeInfo kEplEventTypeDllkDelNode = 0x15, // remove node from isochronous phase
kEplEventTypeDllkDelNode = 0x15, // remove node from isochronous phase // arg is pointer to unsigned int
// arg is pointer to unsigned int kEplEventTypeDllkSoftDelNode = 0x16, // remove node softly from isochronous phase
kEplEventTypeDllkSoftDelNode= 0x16, // remove node softly from isochronous phase // arg is pointer to unsigned int
// arg is pointer to unsigned int kEplEventTypeDllkStartReducedCycle = 0x17, // start reduced EPL cycle on MN
kEplEventTypeDllkStartReducedCycle = 0x17, // start reduced EPL cycle on MN // arg is pointer to nothing
// arg is pointer to nothing kEplEventTypeNmtMnuNmtCmdSent = 0x18, // NMT command was actually sent
kEplEventTypeNmtMnuNmtCmdSent = 0x18, // NMT command was actually sent // arg is pointer to tEplFrame
// arg is pointer to tEplFrame
} tEplEventType; } tEplEventType;
// EventSink determines the consumer of the event // EventSink determines the consumer of the event
typedef enum typedef enum {
{ kEplEventSinkSync = 0x00, // Sync event for application or kernel EPL module
kEplEventSinkSync = 0x00, // Sync event for application or kernel EPL module kEplEventSinkNmtk = 0x01, // events for Nmtk module
kEplEventSinkNmtk = 0x01, // events for Nmtk module kEplEventSinkDllk = 0x02, // events for Dllk module
kEplEventSinkDllk = 0x02, // events for Dllk module kEplEventSinkDlluCal = 0x03, // events for DlluCal module
kEplEventSinkDlluCal = 0x03, // events for DlluCal module kEplEventSinkDllkCal = 0x04, // events for DllkCal module
kEplEventSinkDllkCal = 0x04, // events for DllkCal module kEplEventSinkPdok = 0x05, // events for Pdok module
kEplEventSinkPdok = 0x05, // events for Pdok module kEplEventSinkNmtu = 0x06, // events for Nmtu module
kEplEventSinkNmtu = 0x06, // events for Nmtu module kEplEventSinkErrk = 0x07, // events for Error handler module
kEplEventSinkErrk = 0x07, // events for Error handler module kEplEventSinkErru = 0x08, // events for Error signaling module
kEplEventSinkErru = 0x08, // events for Error signaling module kEplEventSinkSdoAsySeq = 0x09, // events for asyncronous SDO Sequence Layer module
kEplEventSinkSdoAsySeq = 0x09, // events for asyncronous SDO Sequence Layer module kEplEventSinkNmtMnu = 0x0A, // events for NmtMnu module
kEplEventSinkNmtMnu = 0x0A, // events for NmtMnu module kEplEventSinkLedu = 0x0B, // events for Ledu module
kEplEventSinkLedu = 0x0B, // events for Ledu module kEplEventSinkApi = 0x0F, // events for API module
kEplEventSinkApi = 0x0F, // events for API module
} tEplEventSink; } tEplEventSink;
// EventSource determines the source of an errorevent // EventSource determines the source of an errorevent
typedef enum typedef enum {
{ // kernelspace modules
// kernelspace modules kEplEventSourceDllk = 0x01, // Dllk module
kEplEventSourceDllk = 0x01, // Dllk module kEplEventSourceNmtk = 0x02, // Nmtk module
kEplEventSourceNmtk = 0x02, // Nmtk module kEplEventSourceObdk = 0x03, // Obdk module
kEplEventSourceObdk = 0x03, // Obdk module kEplEventSourcePdok = 0x04, // Pdok module
kEplEventSourcePdok = 0x04, // Pdok module kEplEventSourceTimerk = 0x05, // Timerk module
kEplEventSourceTimerk = 0x05, // Timerk module kEplEventSourceEventk = 0x06, // Eventk module
kEplEventSourceEventk = 0x06, // Eventk module kEplEventSourceSyncCb = 0x07, // sync-Cb
kEplEventSourceSyncCb = 0x07, // sync-Cb kEplEventSourceErrk = 0x08, // Error handler module
kEplEventSourceErrk = 0x08, // Error handler module
// userspace modules
// userspace modules kEplEventSourceDllu = 0x10, // Dllu module
kEplEventSourceDllu = 0x10, // Dllu module kEplEventSourceNmtu = 0x11, // Nmtu module
kEplEventSourceNmtu = 0x11, // Nmtu module kEplEventSourceNmtCnu = 0x12, // NmtCnu module
kEplEventSourceNmtCnu = 0x12, // NmtCnu module kEplEventSourceNmtMnu = 0x13, // NmtMnu module
kEplEventSourceNmtMnu = 0x13, // NmtMnu module kEplEventSourceObdu = 0x14, // Obdu module
kEplEventSourceObdu = 0x14, // Obdu module kEplEventSourceSdoUdp = 0x15, // Sdo/Udp module
kEplEventSourceSdoUdp = 0x15, // Sdo/Udp module kEplEventSourceSdoAsnd = 0x16, // Sdo/Asnd module
kEplEventSourceSdoAsnd = 0x16, // Sdo/Asnd module kEplEventSourceSdoAsySeq = 0x17, // Sdo asynchronus Sequence Layer module
kEplEventSourceSdoAsySeq = 0x17, // Sdo asynchronus Sequence Layer module kEplEventSourceSdoCom = 0x18, // Sdo command layer module
kEplEventSourceSdoCom = 0x18, // Sdo command layer module kEplEventSourceTimeru = 0x19, // Timeru module
kEplEventSourceTimeru = 0x19, // Timeru module kEplEventSourceCfgMau = 0x1A, // CfgMau module
kEplEventSourceCfgMau = 0x1A, // CfgMau module kEplEventSourceEventu = 0x1B, // Eventu module
kEplEventSourceEventu = 0x1B, // Eventu module kEplEventSourceEplApi = 0x1C, // Api module
kEplEventSourceEplApi = 0x1C, // Api module kEplEventSourceLedu = 0x1D, // Ledu module
kEplEventSourceLedu = 0x1D, // Ledu module
} tEplEventSource; } tEplEventSource;
// structure of EPL event (element order must not be changed!) // structure of EPL event (element order must not be changed!)
typedef struct typedef struct {
{ tEplEventType m_EventType /*:28 */ ; // event type
tEplEventType m_EventType /*:28*/; // event type tEplEventSink m_EventSink /*:4 */ ; // event sink
tEplEventSink m_EventSink /*:4*/; // event sink tEplNetTime m_NetTime; // timestamp
tEplNetTime m_NetTime; // timestamp unsigned int m_uiSize; // size of argument
unsigned int m_uiSize; // size of argument void *m_pArg; // argument of event
void * m_pArg; // argument of event
} tEplEvent; } tEplEvent;
// short structure of EPL event without argument and its size (element order must not be changed!) // short structure of EPL event without argument and its size (element order must not be changed!)
typedef struct typedef struct {
{ tEplEventType m_EventType /*:28 */ ; // event type
tEplEventType m_EventType /*:28*/; // event type tEplEventSink m_EventSink /*:4 */ ; // event sink
tEplEventSink m_EventSink /*:4*/; // event sink tEplNetTime m_NetTime; // timestamp
tEplNetTime m_NetTime; // timestamp
} tEplEventShort; } tEplEventShort;
typedef struct {
typedef struct unsigned int m_uiIndex;
{ unsigned int m_uiSubIndex;
unsigned int m_uiIndex;
unsigned int m_uiSubIndex;
} tEplEventObdError; } tEplEventObdError;
// structure for kEplEventTypeError // structure for kEplEventTypeError
typedef struct typedef struct {
{ tEplEventSource m_EventSource; // module which posted this error event
tEplEventSource m_EventSource; // module which posted this error event tEplKernel m_EplError; // EPL error which occured
tEplKernel m_EplError; // EPL error which occured union {
union BYTE m_bArg;
{ DWORD m_dwArg;
BYTE m_bArg; tEplEventSource m_EventSource; // from Eventk/u module (originating error source)
DWORD m_dwArg; tEplEventObdError m_ObdError; // from Obd module
tEplEventSource m_EventSource; // from Eventk/u module (originating error source)
tEplEventObdError m_ObdError; // from Obd module
// tEplErrHistoryEntry m_HistoryEntry; // from Nmtk/u module // tEplErrHistoryEntry m_HistoryEntry; // from Nmtk/u module
} m_Arg; } m_Arg;
} tEplEventError; } tEplEventError;
// structure for kEplEventTypeDllError // structure for kEplEventTypeDllError
typedef struct typedef struct {
{ unsigned long m_ulDllErrorEvents; // EPL_DLL_ERR_*
unsigned long m_ulDllErrorEvents; // EPL_DLL_ERR_* unsigned int m_uiNodeId;
unsigned int m_uiNodeId; tEplNmtState m_NmtState;
tEplNmtState m_NmtState;
} tEplErrorHandlerkEvent; } tEplErrorHandlerkEvent;
// callback function to get informed about sync event // callback function to get informed about sync event
typedef tEplKernel (PUBLIC* tEplSyncCb) (void); typedef tEplKernel(PUBLIC * tEplSyncCb) (void);
// callback function for generic events // callback function for generic events
typedef tEplKernel (PUBLIC* tEplProcessEventCb) (tEplEvent* pEplEvent_p); typedef tEplKernel(PUBLIC * tEplProcessEventCb) (tEplEvent * pEplEvent_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_EVENT_H_
#endif // #ifndef _EPL_EVENT_H_
...@@ -66,30 +66,27 @@ ...@@ -66,30 +66,27 @@
2006/05/22 d.k.: start of the implementation, version 1.00 2006/05/22 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_FRAME_H_ #ifndef _EPL_FRAME_H_
#define _EPL_FRAME_H_ #define _EPL_FRAME_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// defines for EplFrame.m_wFlag // defines for EplFrame.m_wFlag
#define EPL_FRAME_FLAG1_RD 0x01 // ready (PReq, PRes) #define EPL_FRAME_FLAG1_RD 0x01 // ready (PReq, PRes)
#define EPL_FRAME_FLAG1_ER 0x02 // exception reset (error signalling) (SoA) #define EPL_FRAME_FLAG1_ER 0x02 // exception reset (error signalling) (SoA)
#define EPL_FRAME_FLAG1_EA 0x04 // exception acknowledge (error signalling) (PReq, SoA) #define EPL_FRAME_FLAG1_EA 0x04 // exception acknowledge (error signalling) (PReq, SoA)
#define EPL_FRAME_FLAG1_EC 0x08 // exception clear (error signalling) (StatusRes) #define EPL_FRAME_FLAG1_EC 0x08 // exception clear (error signalling) (StatusRes)
#define EPL_FRAME_FLAG1_EN 0x10 // exception new (error signalling) (PRes, StatusRes) #define EPL_FRAME_FLAG1_EN 0x10 // exception new (error signalling) (PRes, StatusRes)
#define EPL_FRAME_FLAG1_MS 0x20 // multiplexed slot (PReq) #define EPL_FRAME_FLAG1_MS 0x20 // multiplexed slot (PReq)
#define EPL_FRAME_FLAG1_PS 0x40 // prescaled slot (SoC) #define EPL_FRAME_FLAG1_PS 0x40 // prescaled slot (SoC)
#define EPL_FRAME_FLAG1_MC 0x80 // multiplexed cycle completed (SoC) #define EPL_FRAME_FLAG1_MC 0x80 // multiplexed cycle completed (SoC)
#define EPL_FRAME_FLAG2_RS 0x07 // number of pending requests to send (PRes, StatusRes, IdentRes) #define EPL_FRAME_FLAG2_RS 0x07 // number of pending requests to send (PRes, StatusRes, IdentRes)
#define EPL_FRAME_FLAG2_PR 0x38 // priority of requested asynch. frame (PRes, StatusRes, IdentRes) #define EPL_FRAME_FLAG2_PR 0x38 // priority of requested asynch. frame (PRes, StatusRes, IdentRes)
#define EPL_FRAME_FLAG2_PR_SHIFT 3 // shift of priority of requested asynch. frame #define EPL_FRAME_FLAG2_PR_SHIFT 3 // shift of priority of requested asynch. frame
// error history/status entry types // error history/status entry types
#define EPL_ERR_ENTRYTYPE_STATUS 0x8000 #define EPL_ERR_ENTRYTYPE_STATUS 0x8000
...@@ -104,15 +101,13 @@ ...@@ -104,15 +101,13 @@
#define EPL_ERR_ENTRYTYPE_PROF_MASK 0x0FFF #define EPL_ERR_ENTRYTYPE_PROF_MASK 0x0FFF
// defines for EPL version / PDO version // defines for EPL version / PDO version
#define EPL_VERSION_SUB 0x0F // sub version #define EPL_VERSION_SUB 0x0F // sub version
#define EPL_VERSION_MAIN 0xF0 // main version #define EPL_VERSION_MAIN 0xF0 // main version
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// $$$ d.k.: move this definition to global.h // $$$ d.k.: move this definition to global.h
// byte-align structures // byte-align structures
#ifdef _MSC_VER #ifdef _MSC_VER
...@@ -125,223 +120,205 @@ ...@@ -125,223 +120,205 @@
# error you must byte-align these structures with the appropriate compiler directives # error you must byte-align these structures with the appropriate compiler directives
#endif #endif
typedef struct {
typedef struct // Offset 17
{ BYTE m_le_bRes1; // reserved
// Offset 17 // Offset 18
BYTE m_le_bRes1; // reserved BYTE m_le_bFlag1; // Flags: MC, PS
// Offset 18 // Offset 19
BYTE m_le_bFlag1; // Flags: MC, PS BYTE m_le_bFlag2; // Flags: res
// Offset 19 // Offset 20
BYTE m_le_bFlag2; // Flags: res tEplNetTime m_le_NetTime; // supported if D_NMT_NetTimeIsRealTime_BOOL is set
// Offset 20 // Offset 28
tEplNetTime m_le_NetTime; // supported if D_NMT_NetTimeIsRealTime_BOOL is set QWORD m_le_RelativeTime; // in us (supported if D_NMT_RelativeTime_BOOL is set)
// Offset 28
QWORD m_le_RelativeTime; // in us (supported if D_NMT_RelativeTime_BOOL is set)
} PACK_STRUCT tEplSocFrame; } PACK_STRUCT tEplSocFrame;
typedef struct typedef struct {
{ // Offset 17
// Offset 17 BYTE m_le_bRes1; // reserved
BYTE m_le_bRes1; // reserved // Offset 18
// Offset 18 BYTE m_le_bFlag1; // Flags: MS, EA, RD
BYTE m_le_bFlag1; // Flags: MS, EA, RD // Offset 19
// Offset 19 BYTE m_le_bFlag2; // Flags: res
BYTE m_le_bFlag2; // Flags: res // Offset 20
// Offset 20 BYTE m_le_bPdoVersion;
BYTE m_le_bPdoVersion; // Offset 21
// Offset 21 BYTE m_le_bRes2; // reserved
BYTE m_le_bRes2; // reserved // Offset 22
// Offset 22 WORD m_le_wSize;
WORD m_le_wSize; // Offset 24
// Offset 24 BYTE m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 */ ];
BYTE m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16*/];
} PACK_STRUCT tEplPreqFrame; } PACK_STRUCT tEplPreqFrame;
typedef struct typedef struct {
{ // Offset 17
// Offset 17 BYTE m_le_bNmtStatus; // NMT state
BYTE m_le_bNmtStatus; // NMT state // Offset 18
// Offset 18 BYTE m_le_bFlag1; // Flags: MS, EN, RD
BYTE m_le_bFlag1; // Flags: MS, EN, RD // Offset 19
// Offset 19 BYTE m_le_bFlag2; // Flags: PR, RS
BYTE m_le_bFlag2; // Flags: PR, RS // Offset 20
// Offset 20 BYTE m_le_bPdoVersion;
BYTE m_le_bPdoVersion; // Offset 21
// Offset 21 BYTE m_le_bRes2; // reserved
BYTE m_le_bRes2; // reserved // Offset 22
// Offset 22 WORD m_le_wSize;
WORD m_le_wSize; // Offset 24
// Offset 24 BYTE m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16
BYTE m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 / D_NMT_IsochrTxMaxPayload_U16 */ ];
/ D_NMT_IsochrTxMaxPayload_U16*/];
} PACK_STRUCT tEplPresFrame; } PACK_STRUCT tEplPresFrame;
typedef struct typedef struct {
{ // Offset 17
// Offset 17 BYTE m_le_bNmtStatus; // NMT state
BYTE m_le_bNmtStatus; // NMT state // Offset 18
// Offset 18 BYTE m_le_bFlag1; // Flags: EA, ER
BYTE m_le_bFlag1; // Flags: EA, ER // Offset 19
// Offset 19 BYTE m_le_bFlag2; // Flags: res
BYTE m_le_bFlag2; // Flags: res // Offset 20
// Offset 20 BYTE m_le_bReqServiceId;
BYTE m_le_bReqServiceId; // Offset 21
// Offset 21 BYTE m_le_bReqServiceTarget;
BYTE m_le_bReqServiceTarget; // Offset 22
// Offset 22 BYTE m_le_bEplVersion;
BYTE m_le_bEplVersion;
} PACK_STRUCT tEplSoaFrame; } PACK_STRUCT tEplSoaFrame;
typedef struct typedef struct {
{ WORD m_wEntryType;
WORD m_wEntryType; WORD m_wErrorCode;
WORD m_wErrorCode; tEplNetTime m_TimeStamp;
tEplNetTime m_TimeStamp; BYTE m_abAddInfo[8];
BYTE m_abAddInfo[8];
} PACK_STRUCT tEplErrHistoryEntry; } PACK_STRUCT tEplErrHistoryEntry;
typedef struct typedef struct {
{ // Offset 18
// Offset 18 BYTE m_le_bFlag1; // Flags: EN, EC
BYTE m_le_bFlag1; // Flags: EN, EC BYTE m_le_bFlag2; // Flags: PR, RS
BYTE m_le_bFlag2; // Flags: PR, RS BYTE m_le_bNmtStatus; // NMT state
BYTE m_le_bNmtStatus; // NMT state BYTE m_le_bRes1[3];
BYTE m_le_bRes1[3]; QWORD m_le_qwStaticError; // static error bit field
QWORD m_le_qwStaticError; // static error bit field tEplErrHistoryEntry m_le_aErrHistoryEntry[14];
tEplErrHistoryEntry m_le_aErrHistoryEntry[14];
} PACK_STRUCT tEplStatusResponse; } PACK_STRUCT tEplStatusResponse;
typedef struct typedef struct {
{ // Offset 18
// Offset 18 BYTE m_le_bFlag1; // Flags: res
BYTE m_le_bFlag1; // Flags: res BYTE m_le_bFlag2; // Flags: PR, RS
BYTE m_le_bFlag2; // Flags: PR, RS BYTE m_le_bNmtStatus; // NMT state
BYTE m_le_bNmtStatus; // NMT state BYTE m_le_bIdentRespFlags; // Flags: FW
BYTE m_le_bIdentRespFlags; // Flags: FW BYTE m_le_bEplProfileVersion;
BYTE m_le_bEplProfileVersion; BYTE m_le_bRes1;
BYTE m_le_bRes1; DWORD m_le_dwFeatureFlags; // NMT_FeatureFlags_U32
DWORD m_le_dwFeatureFlags; // NMT_FeatureFlags_U32 WORD m_le_wMtu; // NMT_CycleTiming_REC.AsyncMTU_U16: C_IP_MIN_MTU - C_IP_MAX_MTU
WORD m_le_wMtu; // NMT_CycleTiming_REC.AsyncMTU_U16: C_IP_MIN_MTU - C_IP_MAX_MTU WORD m_le_wPollInSize; // NMT_CycleTiming_REC.PReqActPayload_U16
WORD m_le_wPollInSize; // NMT_CycleTiming_REC.PReqActPayload_U16 WORD m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16
WORD m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16 DWORD m_le_dwResponseTime; // NMT_CycleTiming_REC.PResMaxLatency_U32
DWORD m_le_dwResponseTime; // NMT_CycleTiming_REC.PResMaxLatency_U32 WORD m_le_wRes2;
WORD m_le_wRes2; DWORD m_le_dwDeviceType; // NMT_DeviceType_U32
DWORD m_le_dwDeviceType; // NMT_DeviceType_U32 DWORD m_le_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32
DWORD m_le_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32 DWORD m_le_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32
DWORD m_le_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32 DWORD m_le_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32
DWORD m_le_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32 DWORD m_le_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32
DWORD m_le_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32 QWORD m_le_qwVendorSpecificExt1;
QWORD m_le_qwVendorSpecificExt1; DWORD m_le_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32
DWORD m_le_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32 DWORD m_le_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32
DWORD m_le_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32 DWORD m_le_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device
DWORD m_le_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device DWORD m_le_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device
DWORD m_le_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device DWORD m_le_dwIpAddress;
DWORD m_le_dwIpAddress; DWORD m_le_dwSubnetMask;
DWORD m_le_dwSubnetMask; DWORD m_le_dwDefaultGateway;
DWORD m_le_dwDefaultGateway; BYTE m_le_sHostname[32];
BYTE m_le_sHostname[32]; BYTE m_le_abVendorSpecificExt2[48];
BYTE m_le_abVendorSpecificExt2[48];
} PACK_STRUCT tEplIdentResponse; } PACK_STRUCT tEplIdentResponse;
typedef struct typedef struct {
{ // Offset 18
// Offset 18 BYTE m_le_bNmtCommandId;
BYTE m_le_bNmtCommandId; BYTE m_le_bRes1;
BYTE m_le_bRes1; BYTE m_le_abNmtCommandData[32];
BYTE m_le_abNmtCommandData[32];
} PACK_STRUCT tEplNmtCommandService; } PACK_STRUCT tEplNmtCommandService;
typedef struct typedef struct {
{ BYTE m_le_bReserved;
BYTE m_le_bReserved; BYTE m_le_bTransactionId;
BYTE m_le_bTransactionId; BYTE m_le_bFlags;
BYTE m_le_bFlags; BYTE m_le_bCommandId;
BYTE m_le_bCommandId; WORD m_le_wSegmentSize;
WORD m_le_wSegmentSize; WORD m_le_wReserved;
WORD m_le_wReserved; BYTE m_le_abCommandData[8]; // just reserve a minimum number of bytes as a placeholder
BYTE m_le_abCommandData[8]; // just reserve a minimum number of bytes as a placeholder
}PACK_STRUCT tEplAsySdoCom;
} PACK_STRUCT tEplAsySdoCom;
// asynchronous SDO Sequence Header // asynchronous SDO Sequence Header
typedef struct typedef struct {
{ BYTE m_le_bRecSeqNumCon;
BYTE m_le_bRecSeqNumCon; BYTE m_le_bSendSeqNumCon;
BYTE m_le_bSendSeqNumCon; BYTE m_le_abReserved[2];
BYTE m_le_abReserved[2]; tEplAsySdoCom m_le_abSdoSeqPayload;
tEplAsySdoCom m_le_abSdoSeqPayload;
} PACK_STRUCT tEplAsySdoSeq; } PACK_STRUCT tEplAsySdoSeq;
typedef struct typedef struct {
{ // Offset 18
// Offset 18 BYTE m_le_bNmtCommandId;
BYTE m_le_bNmtCommandId; BYTE m_le_bTargetNodeId;
BYTE m_le_bTargetNodeId; BYTE m_le_abNmtCommandData[32];
BYTE m_le_abNmtCommandData[32];
} PACK_STRUCT tEplNmtRequestService; } PACK_STRUCT tEplNmtRequestService;
typedef union {
typedef union // Offset 18
{ tEplStatusResponse m_StatusResponse;
// Offset 18 tEplIdentResponse m_IdentResponse;
tEplStatusResponse m_StatusResponse; tEplNmtCommandService m_NmtCommandService;
tEplIdentResponse m_IdentResponse; tEplNmtRequestService m_NmtRequestService;
tEplNmtCommandService m_NmtCommandService; tEplAsySdoSeq m_SdoSequenceFrame;
tEplNmtRequestService m_NmtRequestService; BYTE m_le_abPayload[256 /*D_NMT_ASndTxMaxPayload_U16
tEplAsySdoSeq m_SdoSequenceFrame; / D_NMT_ASndRxMaxPayload_U16 */ ];
BYTE m_le_abPayload[256 /*D_NMT_ASndTxMaxPayload_U16
/ D_NMT_ASndRxMaxPayload_U16*/];
} tEplAsndPayload; } tEplAsndPayload;
typedef struct typedef struct {
{ // Offset 17
// Offset 17 BYTE m_le_bServiceId;
BYTE m_le_bServiceId; // Offset 18
// Offset 18 tEplAsndPayload m_Payload;
tEplAsndPayload m_Payload;
} PACK_STRUCT tEplAsndFrame; } PACK_STRUCT tEplAsndFrame;
typedef union typedef union {
{ // Offset 17
// Offset 17 tEplSocFrame m_Soc;
tEplSocFrame m_Soc; tEplPreqFrame m_Preq;
tEplPreqFrame m_Preq; tEplPresFrame m_Pres;
tEplPresFrame m_Pres; tEplSoaFrame m_Soa;
tEplSoaFrame m_Soa; tEplAsndFrame m_Asnd;
tEplAsndFrame m_Asnd;
} tEplFrameData; } tEplFrameData;
typedef struct typedef struct {
{ // Offset 0
// Offset 0 BYTE m_be_abDstMac[6]; // MAC address of the addressed nodes
BYTE m_be_abDstMac[6]; // MAC address of the addressed nodes // Offset 6
// Offset 6 BYTE m_be_abSrcMac[6]; // MAC address of the transmitting node
BYTE m_be_abSrcMac[6]; // MAC address of the transmitting node // Offset 12
// Offset 12 WORD m_be_wEtherType; // Ethernet message type (big endian)
WORD m_be_wEtherType; // Ethernet message type (big endian) // Offset 14
// Offset 14 BYTE m_le_bMessageType; // EPL message type
BYTE m_le_bMessageType; // EPL message type // Offset 15
// Offset 15 BYTE m_le_bDstNodeId; // EPL node ID of the addressed nodes
BYTE m_le_bDstNodeId; // EPL node ID of the addressed nodes // Offset 16
// Offset 16 BYTE m_le_bSrcNodeId; // EPL node ID of the transmitting node
BYTE m_le_bSrcNodeId; // EPL node ID of the transmitting node // Offset 17
// Offset 17 tEplFrameData m_Data;
tEplFrameData m_Data;
} PACK_STRUCT tEplFrame; } PACK_STRUCT tEplFrame;
...@@ -350,25 +327,18 @@ typedef struct ...@@ -350,25 +327,18 @@ typedef struct
# pragma pack( pop, packing ) # pragma pack( pop, packing )
#endif #endif
typedef enum {
typedef enum kEplMsgTypeNonEpl = 0x00,
{ kEplMsgTypeSoc = 0x01,
kEplMsgTypeNonEpl = 0x00, kEplMsgTypePreq = 0x03,
kEplMsgTypeSoc = 0x01, kEplMsgTypePres = 0x04,
kEplMsgTypePreq = 0x03, kEplMsgTypeSoa = 0x05,
kEplMsgTypePres = 0x04, kEplMsgTypeAsnd = 0x06,
kEplMsgTypeSoa = 0x05,
kEplMsgTypeAsnd = 0x06,
} tEplMsgType; } tEplMsgType;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_FRAME_H_
#endif // #ifndef _EPL_FRAME_H_
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
2006/05/22 d.k.: start of the implementation, version 1.00 2006/05/22 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_INC_H_ #ifndef _EPL_INC_H_
...@@ -77,28 +76,28 @@ ...@@ -77,28 +76,28 @@
// ============================================================================ // ============================================================================
#if defined(WIN32) || defined(_WIN32) #if defined(WIN32) || defined(_WIN32)
#ifdef UNDER_RTSS #ifdef UNDER_RTSS
// RTX header // RTX header
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#include <rtapi.h> #include <rtapi.h>
#elif __BORLANDC__ #elif __BORLANDC__
// borland C header // borland C header
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#elif WINCE #elif WINCE
#include <windows.h> #include <windows.h>
#else #else
// MSVC needs to include windows.h at first // MSVC needs to include windows.h at first
// the following defines ar necessary for function prototypes for waitable timers // the following defines ar necessary for function prototypes for waitable timers
#define _WIN32_WINDOWS 0x0401 #define _WIN32_WINDOWS 0x0401
#define _WIN32_WINNT 0x0400 #define _WIN32_WINNT 0x0400
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#endif #endif
#endif #endif
...@@ -106,49 +105,47 @@ ...@@ -106,49 +105,47 @@
// possible other include file needed // possible other include file needed
// These constants defines modules which can be included in the Epl application. // These constants defines modules which can be included in the Epl application.
// Use this constants for define EPL_MODULE_INTEGRATION in file EplCfg.h. // Use this constants for define EPL_MODULE_INTEGRATION in file EplCfg.h.
#define EPL_MODULE_OBDK 0x00000001L // OBD kernel part module #define EPL_MODULE_OBDK 0x00000001L // OBD kernel part module
#define EPL_MODULE_PDOK 0x00000002L // PDO kernel part module #define EPL_MODULE_PDOK 0x00000002L // PDO kernel part module
#define EPL_MODULE_NMT_MN 0x00000004L // NMT MN module #define EPL_MODULE_NMT_MN 0x00000004L // NMT MN module
#define EPL_MODULE_SDOS 0x00000008L // SDO Server module #define EPL_MODULE_SDOS 0x00000008L // SDO Server module
#define EPL_MODULE_SDOC 0x00000010L // SDO Client module #define EPL_MODULE_SDOC 0x00000010L // SDO Client module
#define EPL_MODULE_SDO_ASND 0x00000020L // SDO over Asnd module #define EPL_MODULE_SDO_ASND 0x00000020L // SDO over Asnd module
#define EPL_MODULE_SDO_UDP 0x00000040L // SDO over UDP module #define EPL_MODULE_SDO_UDP 0x00000040L // SDO over UDP module
#define EPL_MODULE_SDO_PDO 0x00000080L // SDO in PDO module #define EPL_MODULE_SDO_PDO 0x00000080L // SDO in PDO module
#define EPL_MODULE_NMT_CN 0x00000100L // NMT CN module #define EPL_MODULE_NMT_CN 0x00000100L // NMT CN module
#define EPL_MODULE_NMTU 0x00000200L // NMT user part module #define EPL_MODULE_NMTU 0x00000200L // NMT user part module
#define EPL_MODULE_NMTK 0x00000400L // NMT kernel part module #define EPL_MODULE_NMTK 0x00000400L // NMT kernel part module
#define EPL_MODULE_DLLK 0x00000800L // DLL kernel part module #define EPL_MODULE_DLLK 0x00000800L // DLL kernel part module
#define EPL_MODULE_DLLU 0x00001000L // DLL user part module #define EPL_MODULE_DLLU 0x00001000L // DLL user part module
#define EPL_MODULE_OBDU 0x00002000L // OBD user part module #define EPL_MODULE_OBDU 0x00002000L // OBD user part module
#define EPL_MODULE_CFGMA 0x00004000L // Configuartioan Manager module #define EPL_MODULE_CFGMA 0x00004000L // Configuartioan Manager module
#define EPL_MODULE_VETH 0x00008000L // virtual ethernet driver module #define EPL_MODULE_VETH 0x00008000L // virtual ethernet driver module
#define EPL_MODULE_PDOU 0x00010000L // PDO user part module #define EPL_MODULE_PDOU 0x00010000L // PDO user part module
#define EPL_MODULE_LEDU 0x00020000L // LED user part module #define EPL_MODULE_LEDU 0x00020000L // LED user part module
#include "EplCfg.h" // EPL configuration file (configuration from application) #include "EplCfg.h" // EPL configuration file (configuration from application)
#include "global.h" // global definitions #include "global.h" // global definitions
#include "EplDef.h" // EPL configuration file (default configuration) #include "EplDef.h" // EPL configuration file (default configuration)
#include "EplInstDef.h" // defines macros for instance types and table #include "EplInstDef.h" // defines macros for instance types and table
#include "Debug.h" // debug definitions #include "Debug.h" // debug definitions
#include "EplErrDef.h" // EPL error codes for API funtions #include "EplErrDef.h" // EPL error codes for API funtions
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// IEEE 1588 conformant net time structure // IEEE 1588 conformant net time structure
typedef struct typedef struct {
{ DWORD m_dwSec;
DWORD m_dwSec; DWORD m_dwNanoSec;
DWORD m_dwNanoSec;
} tEplNetTime; } tEplNetTime;
#include "EplTarget.h" // target specific functions and definitions
#include "EplTarget.h" // target specific functions and definitions
#include "EplAmi.h" #include "EplAmi.h"
...@@ -156,7 +153,7 @@ typedef struct ...@@ -156,7 +153,7 @@ typedef struct
// macros // macros
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#define EPL_SPEC_VERSION 0x20 // ETHERNET Powerlink V. 2.0 #define EPL_SPEC_VERSION 0x20 // ETHERNET Powerlink V. 2.0
#define EPL_STACK_VERSION(ver,rev,rel) ((((DWORD)(ver)) & 0xFF)|((((DWORD)(rev))&0xFF)<<8)|(((DWORD)(rel))<<16)) #define EPL_STACK_VERSION(ver,rev,rel) ((((DWORD)(ver)) & 0xFF)|((((DWORD)(rev))&0xFF)<<8)|(((DWORD)(rel))<<16))
#define EPL_OBJ1018_VERSION(ver,rev,rel) ((((DWORD)(ver))<<16) |(((DWORD)(rev))&0xFFFF)) #define EPL_OBJ1018_VERSION(ver,rev,rel) ((((DWORD)(ver))<<16) |(((DWORD)(rev))&0xFFFF))
#define EPL_STRING_VERSION(ver,rev,rel) "V" #ver "." #rev " r" #rel #define EPL_STRING_VERSION(ver,rev,rel) "V" #ver "." #rev " r" #rel
...@@ -179,54 +176,53 @@ typedef struct ...@@ -179,54 +176,53 @@ typedef struct
#define EPL_FEATURE_RT1 0x00001000 #define EPL_FEATURE_RT1 0x00001000
#define EPL_FEATURE_RT2 0x00002000 #define EPL_FEATURE_RT2 0x00002000
// generate EPL NMT_FeatureFlags_U32 // generate EPL NMT_FeatureFlags_U32
#ifndef EPL_DEF_FEATURE_ISOCHR #ifndef EPL_DEF_FEATURE_ISOCHR
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0)
#define EPL_DEF_FEATURE_ISOCHR (EPL_FEATURE_ISOCHR) #define EPL_DEF_FEATURE_ISOCHR (EPL_FEATURE_ISOCHR)
#else #else
#define EPL_DEF_FEATURE_ISOCHR 0 #define EPL_DEF_FEATURE_ISOCHR 0
#endif #endif
#endif #endif
#ifndef EPL_DEF_FEATURE_SDO_ASND #ifndef EPL_DEF_FEATURE_SDO_ASND
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_ASND)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_ASND)) != 0)
#define EPL_DEF_FEATURE_SDO_ASND (EPL_FEATURE_SDO_ASND) #define EPL_DEF_FEATURE_SDO_ASND (EPL_FEATURE_SDO_ASND)
#else #else
#define EPL_DEF_FEATURE_SDO_ASND 0 #define EPL_DEF_FEATURE_SDO_ASND 0
#endif #endif
#endif #endif
#ifndef EPL_DEF_FEATURE_SDO_UDP #ifndef EPL_DEF_FEATURE_SDO_UDP
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_UDP)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_UDP)) != 0)
#define EPL_DEF_FEATURE_SDO_UDP (EPL_FEATURE_SDO_UDP) #define EPL_DEF_FEATURE_SDO_UDP (EPL_FEATURE_SDO_UDP)
#else #else
#define EPL_DEF_FEATURE_SDO_UDP 0 #define EPL_DEF_FEATURE_SDO_UDP 0
#endif #endif
#endif #endif
#ifndef EPL_DEF_FEATURE_SDO_PDO #ifndef EPL_DEF_FEATURE_SDO_PDO
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_PDO)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_PDO)) != 0)
#define EPL_DEF_FEATURE_SDO_PDO (EPL_FEATURE_SDO_PDO) #define EPL_DEF_FEATURE_SDO_PDO (EPL_FEATURE_SDO_PDO)
#else #else
#define EPL_DEF_FEATURE_SDO_PDO 0 #define EPL_DEF_FEATURE_SDO_PDO 0
#endif #endif
#endif #endif
#ifndef EPL_DEF_FEATURE_PDO_DYN #ifndef EPL_DEF_FEATURE_PDO_DYN
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_PDOK)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_PDOK)) != 0)
#define EPL_DEF_FEATURE_PDO_DYN (EPL_FEATURE_PDO_DYN) #define EPL_DEF_FEATURE_PDO_DYN (EPL_FEATURE_PDO_DYN)
#else #else
#define EPL_DEF_FEATURE_PDO_DYN 0 #define EPL_DEF_FEATURE_PDO_DYN 0
#endif #endif
#endif #endif
#ifndef EPL_DEF_FEATURE_CFGMA #ifndef EPL_DEF_FEATURE_CFGMA
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_CFGMA)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_CFGMA)) != 0)
#define EPL_DEF_FEATURE_CFGMA (EPL_FEATURE_CFGMA) #define EPL_DEF_FEATURE_CFGMA (EPL_FEATURE_CFGMA)
#else #else
#define EPL_DEF_FEATURE_CFGMA 0 #define EPL_DEF_FEATURE_CFGMA 0
#endif #endif
#endif #endif
#define EPL_DEF_FEATURE_FLAGS (EPL_DEF_FEATURE_ISOCHR \ #define EPL_DEF_FEATURE_FLAGS (EPL_DEF_FEATURE_ISOCHR \
...@@ -236,12 +232,10 @@ typedef struct ...@@ -236,12 +232,10 @@ typedef struct
| EPL_DEF_FEATURE_PDO_DYN \ | EPL_DEF_FEATURE_PDO_DYN \
| EPL_DEF_FEATURE_CFGMA) | EPL_DEF_FEATURE_CFGMA)
#ifndef tabentries #ifndef tabentries
#define tabentries(a) (sizeof(a)/sizeof(*(a))) #define tabentries(a) (sizeof(a)/sizeof(*(a)))
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -249,15 +243,14 @@ typedef struct ...@@ -249,15 +243,14 @@ typedef struct
// definitions for DLL export // definitions for DLL export
#if ((DEV_SYSTEM == _DEV_WIN32_) || (DEV_SYSTEM == _DEV_WIN_CE_)) && defined (COP_LIB) #if ((DEV_SYSTEM == _DEV_WIN32_) || (DEV_SYSTEM == _DEV_WIN_CE_)) && defined (COP_LIB)
#define EPLDLLEXPORT __declspec (dllexport) #define EPLDLLEXPORT __declspec (dllexport)
#else #else
#define EPLDLLEXPORT #define EPLDLLEXPORT
#endif #endif
// ============================================================================ // ============================================================================
// common debug macros // common debug macros
// ============================================================================ // ============================================================================
...@@ -273,49 +266,49 @@ typedef struct ...@@ -273,49 +266,49 @@ typedef struct
// default level is defined in copdef.h // default level is defined in copdef.h
// debug-level and TRACE-macros // standard-level // flags for DEF_DEBUG_LVL // debug-level and TRACE-macros // standard-level // flags for DEF_DEBUG_LVL
#define EPL_DBGLVL_EDRV DEBUG_LVL_01 // 0x00000001L #define EPL_DBGLVL_EDRV DEBUG_LVL_01 // 0x00000001L
#define EPL_DBGLVL_EDRV_TRACE0 DEBUG_LVL_01_TRACE0 #define EPL_DBGLVL_EDRV_TRACE0 DEBUG_LVL_01_TRACE0
#define EPL_DBGLVL_EDRV_TRACE1 DEBUG_LVL_01_TRACE1 #define EPL_DBGLVL_EDRV_TRACE1 DEBUG_LVL_01_TRACE1
#define EPL_DBGLVL_EDRV_TRACE2 DEBUG_LVL_01_TRACE2 #define EPL_DBGLVL_EDRV_TRACE2 DEBUG_LVL_01_TRACE2
#define EPL_DBGLVL_EDRV_TRACE3 DEBUG_LVL_01_TRACE3 #define EPL_DBGLVL_EDRV_TRACE3 DEBUG_LVL_01_TRACE3
#define EPL_DBGLVL_EDRV_TRACE4 DEBUG_LVL_01_TRACE4 #define EPL_DBGLVL_EDRV_TRACE4 DEBUG_LVL_01_TRACE4
#define EPL_DBGLVL_DLL DEBUG_LVL_02 // 0x00000002L #define EPL_DBGLVL_DLL DEBUG_LVL_02 // 0x00000002L
#define EPL_DBGLVL_DLL_TRACE0 DEBUG_LVL_02_TRACE0 #define EPL_DBGLVL_DLL_TRACE0 DEBUG_LVL_02_TRACE0
#define EPL_DBGLVL_DLL_TRACE1 DEBUG_LVL_02_TRACE1 #define EPL_DBGLVL_DLL_TRACE1 DEBUG_LVL_02_TRACE1
#define EPL_DBGLVL_DLL_TRACE2 DEBUG_LVL_02_TRACE2 #define EPL_DBGLVL_DLL_TRACE2 DEBUG_LVL_02_TRACE2
#define EPL_DBGLVL_DLL_TRACE3 DEBUG_LVL_02_TRACE3 #define EPL_DBGLVL_DLL_TRACE3 DEBUG_LVL_02_TRACE3
#define EPL_DBGLVL_DLL_TRACE4 DEBUG_LVL_02_TRACE4 #define EPL_DBGLVL_DLL_TRACE4 DEBUG_LVL_02_TRACE4
#define EPL_DBGLVL_OBD DEBUG_LVL_03 // 0x00000004L #define EPL_DBGLVL_OBD DEBUG_LVL_03 // 0x00000004L
#define EPL_DBGLVL_OBD_TRACE0 DEBUG_LVL_03_TRACE0 #define EPL_DBGLVL_OBD_TRACE0 DEBUG_LVL_03_TRACE0
#define EPL_DBGLVL_OBD_TRACE1 DEBUG_LVL_03_TRACE1 #define EPL_DBGLVL_OBD_TRACE1 DEBUG_LVL_03_TRACE1
#define EPL_DBGLVL_OBD_TRACE2 DEBUG_LVL_03_TRACE2 #define EPL_DBGLVL_OBD_TRACE2 DEBUG_LVL_03_TRACE2
#define EPL_DBGLVL_OBD_TRACE3 DEBUG_LVL_03_TRACE3 #define EPL_DBGLVL_OBD_TRACE3 DEBUG_LVL_03_TRACE3
#define EPL_DBGLVL_OBD_TRACE4 DEBUG_LVL_03_TRACE4 #define EPL_DBGLVL_OBD_TRACE4 DEBUG_LVL_03_TRACE4
#define EPL_DBGLVL_NMTK DEBUG_LVL_04 // 0x00000008L #define EPL_DBGLVL_NMTK DEBUG_LVL_04 // 0x00000008L
#define EPL_DBGLVL_NMTK_TRACE0 DEBUG_LVL_04_TRACE0 #define EPL_DBGLVL_NMTK_TRACE0 DEBUG_LVL_04_TRACE0
#define EPL_DBGLVL_NMTK_TRACE1 DEBUG_LVL_04_TRACE1 #define EPL_DBGLVL_NMTK_TRACE1 DEBUG_LVL_04_TRACE1
#define EPL_DBGLVL_NMTK_TRACE2 DEBUG_LVL_04_TRACE2 #define EPL_DBGLVL_NMTK_TRACE2 DEBUG_LVL_04_TRACE2
#define EPL_DBGLVL_NMTK_TRACE3 DEBUG_LVL_04_TRACE3 #define EPL_DBGLVL_NMTK_TRACE3 DEBUG_LVL_04_TRACE3
#define EPL_DBGLVL_NMTK_TRACE4 DEBUG_LVL_04_TRACE4 #define EPL_DBGLVL_NMTK_TRACE4 DEBUG_LVL_04_TRACE4
#define EPL_DBGLVL_NMTCN DEBUG_LVL_05 // 0x00000010L #define EPL_DBGLVL_NMTCN DEBUG_LVL_05 // 0x00000010L
#define EPL_DBGLVL_NMTCN_TRACE0 DEBUG_LVL_05_TRACE0 #define EPL_DBGLVL_NMTCN_TRACE0 DEBUG_LVL_05_TRACE0
#define EPL_DBGLVL_NMTCN_TRACE1 DEBUG_LVL_05_TRACE1 #define EPL_DBGLVL_NMTCN_TRACE1 DEBUG_LVL_05_TRACE1
#define EPL_DBGLVL_NMTCN_TRACE2 DEBUG_LVL_05_TRACE2 #define EPL_DBGLVL_NMTCN_TRACE2 DEBUG_LVL_05_TRACE2
#define EPL_DBGLVL_NMTCN_TRACE3 DEBUG_LVL_05_TRACE3 #define EPL_DBGLVL_NMTCN_TRACE3 DEBUG_LVL_05_TRACE3
#define EPL_DBGLVL_NMTCN_TRACE4 DEBUG_LVL_05_TRACE4 #define EPL_DBGLVL_NMTCN_TRACE4 DEBUG_LVL_05_TRACE4
#define EPL_DBGLVL_NMTU DEBUG_LVL_06 // 0x00000020L #define EPL_DBGLVL_NMTU DEBUG_LVL_06 // 0x00000020L
#define EPL_DBGLVL_NMTU_TRACE0 DEBUG_LVL_06_TRACE0 #define EPL_DBGLVL_NMTU_TRACE0 DEBUG_LVL_06_TRACE0
#define EPL_DBGLVL_NMTU_TRACE1 DEBUG_LVL_06_TRACE1 #define EPL_DBGLVL_NMTU_TRACE1 DEBUG_LVL_06_TRACE1
#define EPL_DBGLVL_NMTU_TRACE2 DEBUG_LVL_06_TRACE2 #define EPL_DBGLVL_NMTU_TRACE2 DEBUG_LVL_06_TRACE2
#define EPL_DBGLVL_NMTU_TRACE3 DEBUG_LVL_06_TRACE3 #define EPL_DBGLVL_NMTU_TRACE3 DEBUG_LVL_06_TRACE3
#define EPL_DBGLVL_NMTU_TRACE4 DEBUG_LVL_06_TRACE4 #define EPL_DBGLVL_NMTU_TRACE4 DEBUG_LVL_06_TRACE4
#define EPL_DBGLVL_NMTMN DEBUG_LVL_07 // 0x00000040L #define EPL_DBGLVL_NMTMN DEBUG_LVL_07 // 0x00000040L
#define EPL_DBGLVL_NMTMN_TRACE0 DEBUG_LVL_07_TRACE0 #define EPL_DBGLVL_NMTMN_TRACE0 DEBUG_LVL_07_TRACE0
#define EPL_DBGLVL_NMTMN_TRACE1 DEBUG_LVL_07_TRACE1 #define EPL_DBGLVL_NMTMN_TRACE1 DEBUG_LVL_07_TRACE1
#define EPL_DBGLVL_NMTMN_TRACE2 DEBUG_LVL_07_TRACE2 #define EPL_DBGLVL_NMTMN_TRACE2 DEBUG_LVL_07_TRACE2
...@@ -324,28 +317,28 @@ typedef struct ...@@ -324,28 +317,28 @@ typedef struct
//... //...
#define EPL_DBGLVL_SDO DEBUG_LVL_25 // 0x01000000 #define EPL_DBGLVL_SDO DEBUG_LVL_25 // 0x01000000
#define EPL_DBGLVL_SDO_TRACE0 DEBUG_LVL_25_TRACE0 #define EPL_DBGLVL_SDO_TRACE0 DEBUG_LVL_25_TRACE0
#define EPL_DBGLVL_SDO_TRACE1 DEBUG_LVL_25_TRACE1 #define EPL_DBGLVL_SDO_TRACE1 DEBUG_LVL_25_TRACE1
#define EPL_DBGLVL_SDO_TRACE2 DEBUG_LVL_25_TRACE2 #define EPL_DBGLVL_SDO_TRACE2 DEBUG_LVL_25_TRACE2
#define EPL_DBGLVL_SDO_TRACE3 DEBUG_LVL_25_TRACE3 #define EPL_DBGLVL_SDO_TRACE3 DEBUG_LVL_25_TRACE3
#define EPL_DBGLVL_SDO_TRACE4 DEBUG_LVL_25_TRACE4 #define EPL_DBGLVL_SDO_TRACE4 DEBUG_LVL_25_TRACE4
#define EPL_DBGLVL_VETH DEBUG_LVL_26 // 0x02000000 #define EPL_DBGLVL_VETH DEBUG_LVL_26 // 0x02000000
#define EPL_DBGLVL_VETH_TRACE0 DEBUG_LVL_26_TRACE0 #define EPL_DBGLVL_VETH_TRACE0 DEBUG_LVL_26_TRACE0
#define EPL_DBGLVL_VETH_TRACE1 DEBUG_LVL_26_TRACE1 #define EPL_DBGLVL_VETH_TRACE1 DEBUG_LVL_26_TRACE1
#define EPL_DBGLVL_VETH_TRACE2 DEBUG_LVL_26_TRACE2 #define EPL_DBGLVL_VETH_TRACE2 DEBUG_LVL_26_TRACE2
#define EPL_DBGLVL_VETH_TRACE3 DEBUG_LVL_26_TRACE3 #define EPL_DBGLVL_VETH_TRACE3 DEBUG_LVL_26_TRACE3
#define EPL_DBGLVL_VETH_TRACE4 DEBUG_LVL_26_TRACE4 #define EPL_DBGLVL_VETH_TRACE4 DEBUG_LVL_26_TRACE4
#define EPL_DBGLVL_EVENTK DEBUG_LVL_27 // 0x04000000 #define EPL_DBGLVL_EVENTK DEBUG_LVL_27 // 0x04000000
#define EPL_DBGLVL_EVENTK_TRACE0 DEBUG_LVL_27_TRACE0 #define EPL_DBGLVL_EVENTK_TRACE0 DEBUG_LVL_27_TRACE0
#define EPL_DBGLVL_EVENTK_TRACE1 DEBUG_LVL_27_TRACE1 #define EPL_DBGLVL_EVENTK_TRACE1 DEBUG_LVL_27_TRACE1
#define EPL_DBGLVL_EVENTK_TRACE2 DEBUG_LVL_27_TRACE2 #define EPL_DBGLVL_EVENTK_TRACE2 DEBUG_LVL_27_TRACE2
#define EPL_DBGLVL_EVENTK_TRACE3 DEBUG_LVL_27_TRACE3 #define EPL_DBGLVL_EVENTK_TRACE3 DEBUG_LVL_27_TRACE3
#define EPL_DBGLVL_EVENTK_TRACE4 DEBUG_LVL_27_TRACE4 #define EPL_DBGLVL_EVENTK_TRACE4 DEBUG_LVL_27_TRACE4
#define EPL_DBGLVL_EVENTU DEBUG_LVL_28 // 0x08000000 #define EPL_DBGLVL_EVENTU DEBUG_LVL_28 // 0x08000000
#define EPL_DBGLVL_EVENTU_TRACE0 DEBUG_LVL_28_TRACE0 #define EPL_DBGLVL_EVENTU_TRACE0 DEBUG_LVL_28_TRACE0
#define EPL_DBGLVL_EVENTU_TRACE1 DEBUG_LVL_28_TRACE1 #define EPL_DBGLVL_EVENTU_TRACE1 DEBUG_LVL_28_TRACE1
#define EPL_DBGLVL_EVENTU_TRACE2 DEBUG_LVL_28_TRACE2 #define EPL_DBGLVL_EVENTU_TRACE2 DEBUG_LVL_28_TRACE2
...@@ -353,46 +346,40 @@ typedef struct ...@@ -353,46 +346,40 @@ typedef struct
#define EPL_DBGLVL_EVENTU_TRACE4 DEBUG_LVL_28_TRACE4 #define EPL_DBGLVL_EVENTU_TRACE4 DEBUG_LVL_28_TRACE4
// SharedBuff // SharedBuff
#define EPL_DBGLVL_SHB DEBUG_LVL_29 // 0x10000000 #define EPL_DBGLVL_SHB DEBUG_LVL_29 // 0x10000000
#define EPL_DBGLVL_SHB_TRACE0 DEBUG_LVL_29_TRACE0 #define EPL_DBGLVL_SHB_TRACE0 DEBUG_LVL_29_TRACE0
#define EPL_DBGLVL_SHB_TRACE1 DEBUG_LVL_29_TRACE1 #define EPL_DBGLVL_SHB_TRACE1 DEBUG_LVL_29_TRACE1
#define EPL_DBGLVL_SHB_TRACE2 DEBUG_LVL_29_TRACE2 #define EPL_DBGLVL_SHB_TRACE2 DEBUG_LVL_29_TRACE2
#define EPL_DBGLVL_SHB_TRACE3 DEBUG_LVL_29_TRACE3 #define EPL_DBGLVL_SHB_TRACE3 DEBUG_LVL_29_TRACE3
#define EPL_DBGLVL_SHB_TRACE4 DEBUG_LVL_29_TRACE4 #define EPL_DBGLVL_SHB_TRACE4 DEBUG_LVL_29_TRACE4
#define EPL_DBGLVL_ASSERT DEBUG_LVL_ASSERT // 0x20000000L #define EPL_DBGLVL_ASSERT DEBUG_LVL_ASSERT // 0x20000000L
#define EPL_DBGLVL_ASSERT_TRACE0 DEBUG_LVL_ASSERT_TRACE0 #define EPL_DBGLVL_ASSERT_TRACE0 DEBUG_LVL_ASSERT_TRACE0
#define EPL_DBGLVL_ASSERT_TRACE1 DEBUG_LVL_ASSERT_TRACE1 #define EPL_DBGLVL_ASSERT_TRACE1 DEBUG_LVL_ASSERT_TRACE1
#define EPL_DBGLVL_ASSERT_TRACE2 DEBUG_LVL_ASSERT_TRACE2 #define EPL_DBGLVL_ASSERT_TRACE2 DEBUG_LVL_ASSERT_TRACE2
#define EPL_DBGLVL_ASSERT_TRACE3 DEBUG_LVL_ASSERT_TRACE3 #define EPL_DBGLVL_ASSERT_TRACE3 DEBUG_LVL_ASSERT_TRACE3
#define EPL_DBGLVL_ASSERT_TRACE4 DEBUG_LVL_ASSERT_TRACE4 #define EPL_DBGLVL_ASSERT_TRACE4 DEBUG_LVL_ASSERT_TRACE4
#define EPL_DBGLVL_ERROR DEBUG_LVL_ERROR // 0x40000000L #define EPL_DBGLVL_ERROR DEBUG_LVL_ERROR // 0x40000000L
#define EPL_DBGLVL_ERROR_TRACE0 DEBUG_LVL_ERROR_TRACE0 #define EPL_DBGLVL_ERROR_TRACE0 DEBUG_LVL_ERROR_TRACE0
#define EPL_DBGLVL_ERROR_TRACE1 DEBUG_LVL_ERROR_TRACE1 #define EPL_DBGLVL_ERROR_TRACE1 DEBUG_LVL_ERROR_TRACE1
#define EPL_DBGLVL_ERROR_TRACE2 DEBUG_LVL_ERROR_TRACE2 #define EPL_DBGLVL_ERROR_TRACE2 DEBUG_LVL_ERROR_TRACE2
#define EPL_DBGLVL_ERROR_TRACE3 DEBUG_LVL_ERROR_TRACE3 #define EPL_DBGLVL_ERROR_TRACE3 DEBUG_LVL_ERROR_TRACE3
#define EPL_DBGLVL_ERROR_TRACE4 DEBUG_LVL_ERROR_TRACE4 #define EPL_DBGLVL_ERROR_TRACE4 DEBUG_LVL_ERROR_TRACE4
#define EPL_DBGLVL_ALWAYS DEBUG_LVL_ALWAYS // 0x80000000L #define EPL_DBGLVL_ALWAYS DEBUG_LVL_ALWAYS // 0x80000000L
#define EPL_DBGLVL_ALWAYS_TRACE0 DEBUG_LVL_ALWAYS_TRACE0 #define EPL_DBGLVL_ALWAYS_TRACE0 DEBUG_LVL_ALWAYS_TRACE0
#define EPL_DBGLVL_ALWAYS_TRACE1 DEBUG_LVL_ALWAYS_TRACE1 #define EPL_DBGLVL_ALWAYS_TRACE1 DEBUG_LVL_ALWAYS_TRACE1
#define EPL_DBGLVL_ALWAYS_TRACE2 DEBUG_LVL_ALWAYS_TRACE2 #define EPL_DBGLVL_ALWAYS_TRACE2 DEBUG_LVL_ALWAYS_TRACE2
#define EPL_DBGLVL_ALWAYS_TRACE3 DEBUG_LVL_ALWAYS_TRACE3 #define EPL_DBGLVL_ALWAYS_TRACE3 DEBUG_LVL_ALWAYS_TRACE3
#define EPL_DBGLVL_ALWAYS_TRACE4 DEBUG_LVL_ALWAYS_TRACE4 #define EPL_DBGLVL_ALWAYS_TRACE4 DEBUG_LVL_ALWAYS_TRACE4
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_INC_H_
#endif // #ifndef _EPL_INC_H_
此差异已折叠。
...@@ -66,39 +66,27 @@ ...@@ -66,39 +66,27 @@
2008/11/17 d.k.: start of the implementation 2008/11/17 d.k.: start of the implementation
****************************************************************************/ ****************************************************************************/
#ifndef _EPLLED_H_ #ifndef _EPLLED_H_
#define _EPLLED_H_ #define _EPLLED_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef enum {
typedef enum kEplLedTypeStatus = 0x00,
{ kEplLedTypeError = 0x01,
kEplLedTypeStatus = 0x00,
kEplLedTypeError = 0x01,
} tEplLedType; } tEplLedType;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPLLED_H_
#endif // #ifndef _EPLLED_H_
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
2006/05/22 d.k.: start of the implementation, version 1.00 2006/05/22 d.k.: start of the implementation, version 1.00
****************************************************************************/ ****************************************************************************/
#ifndef _EPL_PDO_H_ #ifndef _EPL_PDO_H_
...@@ -85,42 +84,34 @@ ...@@ -85,42 +84,34 @@
// NodeId for PRes TPDO // NodeId for PRes TPDO
#define EPL_PDO_PRES_NODE_ID 0x00 #define EPL_PDO_PRES_NODE_ID 0x00
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef struct typedef struct {
{ void *m_pVar;
void* m_pVar; WORD m_wOffset; // in Bits
WORD m_wOffset; // in Bits WORD m_wSize; // in Bits
WORD m_wSize; // in Bits BOOL m_fNumeric; // numeric value -> use AMI functions
BOOL m_fNumeric; // numeric value -> use AMI functions
} tEplPdoMapping; } tEplPdoMapping;
typedef struct typedef struct {
{ unsigned int m_uiSizeOfStruct;
unsigned int m_uiSizeOfStruct; unsigned int m_uiPdoId;
unsigned int m_uiPdoId; unsigned int m_uiNodeId;
unsigned int m_uiNodeId; // 0xFF=invalid, RPDO: 0x00=PReq, localNodeId=PRes, remoteNodeId=PRes
// 0xFF=invalid, RPDO: 0x00=PReq, localNodeId=PRes, remoteNodeId=PRes // TPDO: 0x00=PRes, MN: CnNodeId=PReq
// TPDO: 0x00=PRes, MN: CnNodeId=PReq
BOOL m_fTxRx; BOOL m_fTxRx;
BYTE m_bMappingVersion; BYTE m_bMappingVersion;
unsigned int m_uiMaxMappingEntries; // maximum number of mapping entries, i.e. size of m_aPdoMapping unsigned int m_uiMaxMappingEntries; // maximum number of mapping entries, i.e. size of m_aPdoMapping
tEplPdoMapping m_aPdoMapping[1]; tEplPdoMapping m_aPdoMapping[1];
} tEplPdoParam; } tEplPdoParam;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPL_PDO_H_
#endif // #ifndef _EPL_PDO_H_
此差异已折叠。
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
#ifndef _EPLSDOAC_H_ #ifndef _EPLSDOAC_H_
#define _EPLSDOAC_H_ #define _EPLSDOAC_H_
// ========================================================================= // =========================================================================
// SDO abort codes // SDO abort codes
// ========================================================================= // =========================================================================
...@@ -106,7 +105,6 @@ ...@@ -106,7 +105,6 @@
#define EPL_SDOAC_OBJECT_DICTIONARY_NOT_EXIST 0x08000023L #define EPL_SDOAC_OBJECT_DICTIONARY_NOT_EXIST 0x08000023L
#define EPL_SDOAC_CONFIG_DATA_EMPTY 0x08000024L #define EPL_SDOAC_CONFIG_DATA_EMPTY 0x08000024L
#endif // _EPLSDOAC_H_ #endif // _EPLSDOAC_H_
// Die letzte Zeile mu unbedingt eine leere Zeile sein, weil manche Compiler // Die letzte Zeile mu unbedingt eine leere Zeile sein, weil manche Compiler
......
此差异已折叠。
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
2006/07/06 k.t.: start of the implementation 2006/07/06 k.t.: start of the implementation
****************************************************************************/ ****************************************************************************/
#include "EplInc.h" #include "EplInc.h"
...@@ -75,12 +74,10 @@ ...@@ -75,12 +74,10 @@
#ifndef _EPLTIMER_H_ #ifndef _EPLTIMER_H_
#define _EPLTIMER_H_ #define _EPLTIMER_H_
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// const defines // const defines
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// typedef // typedef
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -88,38 +85,33 @@ ...@@ -88,38 +85,33 @@
// type for timer handle // type for timer handle
typedef unsigned long tEplTimerHdl; typedef unsigned long tEplTimerHdl;
typedef struct typedef struct {
{ tEplEventSink m_EventSink;
tEplEventSink m_EventSink; unsigned long m_ulArg; // d.k.: converted to unsigned long because
unsigned long m_ulArg; // d.k.: converted to unsigned long because // it is never accessed as a pointer by the
// it is never accessed as a pointer by the // timer module and the data the
// timer module and the data the // pointer points to is not saved in any way.
// pointer points to is not saved in any way. // It is just a value. The user is responsible
// It is just a value. The user is responsible // to store the data statically and convert
// to store the data statically and convert // the pointer between address spaces.
// the pointer between address spaces.
} tEplTimerArg; } tEplTimerArg;
typedef struct typedef struct {
{ tEplTimerHdl m_TimerHdl;
tEplTimerHdl m_TimerHdl; unsigned long m_ulArg; // d.k.: converted to unsigned long because
unsigned long m_ulArg; // d.k.: converted to unsigned long because // it is never accessed as a pointer by the
// it is never accessed as a pointer by the // timer module and the data the
// timer module and the data the // pointer points to is not saved in any way.
// pointer points to is not saved in any way. // It is just a value.
// It is just a value.
} tEplTimerEventArg; } tEplTimerEventArg;
typedef tEplKernel (PUBLIC * tEplTimerkCallback) ( typedef tEplKernel(PUBLIC * tEplTimerkCallback) (tEplTimerEventArg *
tEplTimerEventArg* pEventArg_p); pEventArg_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif // #ifndef _EPLTIMER_H_
#endif // #ifndef _EPLTIMER_H_
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册