···7373#ifndef _EDRVFEC_H_7474#define _EDRVFEC_H_75757676-7776//---------------------------------------------------------------------------7877// const defines7978//---------------------------------------------------------------------------8079// do this in config header8180#define TARGET_HARDWARE TGTHW_SPLC_CF5482818383-8482// base addresses8583#if ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5282)86848787-8885#elif ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5485)8989-90869187#else92889393- #error 'ERROR: Target was never implemented!'8989+#error 'ERROR: Target was never implemented!'94909591#endif9696-9797-98929993//---------------------------------------------------------------------------10094// types10195//---------------------------------------------------------------------------10296103103-10497// Rx and Tx buffer descriptor format105105-typedef struct106106-{107107- WORD m_wStatus; // control / status --- used by edrv, do not change in application108108- WORD m_wLength; // transfer length109109- BYTE * m_pbData; // buffer address9898+typedef struct {9999+ WORD m_wStatus; // control / status --- used by edrv, do not change in application100100+ WORD m_wLength; // transfer length101101+ BYTE *m_pbData; // buffer address110102} tBufferDescr;111103112104#if ((TARGET_HARDWARE & TGT_CPU_MASK_) == TGT_CPU_5282)···111119// function prototypes112120//---------------------------------------------------------------------------113121114114-115115-116116-#endif // #ifndef _EDRV_FEC_H_117117-118118-122122+#endif // #ifndef _EDRV_FEC_H_
+92-99
drivers/staging/epl/EdrvFec5282.h
···7373#ifndef _EDRVFEC_H_7474#define _EDRVFEC_H_75757676-7776//---------------------------------------------------------------------------7877// const defines7978//---------------------------------------------------------------------------8079// base addresses8180#define FEC0_ADDR 0x00008282-#define FEC1_ADDR 0x0000 //tbd8181+#define FEC1_ADDR 0x0000 //tbd83828483// control / status registers8585-#define FEC_EIR 0x1004 // interrupt event register8686-#define FEC_EIMR 0x1008 // interrupt mask register8787-#define FEC_RDAR 0x1010 // receive descriptor active register8888-#define FEC_TDAR 0x1014 // transmit descriptor active register8989-#define FEC_ECR 0x1024 // ethernet control register9090-#define FEC_MMFR 0x1040 // MII data register9191-#define FEC_MSCR 0x1044 // MII speed register9292-#define FEC_MIBC 0x1064 // MIB control/status register9393-#define FEC_RCR 0x1084 // receive control register9494-#define FEC_TCR 0x10C4 // transmit control register9595-#define FEC_PALR 0x10E4 // physical address low register9696-#define FEC_PAUR 0x10E8 // physical address high + type register9797-#define FEC_OPD 0x10EC // opcode + pause register9898-#define FEC_IAUR 0x1118 // upper 32 bit of individual hash table9999-#define FEC_IALR 0x111C // lower 32 bit of individual hash table100100-#define FEC_GAUR 0x1120 // upper 32 bit of group hash table101101-#define FEC_GALR 0x1124 // lower 32 bit of group hash table102102-#define FEC_TFWR 0x1144 // transmit FIFO watermark103103-#define FEC_FRBR 0x114C // FIFO receive bound register104104-#define FEC_FRSR 0x1150 // FIFO receive FIFO start register105105-#define FEC_ERDSR 0x1180 // pointer to receive descriptor ring106106-#define FEC_ETDSR 0x1184 // pointer to transmit descriptor ring107107-#define FEC_EMRBR 0x1188 // maximum receive buffer size8484+#define FEC_EIR 0x1004 // interrupt event register8585+#define FEC_EIMR 0x1008 // interrupt mask register8686+#define FEC_RDAR 0x1010 // receive descriptor active register8787+#define FEC_TDAR 0x1014 // transmit descriptor active register8888+#define FEC_ECR 0x1024 // ethernet control register8989+#define FEC_MMFR 0x1040 // MII data register9090+#define FEC_MSCR 0x1044 // MII speed register9191+#define FEC_MIBC 0x1064 // MIB control/status register9292+#define FEC_RCR 0x1084 // receive control register9393+#define FEC_TCR 0x10C4 // transmit control register9494+#define FEC_PALR 0x10E4 // physical address low register9595+#define FEC_PAUR 0x10E8 // physical address high + type register9696+#define FEC_OPD 0x10EC // opcode + pause register9797+#define FEC_IAUR 0x1118 // upper 32 bit of individual hash table9898+#define FEC_IALR 0x111C // lower 32 bit of individual hash table9999+#define FEC_GAUR 0x1120 // upper 32 bit of group hash table100100+#define FEC_GALR 0x1124 // lower 32 bit of group hash table101101+#define FEC_TFWR 0x1144 // transmit FIFO watermark102102+#define FEC_FRBR 0x114C // FIFO receive bound register103103+#define FEC_FRSR 0x1150 // FIFO receive FIFO start register104104+#define FEC_ERDSR 0x1180 // pointer to receive descriptor ring105105+#define FEC_ETDSR 0x1184 // pointer to transmit descriptor ring106106+#define FEC_EMRBR 0x1188 // maximum receive buffer size108107109108// mib block counters memory map110110-#define FEC_RMON_T_DROP 0x1200 // count of frames not counted correctly111111-#define FEC_RMON_T_PACKETS 0x1204 // RMON tx packet count112112-#define FEC_RMON_T_BC_PKT 0x1208 // RMON tx broadcast packets113113-#define FEC_RMON_T_MC_PKT 0x120C // RMON tx multicast packets114114-#define FEC_RMON_T_CRC_ALIGN 0x1210 // RMON tx packets w CRC/align error115115-#define FEC_RMON_T_UNDERSIZE 0x1214 // RMON tx packets < 64 bytes, good CRC116116-#define FEC_RMON_T_OVERSIZE 0x1218 // RMON tx packets > MAX_FL bytes, good CRC117117-#define FEC_RMON_T_FRAG 0x121C // RMON tx packets < 64 bytes, bad CRC118118-#define FEC_RMON_T_JAB 0x1220 // RMON tx packets > MAX_FL bytes, bad CRC119119-#define FEC_RMON_T_COL 0x1224 // RMON tx collision count120120-#define FEC_RMON_T_P64 0x1228 // RMON tx 64 byte packets121121-#define FEC_RMON_T_P65TO127 0x122C // RMON tx 65 to 127 byte packets122122-#define FEC_RMON_T_P128TO255 0x1230 // RMON tx 128 to 255 byte packets123123-#define FEC_RMON_T_P256TO511 0x1234 // RMON tx 256 to 511 byte packets124124-#define FEC_RMON_T_P512TO1023 0x1238 // RMON tx 512 to 1023 byte packets125125-#define FEC_RMON_T_P1024TO2047 0x123C // RMON tx 1024 to 2047 byte packets126126-#define FEC_RMON_T_P_GTE2048 0x1240 // RMON tx w > 2048 bytes127127-#define FEC_RMON_T_OCTETS 0x1244 // RMON tx octets128128-#define FEC_IEEE_T_DROP 0x1248 // count of frames not counted correctly129129-#define FEC_IEEE_T_FRAME_OK 0x124C // frames transmitted OK130130-#define FEC_IEEE_T_1COL 0x1250 // frames transmitted with single collision131131-#define FEC_IEEE_T_MCOL 0x1254 // frames transmitted with multiple collisions132132-#define FEC_IEEE_T_DEF 0x1258 // frames transmitted after deferral delay133133-#define FEC_IEEE_T_LCOL 0x125C // frames transmitted with late collisions134134-#define FEC_IEEE_T_EXCOL 0x1260 // frames transmitted with excessive collisions135135-#define FEC_IEEE_T_MACERR 0x1264 // frames transmitted with tx-FIFO underrun136136-#define FEC_IEEE_T_CSERR 0x1268 // frames transmitted with carrier sense error137137-#define FEC_IEEE_T_SQE 0x126C // frames transmitted with SQE error138138-#define FEC_IEEE_T_FDXFC 0x1270 // flow control pause frames transmitted139139-#define FEC_IEEE_T_OCTETS_OK 0x1274 // octet count for frames transmitted w/o error140140-#define FEC_RMON_R_PACKETS 0x1284 // RMON rx packet count141141-#define FEC_RMON_R_BC_PKT 0x1288 // RMON rx broadcast packets142142-#define FEC_RMON_R_MC_PKT 0x128C // RMON rx multicast packets143143-#define FEC_RMON_R_CRC_ALIGN 0x1290 // RMON rx packets w CRC/align error144144-#define FEC_RMON_R_UNDERSIZE 0x1294 // RMON rx packets < 64 bytes, good CRC145145-#define FEC_RMON_R_OVERSIZE 0x1298 // RMON rx packets > MAX_FL bytes, good CRC146146-#define FEC_RMON_R_FRAG 0x129C // RMON rx packets < 64 bytes, bad CRC147147-#define FEC_RMON_R_JAB 0x12A0 // RMON rx packets > MAX_FL bytes, bad CRC148148-#define FEC_RMON_R_RESVD_0 0x12A4 //149149-#define FEC_RMON_R_P64 0x12A8 // RMON rx 64 byte packets150150-#define FEC_RMON_R_P65T0127 0x12AC // RMON rx 65 to 127 byte packets151151-#define FEC_RMON_R_P128TO255 0x12B0 // RMON rx 128 to 255 byte packets152152-#define FEC_RMON_R_P256TO511 0x12B4 // RMON rx 256 to 511 byte packets153153-#define FEC_RMON_R_P512TO1023 0x12B8 // RMON rx 512 to 1023 byte packets154154-#define FEC_RMON_R_P1024TO2047 0x12BC // RMON rx 1024 to 2047 byte packets155155-#define FEC_RMON_R_GTE2048 0x12C0 // RMON rx w > 2048 bytes156156-#define FEC_RMON_R_OCTETS 0x12C4 // RMON rx octets157157-#define FEC_IEEE_R_DROP 0x12C8 // count of frames not counted correctly158158-#define FEC_IEEE_R_FRAME_OK 0x12CC // frames received OK159159-#define FEC_IEEE_R_CRC 0x12D0 // frames received with CRC error160160-#define FEC_IEEE_R_ALIGN 0x12D4 // frames received with alignment error161161-#define FEC_IEEE_R_MACERR 0x12D8 // receive FIFO overflow count162162-#define FEC_IEEE_R_FDXFC 0x12DC // flow control pause frames received163163-#define FEC_IEEE_R_OCTETS_OK 0x12E0 // octet count for frames rcvd w/o error109109+#define FEC_RMON_T_DROP 0x1200 // count of frames not counted correctly110110+#define FEC_RMON_T_PACKETS 0x1204 // RMON tx packet count111111+#define FEC_RMON_T_BC_PKT 0x1208 // RMON tx broadcast packets112112+#define FEC_RMON_T_MC_PKT 0x120C // RMON tx multicast packets113113+#define FEC_RMON_T_CRC_ALIGN 0x1210 // RMON tx packets w CRC/align error114114+#define FEC_RMON_T_UNDERSIZE 0x1214 // RMON tx packets < 64 bytes, good CRC115115+#define FEC_RMON_T_OVERSIZE 0x1218 // RMON tx packets > MAX_FL bytes, good CRC116116+#define FEC_RMON_T_FRAG 0x121C // RMON tx packets < 64 bytes, bad CRC117117+#define FEC_RMON_T_JAB 0x1220 // RMON tx packets > MAX_FL bytes, bad CRC118118+#define FEC_RMON_T_COL 0x1224 // RMON tx collision count119119+#define FEC_RMON_T_P64 0x1228 // RMON tx 64 byte packets120120+#define FEC_RMON_T_P65TO127 0x122C // RMON tx 65 to 127 byte packets121121+#define FEC_RMON_T_P128TO255 0x1230 // RMON tx 128 to 255 byte packets122122+#define FEC_RMON_T_P256TO511 0x1234 // RMON tx 256 to 511 byte packets123123+#define FEC_RMON_T_P512TO1023 0x1238 // RMON tx 512 to 1023 byte packets124124+#define FEC_RMON_T_P1024TO2047 0x123C // RMON tx 1024 to 2047 byte packets125125+#define FEC_RMON_T_P_GTE2048 0x1240 // RMON tx w > 2048 bytes126126+#define FEC_RMON_T_OCTETS 0x1244 // RMON tx octets127127+#define FEC_IEEE_T_DROP 0x1248 // count of frames not counted correctly128128+#define FEC_IEEE_T_FRAME_OK 0x124C // frames transmitted OK129129+#define FEC_IEEE_T_1COL 0x1250 // frames transmitted with single collision130130+#define FEC_IEEE_T_MCOL 0x1254 // frames transmitted with multiple collisions131131+#define FEC_IEEE_T_DEF 0x1258 // frames transmitted after deferral delay132132+#define FEC_IEEE_T_LCOL 0x125C // frames transmitted with late collisions133133+#define FEC_IEEE_T_EXCOL 0x1260 // frames transmitted with excessive collisions134134+#define FEC_IEEE_T_MACERR 0x1264 // frames transmitted with tx-FIFO underrun135135+#define FEC_IEEE_T_CSERR 0x1268 // frames transmitted with carrier sense error136136+#define FEC_IEEE_T_SQE 0x126C // frames transmitted with SQE error137137+#define FEC_IEEE_T_FDXFC 0x1270 // flow control pause frames transmitted138138+#define FEC_IEEE_T_OCTETS_OK 0x1274 // octet count for frames transmitted w/o error139139+#define FEC_RMON_R_PACKETS 0x1284 // RMON rx packet count140140+#define FEC_RMON_R_BC_PKT 0x1288 // RMON rx broadcast packets141141+#define FEC_RMON_R_MC_PKT 0x128C // RMON rx multicast packets142142+#define FEC_RMON_R_CRC_ALIGN 0x1290 // RMON rx packets w CRC/align error143143+#define FEC_RMON_R_UNDERSIZE 0x1294 // RMON rx packets < 64 bytes, good CRC144144+#define FEC_RMON_R_OVERSIZE 0x1298 // RMON rx packets > MAX_FL bytes, good CRC145145+#define FEC_RMON_R_FRAG 0x129C // RMON rx packets < 64 bytes, bad CRC146146+#define FEC_RMON_R_JAB 0x12A0 // RMON rx packets > MAX_FL bytes, bad CRC147147+#define FEC_RMON_R_RESVD_0 0x12A4 //148148+#define FEC_RMON_R_P64 0x12A8 // RMON rx 64 byte packets149149+#define FEC_RMON_R_P65T0127 0x12AC // RMON rx 65 to 127 byte packets150150+#define FEC_RMON_R_P128TO255 0x12B0 // RMON rx 128 to 255 byte packets151151+#define FEC_RMON_R_P256TO511 0x12B4 // RMON rx 256 to 511 byte packets152152+#define FEC_RMON_R_P512TO1023 0x12B8 // RMON rx 512 to 1023 byte packets153153+#define FEC_RMON_R_P1024TO2047 0x12BC // RMON rx 1024 to 2047 byte packets154154+#define FEC_RMON_R_GTE2048 0x12C0 // RMON rx w > 2048 bytes155155+#define FEC_RMON_R_OCTETS 0x12C4 // RMON rx octets156156+#define FEC_IEEE_R_DROP 0x12C8 // count of frames not counted correctly157157+#define FEC_IEEE_R_FRAME_OK 0x12CC // frames received OK158158+#define FEC_IEEE_R_CRC 0x12D0 // frames received with CRC error159159+#define FEC_IEEE_R_ALIGN 0x12D4 // frames received with alignment error160160+#define FEC_IEEE_R_MACERR 0x12D8 // receive FIFO overflow count161161+#define FEC_IEEE_R_FDXFC 0x12DC // flow control pause frames received162162+#define FEC_IEEE_R_OCTETS_OK 0x12E0 // octet count for frames rcvd w/o error164163165164// register bit definitions and macros166165#define FEC_EIR_UN (0x00080000)···314315//---------------------------------------------------------------------------315316316317// Rx and Tx buffer descriptor format317317-typedef struct318318-{319319- WORD m_wStatus; // control / status --- used by edrv, do not change in application320320- WORD m_wLength; // transfer length321321- BYTE * m_pbData; // buffer address318318+typedef struct {319319+ WORD m_wStatus; // control / status --- used by edrv, do not change in application320320+ WORD m_wLength; // transfer length321321+ BYTE *m_pbData; // buffer address322322} tBufferDescr;323323324324//---------------------------------------------------------------------------···325327//---------------------------------------------------------------------------326328327329#if (NO_OF_INSTANCES > 1)328328- #define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[off]) = val)329329- #define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[off]))330330+#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[off]) = val)331331+#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[off]))330332#else331331- #if (EDRV_USED_ETH_CTRL == 0)332332- #define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]) = val)333333- #define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]))334334- #else335335- #define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]) = val)336336- #define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]))337337- #endif333333+#if (EDRV_USED_ETH_CTRL == 0)334334+#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]) = val)335335+#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC0_ADDR+off]))336336+#else337337+#define ECI_WRITE_DW_REG(off,val) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]) = val)338338+#define ECI_READ_DW_REG(off) (*(DWORD *)(void *)(&__IPSBAR[FEC1_ADDR+off]))339339+#endif338340#endif339341340340-341341-342342-343343-#endif // #ifndef _EDRV_FEC_H_344344-345345-342342+#endif // #ifndef _EDRV_FEC_H_
+3-8
drivers/staging/epl/EdrvSim.h
···7171#ifndef _EDRVSIM_H_7272#define _EDRVSIM_H_73737474-7574//---------------------------------------------------------------------------7675// const defines7776//---------------------------------------------------------------------------···7980// types8081//---------------------------------------------------------------------------81828282-8383//---------------------------------------------------------------------------8484// function prototypes8585//---------------------------------------------------------------------------86868787-void EdrvRxInterruptHandler (BYTE bBufferInFrame_p, BYTE * pbEthernetData_p, WORD wDataLen_p);8787+void EdrvRxInterruptHandler(BYTE bBufferInFrame_p, BYTE * pbEthernetData_p,8888+ WORD wDataLen_p);88898989-9090-9191-#endif // #ifndef _EDRVSIM_H_9292-9393-9090+#endif // #ifndef _EDRVSIM_H_
+130-161
drivers/staging/epl/Epl.h
···66666767 2006/05/22 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_API_H_···8182// const defines8283//---------------------------------------------------------------------------83848484-8585//---------------------------------------------------------------------------8686// typedef8787//---------------------------------------------------------------------------88888989-9090-typedef struct9191-{9292- unsigned int m_uiNodeId;9393- tEplNmtState m_NmtState;9494- tEplNmtNodeEvent m_NodeEvent;9595- WORD m_wErrorCode; // EPL error code if m_NodeEvent == kEplNmtNodeEventError9696- BOOL m_fMandatory;8989+typedef struct {9090+ unsigned int m_uiNodeId;9191+ tEplNmtState m_NmtState;9292+ tEplNmtNodeEvent m_NodeEvent;9393+ WORD m_wErrorCode; // EPL error code if m_NodeEvent == kEplNmtNodeEventError9494+ BOOL m_fMandatory;97959896} tEplApiEventNode;9997100100-101101-typedef struct102102-{103103- tEplNmtState m_NmtState; // local NMT state104104- tEplNmtBootEvent m_BootEvent;105105- WORD m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError9898+typedef struct {9999+ tEplNmtState m_NmtState; // local NMT state100100+ tEplNmtBootEvent m_BootEvent;101101+ WORD m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError106102107103} tEplApiEventBoot;108104109109-110110-typedef struct111111-{112112- tEplLedType m_LedType; // type of the LED (e.g. Status or Error)113113- BOOL m_fOn; // state of the LED (e.g. on or off)105105+typedef struct {106106+ tEplLedType m_LedType; // type of the LED (e.g. Status or Error)107107+ BOOL m_fOn; // state of the LED (e.g. on or off)114108115109} tEplApiEventLed;116110117117-118118-typedef enum119119-{120120- kEplApiEventNmtStateChange = 0x10, // m_NmtStateChange111111+typedef enum {112112+ kEplApiEventNmtStateChange = 0x10, // m_NmtStateChange121113// kEplApiEventRequestNmt = 0x11, // m_bNmtCmd122122- kEplApiEventCriticalError = 0x12, // m_InternalError, Stack halted123123- kEplApiEventWarning = 0x13, // m_InternalError, Stack running124124- kEplApiEventNode = 0x20, // m_Node125125- kEplApiEventBoot = 0x21, // m_Boot126126- kEplApiEventSdo = 0x62, // m_Sdo127127- kEplApiEventObdAccess = 0x69, // m_ObdCbParam128128- kEplApiEventLed = 0x70, // m_Led114114+ kEplApiEventCriticalError = 0x12, // m_InternalError, Stack halted115115+ kEplApiEventWarning = 0x13, // m_InternalError, Stack running116116+ kEplApiEventNode = 0x20, // m_Node117117+ kEplApiEventBoot = 0x21, // m_Boot118118+ kEplApiEventSdo = 0x62, // m_Sdo119119+ kEplApiEventObdAccess = 0x69, // m_ObdCbParam120120+ kEplApiEventLed = 0x70, // m_Led129121130122} tEplApiEventType;131123132132-133133-typedef union134134-{135135- tEplEventNmtStateChange m_NmtStateChange;136136- tEplEventError m_InternalError;137137- tEplSdoComFinished m_Sdo;138138- tEplObdCbParam m_ObdCbParam;139139- tEplApiEventNode m_Node;140140- tEplApiEventBoot m_Boot;141141- tEplApiEventLed m_Led;124124+typedef union {125125+ tEplEventNmtStateChange m_NmtStateChange;126126+ tEplEventError m_InternalError;127127+ tEplSdoComFinished m_Sdo;128128+ tEplObdCbParam m_ObdCbParam;129129+ tEplApiEventNode m_Node;130130+ tEplApiEventBoot m_Boot;131131+ tEplApiEventLed m_Led;142132143133} tEplApiEventArg;144134135135+typedef tEplKernel(PUBLIC ROM * tEplApiCbEvent) (tEplApiEventType EventType_p, // IN: event type (enum)136136+ tEplApiEventArg * pEventArg_p, // IN: event argument (union)137137+ void GENERIC * pUserArg_p);145138146146-typedef tEplKernel (PUBLIC ROM* tEplApiCbEvent) (147147- tEplApiEventType EventType_p, // IN: event type (enum)148148- tEplApiEventArg* pEventArg_p, // IN: event argument (union)149149- void GENERIC* pUserArg_p);139139+typedef struct {140140+ unsigned int m_uiSizeOfStruct;141141+ BOOL m_fAsyncOnly; // do not need to register PRes142142+ unsigned int m_uiNodeId; // local node ID143143+ BYTE m_abMacAddress[6]; // local MAC address150144145145+ // 0x1F82: NMT_FeatureFlags_U32146146+ DWORD m_dwFeatureFlags;147147+ // Cycle Length (0x1006: NMT_CycleLen_U32) in [us]148148+ DWORD m_dwCycleLen; // required for error detection149149+ // 0x1F98: NMT_CycleTiming_REC150150+ // 0x1F98.1: IsochrTxMaxPayload_U16151151+ unsigned int m_uiIsochrTxMaxPayload; // const152152+ // 0x1F98.2: IsochrRxMaxPayload_U16153153+ unsigned int m_uiIsochrRxMaxPayload; // const154154+ // 0x1F98.3: PResMaxLatency_U32155155+ DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes156156+ // 0x1F98.4: PReqActPayloadLimit_U16157157+ unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+28 bytes)158158+ // 0x1F98.5: PResActPayloadLimit_U16159159+ unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+28 bytes)160160+ // 0x1F98.6: ASndMaxLatency_U32161161+ DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes162162+ // 0x1F98.7: MultiplCycleCnt_U8163163+ unsigned int m_uiMultiplCycleCnt; // required for error detection164164+ // 0x1F98.8: AsyncMTU_U16165165+ unsigned int m_uiAsyncMtu; // required to set up max frame size166166+ // 0x1F98.9: Prescaler_U16167167+ unsigned int m_uiPrescaler; // required for sync168168+ // $$$ Multiplexed Slot151169152152-typedef struct153153-{154154- unsigned int m_uiSizeOfStruct;155155- BOOL m_fAsyncOnly; // do not need to register PRes156156- unsigned int m_uiNodeId; // local node ID157157- BYTE m_abMacAddress[6]; // local MAC address170170+ // 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns]171171+ DWORD m_dwLossOfFrameTolerance;158172159159- // 0x1F82: NMT_FeatureFlags_U32160160- DWORD m_dwFeatureFlags;161161- // Cycle Length (0x1006: NMT_CycleLen_U32) in [us]162162- DWORD m_dwCycleLen; // required for error detection163163- // 0x1F98: NMT_CycleTiming_REC164164- // 0x1F98.1: IsochrTxMaxPayload_U16165165- unsigned int m_uiIsochrTxMaxPayload; // const166166- // 0x1F98.2: IsochrRxMaxPayload_U16167167- unsigned int m_uiIsochrRxMaxPayload; // const168168- // 0x1F98.3: PResMaxLatency_U32169169- DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes170170- // 0x1F98.4: PReqActPayloadLimit_U16171171- unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+28 bytes)172172- // 0x1F98.5: PResActPayloadLimit_U16173173- unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+28 bytes)174174- // 0x1F98.6: ASndMaxLatency_U32175175- DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes176176- // 0x1F98.7: MultiplCycleCnt_U8177177- unsigned int m_uiMultiplCycleCnt; // required for error detection178178- // 0x1F98.8: AsyncMTU_U16179179- unsigned int m_uiAsyncMtu; // required to set up max frame size180180- // 0x1F98.9: Prescaler_U16181181- unsigned int m_uiPrescaler; // required for sync182182- // $$$ Multiplexed Slot173173+ // 0x1F8A: NMT_MNCycleTiming_REC174174+ // 0x1F8A.1: WaitSoCPReq_U32 in [ns]175175+ DWORD m_dwWaitSocPreq;183176184184- // 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns]185185- DWORD m_dwLossOfFrameTolerance;177177+ // 0x1F8A.2: AsyncSlotTimeout_U32 in [ns]178178+ DWORD m_dwAsyncSlotTimeout;186179187187- // 0x1F8A: NMT_MNCycleTiming_REC188188- // 0x1F8A.1: WaitSoCPReq_U32 in [ns]189189- DWORD m_dwWaitSocPreq;180180+ DWORD m_dwDeviceType; // NMT_DeviceType_U32181181+ DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32182182+ DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32183183+ DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32184184+ DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32185185+ QWORD m_qwVendorSpecificExt1;186186+ DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32187187+ DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32188188+ DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device189189+ DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device190190+ DWORD m_dwIpAddress;191191+ DWORD m_dwSubnetMask;192192+ DWORD m_dwDefaultGateway;193193+ BYTE m_sHostname[32];194194+ BYTE m_abVendorSpecificExt2[48];190195191191- // 0x1F8A.2: AsyncSlotTimeout_U32 in [ns]192192- DWORD m_dwAsyncSlotTimeout;196196+ char *m_pszDevName; // NMT_ManufactDevName_VS (0x1008/0 local OD)197197+ char *m_pszHwVersion; // NMT_ManufactHwVers_VS (0x1009/0 local OD)198198+ char *m_pszSwVersion; // NMT_ManufactSwVers_VS (0x100A/0 local OD)193199194194- DWORD m_dwDeviceType; // NMT_DeviceType_U32195195- DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32196196- DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32197197- DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32198198- DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32199199- QWORD m_qwVendorSpecificExt1;200200- DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32201201- DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32202202- DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device203203- DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device204204- DWORD m_dwIpAddress;205205- DWORD m_dwSubnetMask;206206- DWORD m_dwDefaultGateway;207207- BYTE m_sHostname[32];208208- BYTE m_abVendorSpecificExt2[48];209209-210210- char* m_pszDevName; // NMT_ManufactDevName_VS (0x1008/0 local OD)211211- char* m_pszHwVersion; // NMT_ManufactHwVers_VS (0x1009/0 local OD)212212- char* m_pszSwVersion; // NMT_ManufactSwVers_VS (0x100A/0 local OD)213213-214214- tEplApiCbEvent m_pfnCbEvent;215215- void* m_pEventUserArg;216216- tEplSyncCb m_pfnCbSync;200200+ tEplApiCbEvent m_pfnCbEvent;201201+ void *m_pEventUserArg;202202+ tEplSyncCb m_pfnCbSync;217203218204} tEplApiInitParam;219205220220-221221-typedef struct222222-{223223- void* m_pImage;224224- unsigned int m_uiSize;206206+typedef struct {207207+ void *m_pImage;208208+ unsigned int m_uiSize;225209226210} tEplApiProcessImage;227227-228211229212//---------------------------------------------------------------------------230213// function prototypes231214//---------------------------------------------------------------------------232215233233-tEplKernel PUBLIC EplApiInitialize(tEplApiInitParam* pInitParam_p);216216+tEplKernel PUBLIC EplApiInitialize(tEplApiInitParam * pInitParam_p);234217235218tEplKernel PUBLIC EplApiShutdown(void);236219237237-tEplKernel PUBLIC EplApiReadObject(238238- tEplSdoComConHdl* pSdoComConHdl_p,239239- unsigned int uiNodeId_p,240240- unsigned int uiIndex_p,241241- unsigned int uiSubindex_p,242242- void* pDstData_le_p,243243- unsigned int* puiSize_p,244244- tEplSdoType SdoType_p,245245- void* pUserArg_p);220220+tEplKernel PUBLIC EplApiReadObject(tEplSdoComConHdl * pSdoComConHdl_p,221221+ unsigned int uiNodeId_p,222222+ unsigned int uiIndex_p,223223+ unsigned int uiSubindex_p,224224+ void *pDstData_le_p,225225+ unsigned int *puiSize_p,226226+ tEplSdoType SdoType_p, void *pUserArg_p);246227247247-tEplKernel PUBLIC EplApiWriteObject(248248- tEplSdoComConHdl* pSdoComConHdl_p,249249- unsigned int uiNodeId_p,250250- unsigned int uiIndex_p,251251- unsigned int uiSubindex_p,252252- void* pSrcData_le_p,253253- unsigned int uiSize_p,254254- tEplSdoType SdoType_p,255255- void* pUserArg_p);228228+tEplKernel PUBLIC EplApiWriteObject(tEplSdoComConHdl * pSdoComConHdl_p,229229+ unsigned int uiNodeId_p,230230+ unsigned int uiIndex_p,231231+ unsigned int uiSubindex_p,232232+ void *pSrcData_le_p,233233+ unsigned int uiSize_p,234234+ tEplSdoType SdoType_p, void *pUserArg_p);256235257257-tEplKernel PUBLIC EplApiFreeSdoChannel(258258- tEplSdoComConHdl SdoComConHdl_p);236236+tEplKernel PUBLIC EplApiFreeSdoChannel(tEplSdoComConHdl SdoComConHdl_p);259237260260-tEplKernel PUBLIC EplApiReadLocalObject(261261- unsigned int uiIndex_p,262262- unsigned int uiSubindex_p,263263- void* pDstData_p,264264- unsigned int* puiSize_p);238238+tEplKernel PUBLIC EplApiReadLocalObject(unsigned int uiIndex_p,239239+ unsigned int uiSubindex_p,240240+ void *pDstData_p,241241+ unsigned int *puiSize_p);265242266266-tEplKernel PUBLIC EplApiWriteLocalObject(267267- unsigned int uiIndex_p,268268- unsigned int uiSubindex_p,269269- void* pSrcData_p,270270- unsigned int uiSize_p);243243+tEplKernel PUBLIC EplApiWriteLocalObject(unsigned int uiIndex_p,244244+ unsigned int uiSubindex_p,245245+ void *pSrcData_p,246246+ unsigned int uiSize_p);271247272272-tEplKernel PUBLIC EplApiCbObdAccess(tEplObdCbParam MEM* pParam_p);248248+tEplKernel PUBLIC EplApiCbObdAccess(tEplObdCbParam MEM * pParam_p);273249274274-tEplKernel PUBLIC EplApiLinkObject( unsigned int uiObjIndex_p,275275- void* pVar_p,276276- unsigned int* puiVarEntries_p,277277- tEplObdSize* pEntrySize_p,278278- unsigned int uiFirstSubindex_p);250250+tEplKernel PUBLIC EplApiLinkObject(unsigned int uiObjIndex_p,251251+ void *pVar_p,252252+ unsigned int *puiVarEntries_p,253253+ tEplObdSize * pEntrySize_p,254254+ unsigned int uiFirstSubindex_p);279255280256tEplKernel PUBLIC EplApiExecNmtCommand(tEplNmtEvent NmtEvent_p);281257282258tEplKernel PUBLIC EplApiProcess(void);283259284284-285260#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)286261tEplKernel PUBLIC EplApiMnTriggerStateChange(unsigned int uiNodeId_p,287287- tEplNmtNodeCommand NodeCommand_p);262262+ tEplNmtNodeCommand NodeCommand_p);288263#endif289264290290-tEplKernel PUBLIC EplApiGetIdentResponse(291291- unsigned int uiNodeId_p,292292- tEplIdentResponse** ppIdentResponse_p);293293-265265+tEplKernel PUBLIC EplApiGetIdentResponse(unsigned int uiNodeId_p,266266+ tEplIdentResponse **267267+ ppIdentResponse_p);294268295269// functions for process image will be implemented in separate file296270tEplKernel PUBLIC EplApiProcessImageSetup(void);297297-tEplKernel PUBLIC EplApiProcessImageExchangeIn(tEplApiProcessImage* pPI_p);298298-tEplKernel PUBLIC EplApiProcessImageExchangeOut(tEplApiProcessImage* pPI_p);271271+tEplKernel PUBLIC EplApiProcessImageExchangeIn(tEplApiProcessImage * pPI_p);272272+tEplKernel PUBLIC EplApiProcessImageExchangeOut(tEplApiProcessImage * pPI_p);299273300300-301301-#endif // #ifndef _EPL_API_H_302302-303303-274274+#endif // #ifndef _EPL_API_H_
+54-72
drivers/staging/epl/EplAmi.h
···8686#ifndef _EPLAMI_H_8787#define _EPLAMI_H_88888989-9089#if ((DEV_SYSTEM & _DEV_64BIT_SUPPORT_) == 0)9190// #ifdef USE_VAR649292- #error 'ERROR: development system does not support 64 bit operations!'9191+#error 'ERROR: development system does not support 64 bit operations!'9392// #endif9493#endif9595-96949795//---------------------------------------------------------------------------9896// types9997//---------------------------------------------------------------------------100100-1019810299//---------------------------------------------------------------------------103100// Prototypen104101//---------------------------------------------------------------------------105102106103#ifdef __cplusplus107107- extern "C" {104104+extern "C" {108105#endif109106110107#if (TARGET_SYSTEM == _WIN32_)111111- #if defined(INLINE_FUNCTION_DEF)112112- #undef INLINE_FUNCTION113113- #define INLINE_FUNCTION INLINE_FUNCTION_DEF114114- #define INLINE_ENABLED TRUE115115- #define EPL_AMI_INLINED116116- #include "../EplStack/amix86.c"117117- #endif108108+#if defined(INLINE_FUNCTION_DEF)109109+#undef INLINE_FUNCTION110110+#define INLINE_FUNCTION INLINE_FUNCTION_DEF111111+#define INLINE_ENABLED TRUE112112+#define EPL_AMI_INLINED113113+#include "../EplStack/amix86.c"114114+#endif118115119116#elif (TARGET_SYSTEM == _LINUX_)120120- #if defined(__m68k__) // it is an big endian machine121121- #if defined(INLINE_FUNCTION_DEF)122122- #undef INLINE_FUNCTION123123- #define INLINE_FUNCTION INLINE_FUNCTION_DEF124124- #define INLINE_ENABLED TRUE125125- #define EPL_AMI_INLINED126126- #include "../EplStack/amibe.c"127127- #endif128128- #endif117117+#if defined(__m68k__) // it is an big endian machine118118+#if defined(INLINE_FUNCTION_DEF)119119+#undef INLINE_FUNCTION120120+#define INLINE_FUNCTION INLINE_FUNCTION_DEF121121+#define INLINE_ENABLED TRUE122122+#define EPL_AMI_INLINED123123+#include "../EplStack/amibe.c"124124+#endif125125+#endif129126#endif130127131128//---------------------------------------------------------------------------···137140#define AmiSetByteToLe(pAddr_p, bByteVal_p) {*(BYTE FAR*)(pAddr_p) = (bByteVal_p);}138141139142#if !defined(INLINE_ENABLED)140140-void PUBLIC AmiSetWordToBe (void FAR* pAddr_p, WORD wWordVal_p);141141-void PUBLIC AmiSetDwordToBe (void FAR* pAddr_p, DWORD dwDwordVal_p);142142-void PUBLIC AmiSetWordToLe (void FAR* pAddr_p, WORD wWordVal_p);143143-void PUBLIC AmiSetDwordToLe (void FAR* pAddr_p, DWORD dwDwordVal_p);143143+ void PUBLIC AmiSetWordToBe(void FAR * pAddr_p, WORD wWordVal_p);144144+ void PUBLIC AmiSetDwordToBe(void FAR * pAddr_p, DWORD dwDwordVal_p);145145+ void PUBLIC AmiSetWordToLe(void FAR * pAddr_p, WORD wWordVal_p);146146+ void PUBLIC AmiSetDwordToLe(void FAR * pAddr_p, DWORD dwDwordVal_p);144147#endif145145-146148147149//---------------------------------------------------------------------------148150//···156160157161#if !defined(INLINE_ENABLED)158162159159-WORD PUBLIC AmiGetWordFromBe (void FAR* pAddr_p);160160-DWORD PUBLIC AmiGetDwordFromBe (void FAR* pAddr_p);161161-WORD PUBLIC AmiGetWordFromLe (void FAR* pAddr_p);162162-DWORD PUBLIC AmiGetDwordFromLe (void FAR* pAddr_p);163163+ WORD PUBLIC AmiGetWordFromBe(void FAR * pAddr_p);164164+ DWORD PUBLIC AmiGetDwordFromBe(void FAR * pAddr_p);165165+ WORD PUBLIC AmiGetWordFromLe(void FAR * pAddr_p);166166+ DWORD PUBLIC AmiGetDwordFromLe(void FAR * pAddr_p);163167164168//---------------------------------------------------------------------------165169//···174178//175179//---------------------------------------------------------------------------176180177177-void PUBLIC AmiSetDword24ToBe (void FAR* pAddr_p, DWORD dwDwordVal_p);178178-void PUBLIC AmiSetDword24ToLe (void FAR* pAddr_p, DWORD dwDwordVal_p);179179-181181+ void PUBLIC AmiSetDword24ToBe(void FAR * pAddr_p, DWORD dwDwordVal_p);182182+ void PUBLIC AmiSetDword24ToLe(void FAR * pAddr_p, DWORD dwDwordVal_p);180183181184//---------------------------------------------------------------------------182185//···189194//190195//---------------------------------------------------------------------------191196192192-DWORD PUBLIC AmiGetDword24FromBe (void FAR* pAddr_p);193193-DWORD PUBLIC AmiGetDword24FromLe (void FAR* pAddr_p);194194-197197+ DWORD PUBLIC AmiGetDword24FromBe(void FAR * pAddr_p);198198+ DWORD PUBLIC AmiGetDword24FromLe(void FAR * pAddr_p);195199196200//#ifdef USE_VAR64197201···207213//208214//---------------------------------------------------------------------------209215210210-void PUBLIC AmiSetQword40ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p);211211-void PUBLIC AmiSetQword40ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);212212-216216+ void PUBLIC AmiSetQword40ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);217217+ void PUBLIC AmiSetQword40ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);213218214219//---------------------------------------------------------------------------215220//···222229//223230//---------------------------------------------------------------------------224231225225-QWORD PUBLIC AmiGetQword40FromBe (void FAR* pAddr_p);226226-QWORD PUBLIC AmiGetQword40FromLe (void FAR* pAddr_p);227227-232232+ QWORD PUBLIC AmiGetQword40FromBe(void FAR * pAddr_p);233233+ QWORD PUBLIC AmiGetQword40FromLe(void FAR * pAddr_p);228234229235//---------------------------------------------------------------------------230236//···238246//239247//---------------------------------------------------------------------------240248241241-void PUBLIC AmiSetQword48ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p);242242-void PUBLIC AmiSetQword48ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);243243-249249+ void PUBLIC AmiSetQword48ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);250250+ void PUBLIC AmiSetQword48ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);244251245252//---------------------------------------------------------------------------246253//···253262//254263//---------------------------------------------------------------------------255264256256-QWORD PUBLIC AmiGetQword48FromBe (void FAR* pAddr_p);257257-QWORD PUBLIC AmiGetQword48FromLe (void FAR* pAddr_p);258258-265265+ QWORD PUBLIC AmiGetQword48FromBe(void FAR * pAddr_p);266266+ QWORD PUBLIC AmiGetQword48FromLe(void FAR * pAddr_p);259267260268//---------------------------------------------------------------------------261269//···269279//270280//---------------------------------------------------------------------------271281272272-void PUBLIC AmiSetQword56ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p);273273-void PUBLIC AmiSetQword56ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);274274-282282+ void PUBLIC AmiSetQword56ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);283283+ void PUBLIC AmiSetQword56ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);275284276285//---------------------------------------------------------------------------277286//···284295//285296//---------------------------------------------------------------------------286297287287-QWORD PUBLIC AmiGetQword56FromBe (void FAR* pAddr_p);288288-QWORD PUBLIC AmiGetQword56FromLe (void FAR* pAddr_p);289289-298298+ QWORD PUBLIC AmiGetQword56FromBe(void FAR * pAddr_p);299299+ QWORD PUBLIC AmiGetQword56FromLe(void FAR * pAddr_p);290300291301//---------------------------------------------------------------------------292302//···300312//301313//---------------------------------------------------------------------------302314303303-void PUBLIC AmiSetQword64ToBe (void FAR* pAddr_p, QWORD qwQwordVal_p);304304-void PUBLIC AmiSetQword64ToLe (void FAR* pAddr_p, QWORD qwQwordVal_p);305305-315315+ void PUBLIC AmiSetQword64ToBe(void FAR * pAddr_p, QWORD qwQwordVal_p);316316+ void PUBLIC AmiSetQword64ToLe(void FAR * pAddr_p, QWORD qwQwordVal_p);306317307318//---------------------------------------------------------------------------308319//···315328//316329//---------------------------------------------------------------------------317330318318-QWORD PUBLIC AmiGetQword64FromBe (void FAR* pAddr_p);319319-QWORD PUBLIC AmiGetQword64FromLe (void FAR* pAddr_p);320320-331331+ QWORD PUBLIC AmiGetQword64FromBe(void FAR * pAddr_p);332332+ QWORD PUBLIC AmiGetQword64FromLe(void FAR * pAddr_p);321333322334//---------------------------------------------------------------------------323335//···331345//332346//---------------------------------------------------------------------------333347334334-void PUBLIC AmiSetTimeOfDay (void FAR* pAddr_p, tTimeOfDay FAR* pTimeOfDay_p);335335-348348+ void PUBLIC AmiSetTimeOfDay(void FAR * pAddr_p,349349+ tTimeOfDay FAR * pTimeOfDay_p);336350337351//---------------------------------------------------------------------------338352//···347361//348362//---------------------------------------------------------------------------349363350350-void PUBLIC AmiGetTimeOfDay (void FAR* pAddr_p, tTimeOfDay FAR* pTimeOfDay_p);364364+ void PUBLIC AmiGetTimeOfDay(void FAR * pAddr_p,365365+ tTimeOfDay FAR * pTimeOfDay_p);351366352367#endif353368354354-355355-#undef INLINE_ENABLED // disable actual inlining of functions369369+#undef INLINE_ENABLED // disable actual inlining of functions356370#define EPL_AMI_INCLUDED357371358372#ifdef __cplusplus359359- }373373+}360374#endif361361-362362-363363-#endif // ifndef _EPLAMI_H_364364-365365-// Die letzte Zeile mu� unbedingt eine leere Zeile sein, weil manche Compiler366366-// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).375375+#endif // ifndef _EPLAMI_H_376376+// 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).
···7171#ifndef _EPLCFG_H_7272#define _EPLCFG_H_73737474-7575-7676-7774// =========================================================================7875// generic defines which for whole EPL Stack7976// =========================================================================···97100#define EPL_NO_USER_KERNEL9810199102#ifndef BENCHMARK_MODULES100100-#define BENCHMARK_MODULES 0 //0xEE800042L103103+#define BENCHMARK_MODULES 0 //0xEE800042L101104#endif102105103106// Default defug level:···109112// * EPL_DBGLVL_ASSERT = 0x20000000L110113// * EPL_DBGLVL_ERROR = 0x40000000L111114// * EPL_DBGLVL_ALWAYS = 0x80000000L112112-113115114116// EPL_MODULE_INTEGRATION defines all modules which are included in115117// EPL application. Please add or delete modules for your application.···151155// number of used ethernet controller152156//#define EDRV_USED_ETH_CTRL 1153157154154-155158// =========================================================================156159// Data Link Layer (DLL) specific defines157160// =========================================================================···164169// and DLL shall pass PRes as ready to Edrv after SoA165170#define EPL_DLL_PRES_READY_AFTER_SOA FALSE166171//#define EPL_DLL_PRES_READY_AFTER_SOA TRUE167167-168172169173// =========================================================================170174// OBD specific defines···182188183189#define EPL_OBD_USE_VARIABLE_SUBINDEX_TAB TRUE184190185185-186191// =========================================================================187192// Timer module specific defines188193// =========================================================================···193200#define EPL_TIMER_USE_HIGHRES TRUE194201//#define EPL_TIMER_USE_HIGHRES FALSE195202196196-197203#endif //_EPLCFG_H_198198-199199-200200-
+86-93
drivers/staging/epl/EplDef.h
···66666767 2006/05/22 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_DEF_H_7372#define _EPL_DEF_H_74737575-7674//---------------------------------------------------------------------------7775// const defines7876//---------------------------------------------------------------------------79778080-#define EPL_C_ADR_BROADCAST 0xFF // EPL broadcast address8181-#define EPL_C_ADR_DIAG_DEF_NODE_ID 0xFD // EPL default address of dignostic device8282-#define EPL_C_ADR_DUMMY_NODE_ID 0xFC // EPL dummy node address8383-#define EPL_C_ADR_INVALID 0x00 // invalid EPL address8484-#define EPL_C_ADR_MN_DEF_NODE_ID 0xF0 // EPL default address of MN8585-#define EPL_C_ADR_RT1_DEF_NODE_ID 0xFE // EPL default address of router type 18686-#define EPL_C_DLL_ASND_PRIO_NMTRQST 7 // increased ASnd request priority to be used by NMT Requests8787-#define EPL_C_DLL_ASND_PRIO_STD 0 // standard ASnd request priority7878+#define EPL_C_ADR_BROADCAST 0xFF // EPL broadcast address7979+#define EPL_C_ADR_DIAG_DEF_NODE_ID 0xFD // EPL default address of dignostic device8080+#define EPL_C_ADR_DUMMY_NODE_ID 0xFC // EPL dummy node address8181+#define EPL_C_ADR_INVALID 0x00 // invalid EPL address8282+#define EPL_C_ADR_MN_DEF_NODE_ID 0xF0 // EPL default address of MN8383+#define EPL_C_ADR_RT1_DEF_NODE_ID 0xFE // EPL default address of router type 18484+#define EPL_C_DLL_ASND_PRIO_NMTRQST 7 // increased ASnd request priority to be used by NMT Requests8585+#define EPL_C_DLL_ASND_PRIO_STD 0 // standard ASnd request priority8886#define EPL_C_DLL_ETHERTYPE_EPL 0x88AB8989-#define EPL_C_DLL_ISOCHR_MAX_PAYL 1490 // Byte: maximum size of PReq and PRes payload data, requires C_IP_MAX_MTU9090-#define EPL_C_DLL_MAX_ASYNC_MTU 1500 // Byte: maximum asynchronous payload in bytes9191-#define EPL_C_DLL_MAX_PAYL_OFFSET 1499 // Byte: maximum offset of Ethernet frame payload, requires C_IP_MAX_MTU8787+#define EPL_C_DLL_ISOCHR_MAX_PAYL 1490 // Byte: maximum size of PReq and PRes payload data, requires C_IP_MAX_MTU8888+#define EPL_C_DLL_MAX_ASYNC_MTU 1500 // Byte: maximum asynchronous payload in bytes8989+#define EPL_C_DLL_MAX_PAYL_OFFSET 1499 // Byte: maximum offset of Ethernet frame payload, requires C_IP_MAX_MTU9290#define EPL_C_DLL_MAX_RS 79393-#define EPL_C_DLL_MIN_ASYNC_MTU 282 // Byte: minimum asynchronous payload in bytes.9494-#define EPL_C_DLL_MIN_PAYL_OFFSET 45 // Byte: minimum offset of Ethernet frame payload9595-#define EPL_C_DLL_MULTICAST_ASND 0x01111E000004LL // EPL ASnd multicast MAC address, canonical form9696-#define EPL_C_DLL_MULTICAST_PRES 0x01111E000002LL // EPL PRes multicast MAC address, canonical form9797-#define EPL_C_DLL_MULTICAST_SOA 0x01111E000003LL // EPL SoA multicast MAC address, canonical form9898-#define EPL_C_DLL_MULTICAST_SOC 0x01111E000001LL // EPL Soc multicast MAC address, canonical form9999-#define EPL_C_DLL_PREOP1_START_CYCLES 10 // number of unassigning SoA frames at start of NMT_MS_PRE_OPERATIONAL_1100100-#define EPL_C_DLL_T_BITTIME 10 // ns: Transmission time per bit on 100 Mbit/s network101101-#define EPL_C_DLL_T_EPL_PDO_HEADER 10 // Byte: size of PReq and PRes EPL PDO message header102102-#define EPL_C_DLL_T_ETH2_WRAPPER 18 // Byte: size of Ethernet type II wrapper consisting of header and checksum103103-#define EPL_C_DLL_T_IFG 640 // ns: Ethernet Interframe Gap104104-#define EPL_C_DLL_T_MIN_FRAME 5120 // ns: Size of minimum Ethernet frame (without preamble)105105-#define EPL_C_DLL_T_PREAMBLE 960 // ns: Size of Ethernet frame preamble9191+#define EPL_C_DLL_MIN_ASYNC_MTU 282 // Byte: minimum asynchronous payload in bytes.9292+#define EPL_C_DLL_MIN_PAYL_OFFSET 45 // Byte: minimum offset of Ethernet frame payload9393+#define EPL_C_DLL_MULTICAST_ASND 0x01111E000004LL // EPL ASnd multicast MAC address, canonical form9494+#define EPL_C_DLL_MULTICAST_PRES 0x01111E000002LL // EPL PRes multicast MAC address, canonical form9595+#define EPL_C_DLL_MULTICAST_SOA 0x01111E000003LL // EPL SoA multicast MAC address, canonical form9696+#define EPL_C_DLL_MULTICAST_SOC 0x01111E000001LL // EPL Soc multicast MAC address, canonical form9797+#define EPL_C_DLL_PREOP1_START_CYCLES 10 // number of unassigning SoA frames at start of NMT_MS_PRE_OPERATIONAL_19898+#define EPL_C_DLL_T_BITTIME 10 // ns: Transmission time per bit on 100 Mbit/s network9999+#define EPL_C_DLL_T_EPL_PDO_HEADER 10 // Byte: size of PReq and PRes EPL PDO message header100100+#define EPL_C_DLL_T_ETH2_WRAPPER 18 // Byte: size of Ethernet type II wrapper consisting of header and checksum101101+#define EPL_C_DLL_T_IFG 640 // ns: Ethernet Interframe Gap102102+#define EPL_C_DLL_T_MIN_FRAME 5120 // ns: Size of minimum Ethernet frame (without preamble)103103+#define EPL_C_DLL_T_PREAMBLE 960 // ns: Size of Ethernet frame preamble106104107107-#define EPL_C_DLL_MINSIZE_SOC 36 // minimum size of SoC without padding and CRC108108-#define EPL_C_DLL_MINSIZE_PREQ 60 // minimum size of PRec without CRC109109-#define EPL_C_DLL_MINSIZE_PRES 60 // minimum size of PRes without CRC110110-#define EPL_C_DLL_MINSIZE_SOA 24 // minimum size of SoA without padding and CRC111111-#define EPL_C_DLL_MINSIZE_IDENTRES 176 // minimum size of IdentResponse without CRC112112-#define EPL_C_DLL_MINSIZE_STATUSRES 72 // minimum size of StatusResponse without CRC113113-#define EPL_C_DLL_MINSIZE_NMTCMD 20 // minimum size of NmtCommand without CommandData, padding and CRC114114-#define EPL_C_DLL_MINSIZE_NMTCMDEXT 52 // minimum size of NmtCommand without padding and CRC115115-#define EPL_C_DLL_MINSIZE_NMTREQ 20 // minimum size of NmtRequest without CommandData, padding and CRC116116-#define EPL_C_DLL_MINSIZE_NMTREQEXT 52 // minimum size of NmtRequest without padding and CRC105105+#define EPL_C_DLL_MINSIZE_SOC 36 // minimum size of SoC without padding and CRC106106+#define EPL_C_DLL_MINSIZE_PREQ 60 // minimum size of PRec without CRC107107+#define EPL_C_DLL_MINSIZE_PRES 60 // minimum size of PRes without CRC108108+#define EPL_C_DLL_MINSIZE_SOA 24 // minimum size of SoA without padding and CRC109109+#define EPL_C_DLL_MINSIZE_IDENTRES 176 // minimum size of IdentResponse without CRC110110+#define EPL_C_DLL_MINSIZE_STATUSRES 72 // minimum size of StatusResponse without CRC111111+#define EPL_C_DLL_MINSIZE_NMTCMD 20 // minimum size of NmtCommand without CommandData, padding and CRC112112+#define EPL_C_DLL_MINSIZE_NMTCMDEXT 52 // minimum size of NmtCommand without padding and CRC113113+#define EPL_C_DLL_MINSIZE_NMTREQ 20 // minimum size of NmtRequest without CommandData, padding and CRC114114+#define EPL_C_DLL_MINSIZE_NMTREQEXT 52 // minimum size of NmtRequest without padding and CRC117115118118-#define EPL_C_ERR_MONITOR_DELAY 10 // Error monitoring start delay (not used in DS 1.0.0)119119-#define EPL_C_IP_ADR_INVALID 0x00000000L // invalid IP address (0.0.0.0) used to indicate no change120120-#define EPL_C_IP_INVALID_MTU 0 // Byte: invalid MTU size used to indicate no change121121-#define EPL_C_IP_MAX_MTU 1518 // Byte: maximum size in bytes of the IP stack which must be processed.122122-#define EPL_C_IP_MIN_MTU 300 // Byte: minimum size in bytes of the IP stack which must be processed.123123-#define EPL_C_NMT_STATE_TOLERANCE 5 // Cycles: maximum reaction time to NMT state commands124124-#define EPL_C_NMT_STATREQ_CYCLE 5 // sec: StatusRequest cycle time to be applied to AsyncOnly CNs116116+#define EPL_C_ERR_MONITOR_DELAY 10 // Error monitoring start delay (not used in DS 1.0.0)117117+#define EPL_C_IP_ADR_INVALID 0x00000000L // invalid IP address (0.0.0.0) used to indicate no change118118+#define EPL_C_IP_INVALID_MTU 0 // Byte: invalid MTU size used to indicate no change119119+#define EPL_C_IP_MAX_MTU 1518 // Byte: maximum size in bytes of the IP stack which must be processed.120120+#define EPL_C_IP_MIN_MTU 300 // Byte: minimum size in bytes of the IP stack which must be processed.121121+#define EPL_C_NMT_STATE_TOLERANCE 5 // Cycles: maximum reaction time to NMT state commands122122+#define EPL_C_NMT_STATREQ_CYCLE 5 // sec: StatusRequest cycle time to be applied to AsyncOnly CNs125123#define EPL_C_SDO_EPL_PORT 3819126124127127-#define EPL_C_DLL_MAX_ASND_SERVICE_IDS 5 // see tEplDllAsndServiceId in EplDll.h128128-129129-125125+#define EPL_C_DLL_MAX_ASND_SERVICE_IDS 5 // see tEplDllAsndServiceId in EplDll.h130126131127// Default configuration132128// ======================133129134130#ifndef EPL_D_PDO_Granularity_U8135135-#define EPL_D_PDO_Granularity_U8 8 // minimum size of objects to be mapped in bits UNSIGNED8 O O 1 1131131+#define EPL_D_PDO_Granularity_U8 8 // minimum size of objects to be mapped in bits UNSIGNED8 O O 1 1136132#endif137133138134#ifndef EPL_NMT_MAX_NODE_ID139139-#define EPL_NMT_MAX_NODE_ID 254 // maximum node-ID135135+#define EPL_NMT_MAX_NODE_ID 254 // maximum node-ID140136#endif141137142138#ifndef EPL_D_NMT_MaxCNNumber_U8143143-#define EPL_D_NMT_MaxCNNumber_U8 239 // maximum number of supported regular CNs in the Node ID range 1 .. 239 UNSIGNED8 O O 239 239139139+#define EPL_D_NMT_MaxCNNumber_U8 239 // maximum number of supported regular CNs in the Node ID range 1 .. 239 UNSIGNED8 O O 239 239144140#endif145141146142// defines for EPL API layer static process image···158162#endif159163160164#ifndef EPL_OBD_MAX_STRING_SIZE161161-#define EPL_OBD_MAX_STRING_SIZE 32 // is used for objects 0x1008/0x1009/0x100A165165+#define EPL_OBD_MAX_STRING_SIZE 32 // is used for objects 0x1008/0x1009/0x100A162166#endif163167164168#ifndef EPL_OBD_USE_STORE_RESTORE···190194#endif191195192196#ifndef EPL_VETH_NAME193193-#define EPL_VETH_NAME "epl" // name of net device in Linux197197+#define EPL_VETH_NAME "epl" // name of net device in Linux194198#endif195199196200/*···299303#define EPL_E_DLL_LOSS_SOA_TH 0x8244300304#define EPL_E_DLL_LOSS_SOC_TH 0x8245301305// 0x84xx BootUp Errors302302-#define EPL_E_NMT_BA1 0x8410 // other MN in MsNotActive active303303-#define EPL_E_NMT_BA1_NO_MN_SUPPORT 0x8411 // MN is not supported304304-#define EPL_E_NMT_BPO1 0x8420 // mandatory CN was not found or failed in BootStep1305305-#define EPL_E_NMT_BPO1_GET_IDENT 0x8421 // IdentRes was not received306306-#define EPL_E_NMT_BPO1_DEVICE_TYPE 0x8422 // wrong device type307307-#define EPL_E_NMT_BPO1_VENDOR_ID 0x8423 // wrong vendor ID308308-#define EPL_E_NMT_BPO1_PRODUCT_CODE 0x8424 // wrong product code309309-#define EPL_E_NMT_BPO1_REVISION_NO 0x8425 // wrong revision number310310-#define EPL_E_NMT_BPO1_SERIAL_NO 0x8426 // wrong serial number311311-#define EPL_E_NMT_BPO1_CF_VERIFY 0x8428 // verification of configuration failed312312-#define EPL_E_NMT_BPO2 0x8430 // mandatory CN failed in BootStep2313313-#define EPL_E_NMT_BRO 0x8440 // CheckCommunication failed for mandatory CN314314-#define EPL_E_NMT_WRONG_STATE 0x8480 // mandatory CN has wrong NMT state306306+#define EPL_E_NMT_BA1 0x8410 // other MN in MsNotActive active307307+#define EPL_E_NMT_BA1_NO_MN_SUPPORT 0x8411 // MN is not supported308308+#define EPL_E_NMT_BPO1 0x8420 // mandatory CN was not found or failed in BootStep1309309+#define EPL_E_NMT_BPO1_GET_IDENT 0x8421 // IdentRes was not received310310+#define EPL_E_NMT_BPO1_DEVICE_TYPE 0x8422 // wrong device type311311+#define EPL_E_NMT_BPO1_VENDOR_ID 0x8423 // wrong vendor ID312312+#define EPL_E_NMT_BPO1_PRODUCT_CODE 0x8424 // wrong product code313313+#define EPL_E_NMT_BPO1_REVISION_NO 0x8425 // wrong revision number314314+#define EPL_E_NMT_BPO1_SERIAL_NO 0x8426 // wrong serial number315315+#define EPL_E_NMT_BPO1_CF_VERIFY 0x8428 // verification of configuration failed316316+#define EPL_E_NMT_BPO2 0x8430 // mandatory CN failed in BootStep2317317+#define EPL_E_NMT_BRO 0x8440 // CheckCommunication failed for mandatory CN318318+#define EPL_E_NMT_WRONG_STATE 0x8480 // mandatory CN has wrong NMT state315319316320// Defines for object 0x1F80 NMT_StartUp_U32317321// ==========================================318318-#define EPL_NMTST_STARTALLNODES 0x00000002L // Bit 1319319-#define EPL_NMTST_NO_AUTOSTART 0x00000004L // Bit 2320320-#define EPL_NMTST_NO_STARTNODE 0x00000008L // Bit 3321321-#define EPL_NMTST_RESETALL_MAND_CN 0x00000010L // Bit 4322322-#define EPL_NMTST_STOPALL_MAND_CN 0x00000040L // Bit 6323323-#define EPL_NMTST_NO_AUTOPREOP2 0x00000080L // Bit 7324324-#define EPL_NMTST_NO_AUTOREADYTOOP 0x00000100L // Bit 8325325-#define EPL_NMTST_EXT_CNIDENTCHECK 0x00000200L // Bit 9326326-#define EPL_NMTST_SWVERSIONCHECK 0x00000400L // Bit 10327327-#define EPL_NMTST_CONFCHECK 0x00000800L // Bit 11328328-#define EPL_NMTST_NO_RETURN_PREOP1 0x00001000L // Bit 12329329-#define EPL_NMTST_BASICETHERNET 0x00002000L // Bit 13322322+#define EPL_NMTST_STARTALLNODES 0x00000002L // Bit 1323323+#define EPL_NMTST_NO_AUTOSTART 0x00000004L // Bit 2324324+#define EPL_NMTST_NO_STARTNODE 0x00000008L // Bit 3325325+#define EPL_NMTST_RESETALL_MAND_CN 0x00000010L // Bit 4326326+#define EPL_NMTST_STOPALL_MAND_CN 0x00000040L // Bit 6327327+#define EPL_NMTST_NO_AUTOPREOP2 0x00000080L // Bit 7328328+#define EPL_NMTST_NO_AUTOREADYTOOP 0x00000100L // Bit 8329329+#define EPL_NMTST_EXT_CNIDENTCHECK 0x00000200L // Bit 9330330+#define EPL_NMTST_SWVERSIONCHECK 0x00000400L // Bit 10331331+#define EPL_NMTST_CONFCHECK 0x00000800L // Bit 11332332+#define EPL_NMTST_NO_RETURN_PREOP1 0x00001000L // Bit 12333333+#define EPL_NMTST_BASICETHERNET 0x00002000L // Bit 13330334331335// Defines for object 0x1F81 NMT_NodeAssignment_AU32332336// ==================================================333333-#define EPL_NODEASSIGN_NODE_EXISTS 0x00000001L // Bit 0334334-#define EPL_NODEASSIGN_NODE_IS_CN 0x00000002L // Bit 1335335-#define EPL_NODEASSIGN_START_CN 0x00000004L // Bit 2336336-#define EPL_NODEASSIGN_MANDATORY_CN 0x00000008L // Bit 3337337-#define EPL_NODEASSIGN_KEEPALIVE 0x00000010L //currently not used in EPL V2 standard338338-#define EPL_NODEASSIGN_SWVERSIONCHECK 0x00000020L // Bit 5339339-#define EPL_NODEASSIGN_SWUPDATE 0x00000040L // Bit 6340340-#define EPL_NODEASSIGN_ASYNCONLY_NODE 0x00000100L // Bit 8341341-#define EPL_NODEASSIGN_MULTIPLEXED_CN 0x00000200L // Bit 9342342-#define EPL_NODEASSIGN_RT1 0x00000400L // Bit 10343343-#define EPL_NODEASSIGN_RT2 0x00000800L // Bit 11344344-#define EPL_NODEASSIGN_MN_PRES 0x00001000L // Bit 12345345-#define EPL_NODEASSIGN_VALID 0x80000000L // Bit 31337337+#define EPL_NODEASSIGN_NODE_EXISTS 0x00000001L // Bit 0338338+#define EPL_NODEASSIGN_NODE_IS_CN 0x00000002L // Bit 1339339+#define EPL_NODEASSIGN_START_CN 0x00000004L // Bit 2340340+#define EPL_NODEASSIGN_MANDATORY_CN 0x00000008L // Bit 3341341+#define EPL_NODEASSIGN_KEEPALIVE 0x00000010L //currently not used in EPL V2 standard342342+#define EPL_NODEASSIGN_SWVERSIONCHECK 0x00000020L // Bit 5343343+#define EPL_NODEASSIGN_SWUPDATE 0x00000040L // Bit 6344344+#define EPL_NODEASSIGN_ASYNCONLY_NODE 0x00000100L // Bit 8345345+#define EPL_NODEASSIGN_MULTIPLEXED_CN 0x00000200L // Bit 9346346+#define EPL_NODEASSIGN_RT1 0x00000400L // Bit 10347347+#define EPL_NODEASSIGN_RT2 0x00000800L // Bit 11348348+#define EPL_NODEASSIGN_MN_PRES 0x00001000L // Bit 12349349+#define EPL_NODEASSIGN_VALID 0x80000000L // Bit 31346350347351//---------------------------------------------------------------------------348352// typedef349353//---------------------------------------------------------------------------350354351351-352352-353355//---------------------------------------------------------------------------354356// function prototypes355357//---------------------------------------------------------------------------356358357357-358358-#endif // #ifndef _EPL_DEF_H_359359+#endif // #ifndef _EPL_DEF_H_
+88-103
drivers/staging/epl/EplDll.h
···66666767 2006/06/08 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_DLL_H_···7879// const defines7980//---------------------------------------------------------------------------80818181-8282#ifndef EPL_DLL_MAX_ASND_SERVICE_ID8383-#define EPL_DLL_MAX_ASND_SERVICE_ID (EPL_C_DLL_MAX_ASND_SERVICE_IDS + 1) // last is kEplDllAsndSdo == 58383+#define EPL_DLL_MAX_ASND_SERVICE_ID (EPL_C_DLL_MAX_ASND_SERVICE_IDS + 1) // last is kEplDllAsndSdo == 58484#endif85858686//---------------------------------------------------------------------------8787// typedef8888//---------------------------------------------------------------------------89899090-typedef enum9191-{9292- kEplDllAsndNotDefined = 0x00,9393- kEplDllAsndIdentResponse = 0x01,9494- kEplDllAsndStatusResponse = 0x02,9595- kEplDllAsndNmtRequest = 0x03,9696- kEplDllAsndNmtCommand = 0x04,9797- kEplDllAsndSdo = 0x059898-9090+typedef enum {9191+ kEplDllAsndNotDefined = 0x00,9292+ kEplDllAsndIdentResponse = 0x01,9393+ kEplDllAsndStatusResponse = 0x02,9494+ kEplDllAsndNmtRequest = 0x03,9595+ kEplDllAsndNmtCommand = 0x04,9696+ kEplDllAsndSdo = 0x059997} tEplDllAsndServiceId;10098101101-typedef enum102102-{103103- kEplDllAsndFilterNone = 0x00,104104- kEplDllAsndFilterLocal = 0x01, // receive only ASnd frames with local or broadcast node ID105105- kEplDllAsndFilterAny = 0x02, // receive any ASnd frame9999+typedef enum {100100+ kEplDllAsndFilterNone = 0x00,101101+ kEplDllAsndFilterLocal = 0x01, // receive only ASnd frames with local or broadcast node ID102102+ kEplDllAsndFilterAny = 0x02, // receive any ASnd frame106103} tEplDllAsndFilter;107104108108-typedef enum109109-{110110- kEplDllReqServiceNo = 0x00,111111- kEplDllReqServiceIdent = 0x01,112112- kEplDllReqServiceStatus = 0x02,113113- kEplDllReqServiceNmtRequest = 0x03,114114- kEplDllReqServiceUnspecified= 0xFF,105105+typedef enum {106106+ kEplDllReqServiceNo = 0x00,107107+ kEplDllReqServiceIdent = 0x01,108108+ kEplDllReqServiceStatus = 0x02,109109+ kEplDllReqServiceNmtRequest = 0x03,110110+ kEplDllReqServiceUnspecified = 0xFF,115111116112} tEplDllReqServiceId;117113118118-typedef enum119119-{120120- kEplDllAsyncReqPrioNmt = 0x07, // PRIO_NMT_REQUEST121121- kEplDllAsyncReqPrio6 = 0x06,122122- kEplDllAsyncReqPrio5 = 0x05,123123- kEplDllAsyncReqPrio4 = 0x04,124124- kEplDllAsyncReqPrioGeneric = 0x03, // PRIO_GENERIC_REQUEST125125- kEplDllAsyncReqPrio2 = 0x02, // till WSP 0.1.3: PRIO_ABOVE_GENERIC126126- kEplDllAsyncReqPrio1 = 0x01, // till WSP 0.1.3: PRIO_BELOW_GENERIC127127- kEplDllAsyncReqPrio0 = 0x00, // till WSP 0.1.3: PRIO_GENERIC_REQUEST114114+typedef enum {115115+ kEplDllAsyncReqPrioNmt = 0x07, // PRIO_NMT_REQUEST116116+ kEplDllAsyncReqPrio6 = 0x06,117117+ kEplDllAsyncReqPrio5 = 0x05,118118+ kEplDllAsyncReqPrio4 = 0x04,119119+ kEplDllAsyncReqPrioGeneric = 0x03, // PRIO_GENERIC_REQUEST120120+ kEplDllAsyncReqPrio2 = 0x02, // till WSP 0.1.3: PRIO_ABOVE_GENERIC121121+ kEplDllAsyncReqPrio1 = 0x01, // till WSP 0.1.3: PRIO_BELOW_GENERIC122122+ kEplDllAsyncReqPrio0 = 0x00, // till WSP 0.1.3: PRIO_GENERIC_REQUEST128123129124} tEplDllAsyncReqPriority;130125131131-typedef struct132132-{133133- unsigned int m_uiFrameSize;134134- tEplFrame * m_pFrame;135135- tEplNetTime m_NetTime;126126+typedef struct {127127+ unsigned int m_uiFrameSize;128128+ tEplFrame *m_pFrame;129129+ tEplNetTime m_NetTime;136130137131} tEplFrameInfo;138132139139-typedef struct140140-{141141- unsigned int m_uiSizeOfStruct;142142- BOOL m_fAsyncOnly; // do not need to register PRes-Frame143143- unsigned int m_uiNodeId; // local node ID133133+typedef struct {134134+ unsigned int m_uiSizeOfStruct;135135+ BOOL m_fAsyncOnly; // do not need to register PRes-Frame136136+ unsigned int m_uiNodeId; // local node ID144137145145- // 0x1F82: NMT_FeatureFlags_U32146146- DWORD m_dwFeatureFlags;147147- // Cycle Length (0x1006: NMT_CycleLen_U32) in [us]148148- DWORD m_dwCycleLen; // required for error detection149149- // 0x1F98: NMT_CycleTiming_REC150150- // 0x1F98.1: IsochrTxMaxPayload_U16151151- unsigned int m_uiIsochrTxMaxPayload; // const152152- // 0x1F98.2: IsochrRxMaxPayload_U16153153- unsigned int m_uiIsochrRxMaxPayload; // const154154- // 0x1F98.3: PResMaxLatency_U32155155- DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes156156- // 0x1F98.4: PReqActPayloadLimit_U16157157- unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+24 bytes)158158- // 0x1F98.5: PResActPayloadLimit_U16159159- unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+24 bytes)160160- // 0x1F98.6: ASndMaxLatency_U32161161- DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes162162- // 0x1F98.7: MultiplCycleCnt_U8163163- unsigned int m_uiMultiplCycleCnt; // required for error detection164164- // 0x1F98.8: AsyncMTU_U16165165- unsigned int m_uiAsyncMtu; // required to set up max frame size166166- // $$$ 0x1F98.9: Prescaler_U16167167- // $$$ Multiplexed Slot138138+ // 0x1F82: NMT_FeatureFlags_U32139139+ DWORD m_dwFeatureFlags;140140+ // Cycle Length (0x1006: NMT_CycleLen_U32) in [us]141141+ DWORD m_dwCycleLen; // required for error detection142142+ // 0x1F98: NMT_CycleTiming_REC143143+ // 0x1F98.1: IsochrTxMaxPayload_U16144144+ unsigned int m_uiIsochrTxMaxPayload; // const145145+ // 0x1F98.2: IsochrRxMaxPayload_U16146146+ unsigned int m_uiIsochrRxMaxPayload; // const147147+ // 0x1F98.3: PResMaxLatency_U32148148+ DWORD m_dwPresMaxLatency; // const in [ns], only required for IdentRes149149+ // 0x1F98.4: PReqActPayloadLimit_U16150150+ unsigned int m_uiPreqActPayloadLimit; // required for initialisation (+24 bytes)151151+ // 0x1F98.5: PResActPayloadLimit_U16152152+ unsigned int m_uiPresActPayloadLimit; // required for initialisation of Pres frame (+24 bytes)153153+ // 0x1F98.6: ASndMaxLatency_U32154154+ DWORD m_dwAsndMaxLatency; // const in [ns], only required for IdentRes155155+ // 0x1F98.7: MultiplCycleCnt_U8156156+ unsigned int m_uiMultiplCycleCnt; // required for error detection157157+ // 0x1F98.8: AsyncMTU_U16158158+ unsigned int m_uiAsyncMtu; // required to set up max frame size159159+ // $$$ 0x1F98.9: Prescaler_U16160160+ // $$$ Multiplexed Slot168161169169- // 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns]170170- DWORD m_dwLossOfFrameTolerance;162162+ // 0x1C14: DLL_LossOfFrameTolerance_U32 in [ns]163163+ DWORD m_dwLossOfFrameTolerance;171164172172- // 0x1F8A: NMT_MNCycleTiming_REC173173- // 0x1F8A.1: WaitSoCPReq_U32 in [ns]174174- DWORD m_dwWaitSocPreq;165165+ // 0x1F8A: NMT_MNCycleTiming_REC166166+ // 0x1F8A.1: WaitSoCPReq_U32 in [ns]167167+ DWORD m_dwWaitSocPreq;175168176176- // 0x1F8A.2: AsyncSlotTimeout_U32 in [ns]177177- DWORD m_dwAsyncSlotTimeout;169169+ // 0x1F8A.2: AsyncSlotTimeout_U32 in [ns]170170+ DWORD m_dwAsyncSlotTimeout;178171179172} tEplDllConfigParam;180173181181-typedef struct182182-{183183- unsigned int m_uiSizeOfStruct;184184- DWORD m_dwDeviceType; // NMT_DeviceType_U32185185- DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32186186- DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32187187- DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32188188- DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32189189- QWORD m_qwVendorSpecificExt1;190190- DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32191191- DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32192192- DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device193193- DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device194194- DWORD m_dwIpAddress;195195- DWORD m_dwSubnetMask;196196- DWORD m_dwDefaultGateway;197197- BYTE m_sHostname[32];198198- BYTE m_abVendorSpecificExt2[48];174174+typedef struct {175175+ unsigned int m_uiSizeOfStruct;176176+ DWORD m_dwDeviceType; // NMT_DeviceType_U32177177+ DWORD m_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32178178+ DWORD m_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32179179+ DWORD m_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32180180+ DWORD m_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32181181+ QWORD m_qwVendorSpecificExt1;182182+ DWORD m_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32183183+ DWORD m_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32184184+ DWORD m_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device185185+ DWORD m_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device186186+ DWORD m_dwIpAddress;187187+ DWORD m_dwSubnetMask;188188+ DWORD m_dwDefaultGateway;189189+ BYTE m_sHostname[32];190190+ BYTE m_abVendorSpecificExt2[48];199191200192} tEplDllIdentParam;201193202202-typedef struct203203-{204204- unsigned int m_uiNodeId;205205- WORD m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16206206- WORD m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16207207- DWORD m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32194194+typedef struct {195195+ unsigned int m_uiNodeId;196196+ WORD m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16197197+ WORD m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16198198+ DWORD m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32208199209200} tEplDllNodeInfo;210201···202213// function prototypes203214//---------------------------------------------------------------------------204215205205-206206-207207-#endif // #ifndef _EPL_DLL_H_208208-209209-216216+#endif // #ifndef _EPL_DLL_H_
+8-16
drivers/staging/epl/EplDllCal.h
···66666767 2006/06/20 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_DLLCAL_H_7372#define _EPL_DLLCAL_H_7474-75737674//---------------------------------------------------------------------------7775// const defines···103105// typedef104106//---------------------------------------------------------------------------105107106106-typedef struct107107-{108108- tEplDllAsndServiceId m_ServiceId;109109- tEplDllAsndFilter m_Filter;108108+typedef struct {109109+ tEplDllAsndServiceId m_ServiceId;110110+ tEplDllAsndFilter m_Filter;110111111112} tEplDllCalAsndServiceIdFilter;112113113113-typedef struct114114-{115115- tEplDllReqServiceId m_Service;116116- unsigned int m_uiNodeId;117117- BYTE m_bSoaFlag1;114114+typedef struct {115115+ tEplDllReqServiceId m_Service;116116+ unsigned int m_uiNodeId;117117+ BYTE m_bSoaFlag1;118118119119} tEplDllCalIssueRequest;120120···120124// function prototypes121125//---------------------------------------------------------------------------122126123123-124124-125125-#endif // #ifndef _EPL_DLLKCAL_H_126126-127127-127127+#endif // #ifndef _EPL_DLLKCAL_H_
+123-131
drivers/staging/epl/EplErrDef.h
···7171#ifndef _EPL_ERRORDEF_H_7272#define _EPL_ERRORDEF_H_73737474-7574//---------------------------------------------------------------------------7675// return codes7776//---------------------------------------------------------------------------78777979-typedef enum8080-{8181- // area for generic errors 0x0000 - 0x000F8282- kEplSuccessful = 0x0000, // no error/successful run8383- kEplIllegalInstance = 0x0001, // the called Instanz does not exist8484- kEplInvalidInstanceParam = 0x0002, //8585- kEplNoFreeInstance = 0x0003, // XxxAddInstance was called but no free instance is available8686- kEplWrongSignature = 0x0004, // wrong signature while writing to object 0x1010 or 0x10118787- kEplInvalidOperation = 0x0005, // operation not allowed in this situation8888- kEplInvalidNodeId = 0x0007, // invalid NodeId was specified8989- kEplNoResource = 0x0008, // resource could not be created (Windows, PxROS, ...)9090- kEplShutdown = 0x0009, // stack is shutting down9191- kEplReject = 0x000A, // reject the subsequent command7878+typedef enum {7979+ // area for generic errors 0x0000 - 0x000F8080+ kEplSuccessful = 0x0000, // no error/successful run8181+ kEplIllegalInstance = 0x0001, // the called Instanz does not exist8282+ kEplInvalidInstanceParam = 0x0002, //8383+ kEplNoFreeInstance = 0x0003, // XxxAddInstance was called but no free instance is available8484+ kEplWrongSignature = 0x0004, // wrong signature while writing to object 0x1010 or 0x10118585+ kEplInvalidOperation = 0x0005, // operation not allowed in this situation8686+ kEplInvalidNodeId = 0x0007, // invalid NodeId was specified8787+ kEplNoResource = 0x0008, // resource could not be created (Windows, PxROS, ...)8888+ kEplShutdown = 0x0009, // stack is shutting down8989+ kEplReject = 0x000A, // reject the subsequent command92909393- // area for EDRV module 0x0010 - 0x001F9191+ // area for EDRV module 0x0010 - 0x001F9492// kEplEdrvNoFrame = 0x0010, // no CAN message was received9593// kEplEdrvMsgHigh = 0x0011, // CAN message with high priority was received9694// kEplEdrvMsgLow = 0x0012, // CAN message with low priority was received9797- kEplEdrvInitError = 0x0013, // initialisation error9898- kEplEdrvNoFreeBufEntry = 0x0014, // no free entry in internal buffer table for Tx frames9999- kEplEdrvBufNotExisting = 0x0015, // specified Tx buffer does not exist9595+ kEplEdrvInitError = 0x0013, // initialisation error9696+ kEplEdrvNoFreeBufEntry = 0x0014, // no free entry in internal buffer table for Tx frames9797+ kEplEdrvBufNotExisting = 0x0015, // specified Tx buffer does not exist10098// kEplEdrvNoFreeChannel = 0x0014, // CAN controller has not a free channel10199// kEplEdrvTxBuffHighOverrun = 0x0015, // buffer for high priority CAN transmit messages has overrun102100// kEplEdrvTxBuffLowOverrun = 0x0016, // buffer for low priority CAN transmit messages has overrun103101// kEplEdrvIllegalBdi = 0x0017, // unsupported baudrate within baudrate table104102// kEplEdrvBusy = 0x0018, // remote frame can not be updated because no bus contact or CAN105105- // transmission is activ103103+ // transmission is activ106104// kEplEdrvInvalidDriverType = 0x0019, // (PC: Windows or Linux) invalid driver type107105// kEplEdrvDriverNotFound = 0x001A, // (PC: Windows or Linux) driver (DLL) could not be found108106// kEplEdrvInvalidBaseAddress = 0x001B, // (PC: Windows or Linux) driver could not found the CAN controller109107// kEplEdrvInvalidParam = 0x001C, // invalid param in function call110108111111- // area for COB module 0x0020 - 0x002F109109+ // area for COB module 0x0020 - 0x002F112110/* kEplCobNoFreeEntry = 0x0020, // no free entry in RX- or TX-COB table113111 kEplCobAlreadyExist = 0x0021, // COB-ID already exists in RX- resp. TX-COB table114112 */115115- kEplDllIllegalHdl = 0x0022, // illegal handle for a TxFrame was passed116116- kEplDllCbAsyncRegistered = 0x0023, // handler for non-EPL frames was already registered before113113+ kEplDllIllegalHdl = 0x0022, // illegal handle for a TxFrame was passed114114+ kEplDllCbAsyncRegistered = 0x0023, // handler for non-EPL frames was already registered before117115// kEplDllAsyncRxBufferFull = 0x0024, // receive buffer for asynchronous frames is full118118- kEplDllAsyncTxBufferEmpty = 0x0025, // transmit buffer for asynchronous frames is empty119119- kEplDllAsyncTxBufferFull = 0x0026, // transmit buffer for asynchronous frames is full120120- kEplDllNoNodeInfo = 0x0027, // MN: too less space in the internal node info structure121121- kEplDllInvalidParam = 0x0028, // invalid parameters passed to function122122- kEplDllTxBufNotReady = 0x002E, // TxBuffer (e.g. for PReq) is not ready yet123123- kEplDllTxFrameInvalid = 0x002F, // TxFrame (e.g. for PReq) is invalid or does not exist116116+ kEplDllAsyncTxBufferEmpty = 0x0025, // transmit buffer for asynchronous frames is empty117117+ kEplDllAsyncTxBufferFull = 0x0026, // transmit buffer for asynchronous frames is full118118+ kEplDllNoNodeInfo = 0x0027, // MN: too less space in the internal node info structure119119+ kEplDllInvalidParam = 0x0028, // invalid parameters passed to function120120+ kEplDllTxBufNotReady = 0x002E, // TxBuffer (e.g. for PReq) is not ready yet121121+ kEplDllTxFrameInvalid = 0x002F, // TxFrame (e.g. for PReq) is invalid or does not exist124122/* kEplCobIllegalCanId = 0x0023, // COB-ID is not allowed (like 0x000 is reserved for NMT, ...)125123 kEplCobInvalidCanId = 0x0024, // COB-ID is switched off126124 kEplCobCdrvStateSet = 0x0025, // at least one bit of CAN driver state is set127125 kEplCobNoFreeEntryHighBuf = 0x0026, // no free entry in high priotity RX- or TX-COB table128126 kEplCobOwnId = 0x0027, // COB-ID already exists in own module which calls CobDefine() or CobCheck()129127*/130130- // area for OBD module 0x0030 - 0x003F131131- kEplObdIllegalPart = 0x0030, // unknown OD part132132- kEplObdIndexNotExist = 0x0031, // object index does not exist in OD133133- kEplObdSubindexNotExist = 0x0032, // subindex does not exist in object index134134- kEplObdReadViolation = 0x0033, // read access to a write-only object135135- kEplObdWriteViolation = 0x0034, // write access to a read-only object136136- kEplObdAccessViolation = 0x0035, // access not allowed137137- kEplObdUnknownObjectType = 0x0036, // object type not defined/known138138- kEplObdVarEntryNotExist = 0x0037, // object does not contain VarEntry structure139139- kEplObdValueTooLow = 0x0038, // value to write to an object is too low140140- kEplObdValueTooHigh = 0x0039, // value to write to an object is too high141141- kEplObdValueLengthError = 0x003A, // value to write is to long or to short128128+ // area for OBD module 0x0030 - 0x003F129129+ kEplObdIllegalPart = 0x0030, // unknown OD part130130+ kEplObdIndexNotExist = 0x0031, // object index does not exist in OD131131+ kEplObdSubindexNotExist = 0x0032, // subindex does not exist in object index132132+ kEplObdReadViolation = 0x0033, // read access to a write-only object133133+ kEplObdWriteViolation = 0x0034, // write access to a read-only object134134+ kEplObdAccessViolation = 0x0035, // access not allowed135135+ kEplObdUnknownObjectType = 0x0036, // object type not defined/known136136+ kEplObdVarEntryNotExist = 0x0037, // object does not contain VarEntry structure137137+ kEplObdValueTooLow = 0x0038, // value to write to an object is too low138138+ kEplObdValueTooHigh = 0x0039, // value to write to an object is too high139139+ kEplObdValueLengthError = 0x003A, // value to write is to long or to short142140// kEplObdIllegalFloat = 0x003B, // illegal float variable143141// kEplObdWrongOdBuilderKey = 0x003F, // OD was generated with demo version of tool ODBuilder144142145145- // area for NMT module 0x0040 - 0x004F146146- kEplNmtUnknownCommand = 0x0040, // unknown NMT command147147- kEplNmtInvalidFramePointer = 0x0041, // pointer to the frame is not valid148148- kEplNmtInvalidEvent = 0x0042, // invalid event send to NMT-modul149149- kEplNmtInvalidState = 0x0043, // unknown state in NMT-State-Maschine150150- kEplNmtInvalidParam = 0x0044, // invalid parameters specified143143+ // area for NMT module 0x0040 - 0x004F144144+ kEplNmtUnknownCommand = 0x0040, // unknown NMT command145145+ kEplNmtInvalidFramePointer = 0x0041, // pointer to the frame is not valid146146+ kEplNmtInvalidEvent = 0x0042, // invalid event send to NMT-modul147147+ kEplNmtInvalidState = 0x0043, // unknown state in NMT-State-Maschine148148+ kEplNmtInvalidParam = 0x0044, // invalid parameters specified151149152152- // area for SDO/UDP module 0x0050 - 0x005F153153- kEplSdoUdpMissCb = 0x0050, // missing callback-function pointer during inti of154154- // module155155- kEplSdoUdpNoSocket = 0x0051, // error during init of socket156156- kEplSdoUdpSocketError = 0x0052, // error during usage of socket157157- kEplSdoUdpThreadError = 0x0053, // error during start of listen thread158158- kEplSdoUdpNoFreeHandle = 0x0054, // no free connection handle for Udp159159- kEplSdoUdpSendError = 0x0055, // Error during send of frame160160- kEplSdoUdpInvalidHdl = 0x0056, // the connection handle is invalid150150+ // area for SDO/UDP module 0x0050 - 0x005F151151+ kEplSdoUdpMissCb = 0x0050, // missing callback-function pointer during inti of152152+ // module153153+ kEplSdoUdpNoSocket = 0x0051, // error during init of socket154154+ kEplSdoUdpSocketError = 0x0052, // error during usage of socket155155+ kEplSdoUdpThreadError = 0x0053, // error during start of listen thread156156+ kEplSdoUdpNoFreeHandle = 0x0054, // no free connection handle for Udp157157+ kEplSdoUdpSendError = 0x0055, // Error during send of frame158158+ kEplSdoUdpInvalidHdl = 0x0056, // the connection handle is invalid161159162162- // area for SDO Sequence layer module 0x0060 - 0x006F163163- kEplSdoSeqMissCb = 0x0060, // no callback-function assign164164- kEplSdoSeqNoFreeHandle = 0x0061, // no free handle for connection165165- kEplSdoSeqInvalidHdl = 0x0062, // invalid handle in SDO sequence layer166166- kEplSdoSeqUnsupportedProt = 0x0063, // unsupported Protocol selected167167- kEplSdoSeqNoFreeHistory = 0x0064, // no free entry in history168168- kEplSdoSeqFrameSizeError = 0x0065, // the size of the frames is not correct169169- kEplSdoSeqRequestAckNeeded = 0x0066, // indeicates that the history buffer is full170170- // and a ack request is needed171171- kEplSdoSeqInvalidFrame = 0x0067, // frame not valid172172- kEplSdoSeqConnectionBusy = 0x0068, // connection is busy -> retry later173173- kEplSdoSeqInvalidEvent = 0x0069, // invalid event received160160+ // area for SDO Sequence layer module 0x0060 - 0x006F161161+ kEplSdoSeqMissCb = 0x0060, // no callback-function assign162162+ kEplSdoSeqNoFreeHandle = 0x0061, // no free handle for connection163163+ kEplSdoSeqInvalidHdl = 0x0062, // invalid handle in SDO sequence layer164164+ kEplSdoSeqUnsupportedProt = 0x0063, // unsupported Protocol selected165165+ kEplSdoSeqNoFreeHistory = 0x0064, // no free entry in history166166+ kEplSdoSeqFrameSizeError = 0x0065, // the size of the frames is not correct167167+ kEplSdoSeqRequestAckNeeded = 0x0066, // indeicates that the history buffer is full168168+ // and a ack request is needed169169+ kEplSdoSeqInvalidFrame = 0x0067, // frame not valid170170+ kEplSdoSeqConnectionBusy = 0x0068, // connection is busy -> retry later171171+ kEplSdoSeqInvalidEvent = 0x0069, // invalid event received174172175175- // area for SDO Command Layer Module 0x0070 - 0x007F176176- kEplSdoComUnsupportedProt = 0x0070, // unsupported Protocol selected177177- kEplSdoComNoFreeHandle = 0x0071, // no free handle for connection178178- kEplSdoComInvalidServiceType= 0x0072, // invalid SDO service type specified179179- kEplSdoComInvalidHandle = 0x0073, // handle invalid180180- kEplSdoComInvalidSendType = 0x0074, // the stated to of frame to send is181181- // not possible182182- kEplSdoComNotResponsible = 0x0075, // internal error: command layer handle is183183- // not responsible for this event from sequence layer184184- kEplSdoComHandleExists = 0x0076, // handle to same node already exists185185- kEplSdoComHandleBusy = 0x0077, // transfer via this handle is already running186186- kEplSdoComInvalidParam = 0x0078, // invalid parameters passed to function173173+ // area for SDO Command Layer Module 0x0070 - 0x007F174174+ kEplSdoComUnsupportedProt = 0x0070, // unsupported Protocol selected175175+ kEplSdoComNoFreeHandle = 0x0071, // no free handle for connection176176+ kEplSdoComInvalidServiceType = 0x0072, // invalid SDO service type specified177177+ kEplSdoComInvalidHandle = 0x0073, // handle invalid178178+ kEplSdoComInvalidSendType = 0x0074, // the stated to of frame to send is179179+ // not possible180180+ kEplSdoComNotResponsible = 0x0075, // internal error: command layer handle is181181+ // not responsible for this event from sequence layer182182+ kEplSdoComHandleExists = 0x0076, // handle to same node already exists183183+ kEplSdoComHandleBusy = 0x0077, // transfer via this handle is already running184184+ kEplSdoComInvalidParam = 0x0078, // invalid parameters passed to function187185188188- // area for EPL Event-Modul 0x0080 - 0x008F189189- kEplEventUnknownSink = 0x0080, // unknown sink for event190190- kEplEventPostError = 0x0081, // error during post of event186186+ // area for EPL Event-Modul 0x0080 - 0x008F187187+ kEplEventUnknownSink = 0x0080, // unknown sink for event188188+ kEplEventPostError = 0x0081, // error during post of event191189190190+ // area for EPL Timer Modul 0x0090 - 0x009F191191+ kEplTimerInvalidHandle = 0x0090, // invalid handle for timer192192+ kEplTimerNoTimerCreated = 0x0091, // no timer was created caused by193193+ // an error192194195195+ // area for EPL SDO/Asnd Module 0x00A0 - 0x0AF196196+ kEplSdoAsndInvalidNodeId = 0x00A0, //0 node id is invalid197197+ kEplSdoAsndNoFreeHandle = 0x00A1, // no free handle for connection198198+ kEplSdoAsndInvalidHandle = 0x00A2, // handle for connection is invalid193199194194- // area for EPL Timer Modul 0x0090 - 0x009F195195- kEplTimerInvalidHandle = 0x0090, // invalid handle for timer196196- kEplTimerNoTimerCreated = 0x0091, // no timer was created caused by197197- // an error200200+ // area for PDO module 0x00B0 - 0x00BF201201+ kEplPdoNotExist = 0x00B0, // selected PDO does not exist202202+ kEplPdoLengthExceeded = 0x00B1, // length of PDO mapping exceedes 64 bis203203+ kEplPdoGranularityMismatch = 0x00B2, // configured PDO granularity is not equal to supported granularity204204+ kEplPdoInitError = 0x00B3, // error during initialisation of PDO module205205+ kEplPdoErrorPdoEncode = 0x00B4, // error during encoding a PDO206206+ kEplPdoErrorPdoDecode = 0x00B5, // error during decoding a PDO207207+ kEplPdoErrorSend = 0x00B6, // error during sending a PDO208208+ kEplPdoErrorSyncWin = 0x00B7, // the SYNC window runs out during sending SYNC-PDOs209209+ kEplPdoErrorMapp = 0x00B8, // invalid PDO mapping210210+ kEplPdoVarNotFound = 0x00B9, // variable was not found in function PdoSignalVar()211211+ kEplPdoErrorEmcyPdoLen = 0x00BA, // the length of a received PDO is unequal to the expected value212212+ kEplPdoWriteConstObject = 0x00BB, // constant object can not be written213213+ // (only TxType, Inhibit-, Event Time for CANopen Kit)198214199199- // area for EPL SDO/Asnd Module 0x00A0 - 0x0AF200200- kEplSdoAsndInvalidNodeId = 0x00A0, //0 node id is invalid201201- kEplSdoAsndNoFreeHandle = 0x00A1, // no free handle for connection202202- kEplSdoAsndInvalidHandle = 0x00A2, // handle for connection is invalid203203-204204-205205- // area for PDO module 0x00B0 - 0x00BF206206- kEplPdoNotExist = 0x00B0, // selected PDO does not exist207207- kEplPdoLengthExceeded = 0x00B1, // length of PDO mapping exceedes 64 bis208208- kEplPdoGranularityMismatch = 0x00B2, // configured PDO granularity is not equal to supported granularity209209- kEplPdoInitError = 0x00B3, // error during initialisation of PDO module210210- kEplPdoErrorPdoEncode = 0x00B4, // error during encoding a PDO211211- kEplPdoErrorPdoDecode = 0x00B5, // error during decoding a PDO212212- kEplPdoErrorSend = 0x00B6, // error during sending a PDO213213- kEplPdoErrorSyncWin = 0x00B7, // the SYNC window runs out during sending SYNC-PDOs214214- kEplPdoErrorMapp = 0x00B8, // invalid PDO mapping215215- kEplPdoVarNotFound = 0x00B9, // variable was not found in function PdoSignalVar()216216- kEplPdoErrorEmcyPdoLen = 0x00BA, // the length of a received PDO is unequal to the expected value217217- kEplPdoWriteConstObject = 0x00BB, // constant object can not be written218218- // (only TxType, Inhibit-, Event Time for CANopen Kit)219219-220220- // area for LSS slave module215215+ // area for LSS slave module221216/* kEplLsssResetNode = 0x0080, // NMT command "reset node" has to be processed after LSS configuration222217 // new of NodeId223218 kEplLsssInvalidNodeId = 0x0081, // no valid NodeId is configured -> wait until it is configured with224219 // LSS service before calling CcmConnectToNet()225220*/226226- // area for emergency consumer module 0x0090 - 0x009F221221+ // area for emergency consumer module 0x0090 - 0x009F227222/* kEplEmccNoFreeProducerEntry = 0x0090, // no free entry to add a Emergency Producer228223 kEplEmccNodeIdNotExist = 0x0091, // selected NodeId was never added229224 kEplEmccNodeIdInvalid = 0x0092, // selected NodeId is outside of range (0x01 until 0x7F)230225 kEplEmccNodeIdExist = 0x0093, // selected NodeId already exist231226*/232232- // area for dynamic OD 0x00A0 - 0x00AF227227+ // area for dynamic OD 0x00A0 - 0x00AF233228/* kEplDynNoMemory = 0x00A0, // no memory available234229 kEplDynInvalidConfig = 0x00A1, // invalid configuration in segment container235230*/236236- // area for hertbeat consumer module 0x00B0 - 0x00BF231231+ // area for hertbeat consumer module 0x00B0 - 0x00BF237232/* kEplHbcEntryNotExist = 0x00B0, // Heartbeat Producer node not configured238233 kEplHbcEntryAlreadyExist = 0x00B1, // NodeId was already defined in heartbeat consumer table (object 0x1016)239234*/240240- // Configuration manager module 0x00C0 - 0x00CF241241- kEplCfgMaConfigError = 0x00C0, // error in configuration manager242242- kEplCfgMaSdocTimeOutError = 0x00C1, // error in configuration manager, Sdo timeout243243- kEplCfgMaInvalidDcf = 0x00C2, // configration file not valid244244- kEplCfgMaUnsupportedDcf = 0x00C3, // unsupported Dcf format245245- kEplCfgMaConfigWithErrors = 0x00C4, // configuration finished with errors246246- kEplCfgMaNoFreeConfig = 0x00C5, // no free configuration entry247247- kEplCfgMaNoConfigData = 0x00C6, // no configuration data present248248- kEplCfgMaUnsuppDatatypeDcf = 0x00C7, // unsupported datatype found in dcf249249- // -> this entry was not configured235235+ // Configuration manager module 0x00C0 - 0x00CF236236+ kEplCfgMaConfigError = 0x00C0, // error in configuration manager237237+ kEplCfgMaSdocTimeOutError = 0x00C1, // error in configuration manager, Sdo timeout238238+ kEplCfgMaInvalidDcf = 0x00C2, // configration file not valid239239+ kEplCfgMaUnsupportedDcf = 0x00C3, // unsupported Dcf format240240+ kEplCfgMaConfigWithErrors = 0x00C4, // configuration finished with errors241241+ kEplCfgMaNoFreeConfig = 0x00C5, // no free configuration entry242242+ kEplCfgMaNoConfigData = 0x00C6, // no configuration data present243243+ kEplCfgMaUnsuppDatatypeDcf = 0x00C7, // unsupported datatype found in dcf244244+ // -> this entry was not configured250245251251-252252- // area for LSS master module 0x00D0 - 0x00DF246246+ // area for LSS master module 0x00D0 - 0x00DF253247/* kEplLssmIllegalMode = 0x00D0, // illegal LSS mode (operation / configuration)254248 kEplLssmIllegalState = 0x00D1, // function was called in illegal state of LSS master255249 kEplLssmBusy = 0x00D2, // LSS process is busy with an previous service···251257 kEplLssmTimeout = 0x00D4, // LSS slave did not answer a LSS service252258 kEplLssmErrorInConfirm = 0x00D5, // LSS slave replied an error code for a LSS service253259*/254254- // area for CCM modules 0x00E0 - 0xEF260260+ // area for CCM modules 0x00E0 - 0xEF255261/* kEplCcmStoreUnvalidState = 0x00E0, // memory device not available due device state256262 kEplCcmStoreHwError = 0x00E1, // hw error due device access257263*/258258- // area for SRDO module 0x0100 - 0x011F264264+ // area for SRDO module 0x0100 - 0x011F259265/* kEplSrdoNotExist = 0x0100, // selected SRDO does not exist260266 kEplSrdoGranularityMismatch = 0x0101, // configured SRDO granularity is not equal to supported granularity261267 kEplSrdoCfgTimingError = 0x0102, // configuration is not ok (Timing)···279285 kEplSrdoOverrun = 0x0114 // a RxSRDO was received but the pevious one was not else processed280286*/281287282282- kEplApiTaskDeferred = 0x0140, // EPL performs task in background and informs the application (or vice-versa), when it is finished283283- kEplApiInvalidParam = 0x0142, // passed invalid parameters to a function (e.g. invalid node id)288288+ kEplApiTaskDeferred = 0x0140, // EPL performs task in background and informs the application (or vice-versa), when it is finished289289+ kEplApiInvalidParam = 0x0142, // passed invalid parameters to a function (e.g. invalid node id)284290285285- // area untill 0x07FF is reserved286286- // area for user application from 0x0800 to 0x7FFF291291+ // area untill 0x07FF is reserved292292+ // area for user application from 0x0800 to 0x7FFF287293288294} tEplKernel;289289-290295291296#endif292297//EOF293298294299// Die letzte Zeile mu� unbedingt eine leere Zeile sein, weil manche Compiler295300// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).296296-
+139-163
drivers/staging/epl/EplEvent.h
···66666767 2006/06/12 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_EVENT_H_···8182// name and size of event queues8283#define EPL_EVENT_NAME_SHB_KERNEL_TO_USER "ShbKernelToUser"8384#ifndef EPL_EVENT_SIZE_SHB_KERNEL_TO_USER8484-#define EPL_EVENT_SIZE_SHB_KERNEL_TO_USER 32768 // 32 kByte8585+#define EPL_EVENT_SIZE_SHB_KERNEL_TO_USER 32768 // 32 kByte8586#endif86878788#define EPL_EVENT_NAME_SHB_USER_TO_KERNEL "ShbUserToKernel"8889#ifndef EPL_EVENT_SIZE_SHB_USER_TO_KERNEL8989-#define EPL_EVENT_SIZE_SHB_USER_TO_KERNEL 32768 // 32 kByte9090+#define EPL_EVENT_SIZE_SHB_USER_TO_KERNEL 32768 // 32 kByte9091#endif9191-92929393// max size of event argument9494#ifndef EPL_MAX_EVENT_ARG_SIZE9595-#define EPL_MAX_EVENT_ARG_SIZE 256 // because of PDO9595+#define EPL_MAX_EVENT_ARG_SIZE 256 // because of PDO9696#endif97979898-#define EPL_DLL_ERR_MN_CRC 0x00000001L // object 0x1C009999-#define EPL_DLL_ERR_MN_COLLISION 0x00000002L // object 0x1C01100100-#define EPL_DLL_ERR_MN_CYCTIMEEXCEED 0x00000004L // object 0x1C02101101-#define EPL_DLL_ERR_MN_LOSS_LINK 0x00000008L // object 0x1C03102102-#define EPL_DLL_ERR_MN_CN_LATE_PRES 0x00000010L // objects 0x1C04-0x1C06103103-#define EPL_DLL_ERR_MN_CN_LOSS_PRES 0x00000080L // objects 0x1C07-0x1C09104104-#define EPL_DLL_ERR_CN_COLLISION 0x00000400L // object 0x1C0A105105-#define EPL_DLL_ERR_CN_LOSS_SOC 0x00000800L // object 0x1C0B106106-#define EPL_DLL_ERR_CN_LOSS_SOA 0x00001000L // object 0x1C0C107107-#define EPL_DLL_ERR_CN_LOSS_PREQ 0x00002000L // object 0x1C0D108108-#define EPL_DLL_ERR_CN_RECVD_PREQ 0x00004000L // decrement object 0x1C0D/2109109-#define EPL_DLL_ERR_CN_SOC_JITTER 0x00008000L // object 0x1C0E110110-#define EPL_DLL_ERR_CN_CRC 0x00010000L // object 0x1C0F111111-#define EPL_DLL_ERR_CN_LOSS_LINK 0x00020000L // object 0x1C10112112-#define EPL_DLL_ERR_MN_LOSS_STATRES 0x00040000L // objects 0x1C15-0x1C17 (should be operated by NmtMnu module)113113-#define EPL_DLL_ERR_BAD_PHYS_MODE 0x00080000L // no object114114-#define EPL_DLL_ERR_MAC_BUFFER 0x00100000L // no object (NMT_GT6)115115-#define EPL_DLL_ERR_INVALID_FORMAT 0x00200000L // no object (NMT_GT6)116116-#define EPL_DLL_ERR_ADDRESS_CONFLICT 0x00400000L // no object (remove CN from configuration)117117-9898+#define EPL_DLL_ERR_MN_CRC 0x00000001L // object 0x1C009999+#define EPL_DLL_ERR_MN_COLLISION 0x00000002L // object 0x1C01100100+#define EPL_DLL_ERR_MN_CYCTIMEEXCEED 0x00000004L // object 0x1C02101101+#define EPL_DLL_ERR_MN_LOSS_LINK 0x00000008L // object 0x1C03102102+#define EPL_DLL_ERR_MN_CN_LATE_PRES 0x00000010L // objects 0x1C04-0x1C06103103+#define EPL_DLL_ERR_MN_CN_LOSS_PRES 0x00000080L // objects 0x1C07-0x1C09104104+#define EPL_DLL_ERR_CN_COLLISION 0x00000400L // object 0x1C0A105105+#define EPL_DLL_ERR_CN_LOSS_SOC 0x00000800L // object 0x1C0B106106+#define EPL_DLL_ERR_CN_LOSS_SOA 0x00001000L // object 0x1C0C107107+#define EPL_DLL_ERR_CN_LOSS_PREQ 0x00002000L // object 0x1C0D108108+#define EPL_DLL_ERR_CN_RECVD_PREQ 0x00004000L // decrement object 0x1C0D/2109109+#define EPL_DLL_ERR_CN_SOC_JITTER 0x00008000L // object 0x1C0E110110+#define EPL_DLL_ERR_CN_CRC 0x00010000L // object 0x1C0F111111+#define EPL_DLL_ERR_CN_LOSS_LINK 0x00020000L // object 0x1C10112112+#define EPL_DLL_ERR_MN_LOSS_STATRES 0x00040000L // objects 0x1C15-0x1C17 (should be operated by NmtMnu module)113113+#define EPL_DLL_ERR_BAD_PHYS_MODE 0x00080000L // no object114114+#define EPL_DLL_ERR_MAC_BUFFER 0x00100000L // no object (NMT_GT6)115115+#define EPL_DLL_ERR_INVALID_FORMAT 0x00200000L // no object (NMT_GT6)116116+#define EPL_DLL_ERR_ADDRESS_CONFLICT 0x00400000L // no object (remove CN from configuration)118117119118//---------------------------------------------------------------------------120119// typedef121120//---------------------------------------------------------------------------122121123122// EventType determines the argument of the event124124-typedef enum125125-{126126- kEplEventTypeNmtEvent = 0x01, // NMT event127127- // arg is pointer to tEplNmtEvent128128- kEplEventTypePdoRx = 0x02, // PDO frame received event (PRes/PReq)129129- // arg is pointer to tEplFrame130130- kEplEventTypePdoTx = 0x03, // PDO frame transmitted event (PRes/PReq)131131- // arg is pointer to tEplFrameInfo132132- kEplEventTypePdoSoa = 0x04, // SoA frame received event (isochronous phase completed)133133- // arg is pointer to nothing134134- kEplEventTypeSync = 0x05, // Sync event (e.g. SoC or anticipated SoC)135135- // arg is pointer to nothing136136- kEplEventTypeTimer = 0x06, // Timer event137137- // arg is pointer to tEplTimerEventArg138138- kEplEventTypeHeartbeat = 0x07, // Heartbeat event139139- // arg is pointer to tEplHeartbeatEvent140140- kEplEventTypeDllkCreate = 0x08, // DLL kernel create event141141- // arg is pointer to the new tEplNmtState142142- kEplEventTypeDllkDestroy = 0x09, // DLL kernel destroy event143143- // arg is pointer to the old tEplNmtState144144- kEplEventTypeDllkFillTx = 0x0A, // DLL kernel fill TxBuffer event145145- // arg is pointer to tEplDllAsyncReqPriority146146- kEplEventTypeDllkPresReady = 0x0B, // DLL kernel PRes ready event147147- // arg is pointer to nothing148148- kEplEventTypeError = 0x0C, // Error event for API layer149149- // arg is pointer to tEplEventError150150- kEplEventTypeNmtStateChange = 0x0D, // indicate change of NMT-State151151- // arg is pointer to tEplEventNmtStateChange152152- kEplEventTypeDllError = 0x0E, // DLL error event for Error handler153153- // arg is pointer to tEplErrorHandlerkEvent154154- kEplEventTypeAsndRx = 0x0F, // received ASnd frame for DLL user module155155- // arg is pointer to tEplFrame156156- kEplEventTypeDllkServFilter = 0x10, // configure ServiceIdFilter157157- // arg is pointer to tEplDllCalServiceIdFilter158158- kEplEventTypeDllkIdentity = 0x11, // configure Identity159159- // arg is pointer to tEplDllIdentParam160160- kEplEventTypeDllkConfig = 0x12, // configure ConfigParam161161- // arg is pointer to tEplDllConfigParam162162- kEplEventTypeDllkIssueReq = 0x13, // issue Ident/Status request163163- // arg is pointer to tEplDllCalIssueRequest164164- kEplEventTypeDllkAddNode = 0x14, // add node to isochronous phase165165- // arg is pointer to tEplDllNodeInfo166166- kEplEventTypeDllkDelNode = 0x15, // remove node from isochronous phase167167- // arg is pointer to unsigned int168168- kEplEventTypeDllkSoftDelNode= 0x16, // remove node softly from isochronous phase169169- // arg is pointer to unsigned int170170- kEplEventTypeDllkStartReducedCycle = 0x17, // start reduced EPL cycle on MN171171- // arg is pointer to nothing172172- kEplEventTypeNmtMnuNmtCmdSent = 0x18, // NMT command was actually sent173173- // arg is pointer to tEplFrame123123+typedef enum {124124+ kEplEventTypeNmtEvent = 0x01, // NMT event125125+ // arg is pointer to tEplNmtEvent126126+ kEplEventTypePdoRx = 0x02, // PDO frame received event (PRes/PReq)127127+ // arg is pointer to tEplFrame128128+ kEplEventTypePdoTx = 0x03, // PDO frame transmitted event (PRes/PReq)129129+ // arg is pointer to tEplFrameInfo130130+ kEplEventTypePdoSoa = 0x04, // SoA frame received event (isochronous phase completed)131131+ // arg is pointer to nothing132132+ kEplEventTypeSync = 0x05, // Sync event (e.g. SoC or anticipated SoC)133133+ // arg is pointer to nothing134134+ kEplEventTypeTimer = 0x06, // Timer event135135+ // arg is pointer to tEplTimerEventArg136136+ kEplEventTypeHeartbeat = 0x07, // Heartbeat event137137+ // arg is pointer to tEplHeartbeatEvent138138+ kEplEventTypeDllkCreate = 0x08, // DLL kernel create event139139+ // arg is pointer to the new tEplNmtState140140+ kEplEventTypeDllkDestroy = 0x09, // DLL kernel destroy event141141+ // arg is pointer to the old tEplNmtState142142+ kEplEventTypeDllkFillTx = 0x0A, // DLL kernel fill TxBuffer event143143+ // arg is pointer to tEplDllAsyncReqPriority144144+ kEplEventTypeDllkPresReady = 0x0B, // DLL kernel PRes ready event145145+ // arg is pointer to nothing146146+ kEplEventTypeError = 0x0C, // Error event for API layer147147+ // arg is pointer to tEplEventError148148+ kEplEventTypeNmtStateChange = 0x0D, // indicate change of NMT-State149149+ // arg is pointer to tEplEventNmtStateChange150150+ kEplEventTypeDllError = 0x0E, // DLL error event for Error handler151151+ // arg is pointer to tEplErrorHandlerkEvent152152+ kEplEventTypeAsndRx = 0x0F, // received ASnd frame for DLL user module153153+ // arg is pointer to tEplFrame154154+ kEplEventTypeDllkServFilter = 0x10, // configure ServiceIdFilter155155+ // arg is pointer to tEplDllCalServiceIdFilter156156+ kEplEventTypeDllkIdentity = 0x11, // configure Identity157157+ // arg is pointer to tEplDllIdentParam158158+ kEplEventTypeDllkConfig = 0x12, // configure ConfigParam159159+ // arg is pointer to tEplDllConfigParam160160+ kEplEventTypeDllkIssueReq = 0x13, // issue Ident/Status request161161+ // arg is pointer to tEplDllCalIssueRequest162162+ kEplEventTypeDllkAddNode = 0x14, // add node to isochronous phase163163+ // arg is pointer to tEplDllNodeInfo164164+ kEplEventTypeDllkDelNode = 0x15, // remove node from isochronous phase165165+ // arg is pointer to unsigned int166166+ kEplEventTypeDllkSoftDelNode = 0x16, // remove node softly from isochronous phase167167+ // arg is pointer to unsigned int168168+ kEplEventTypeDllkStartReducedCycle = 0x17, // start reduced EPL cycle on MN169169+ // arg is pointer to nothing170170+ kEplEventTypeNmtMnuNmtCmdSent = 0x18, // NMT command was actually sent171171+ // arg is pointer to tEplFrame174172175173} tEplEventType;176174177177-178175// EventSink determines the consumer of the event179179-typedef enum180180-{181181- kEplEventSinkSync = 0x00, // Sync event for application or kernel EPL module182182- kEplEventSinkNmtk = 0x01, // events for Nmtk module183183- kEplEventSinkDllk = 0x02, // events for Dllk module184184- kEplEventSinkDlluCal = 0x03, // events for DlluCal module185185- kEplEventSinkDllkCal = 0x04, // events for DllkCal module186186- kEplEventSinkPdok = 0x05, // events for Pdok module187187- kEplEventSinkNmtu = 0x06, // events for Nmtu module188188- kEplEventSinkErrk = 0x07, // events for Error handler module189189- kEplEventSinkErru = 0x08, // events for Error signaling module190190- kEplEventSinkSdoAsySeq = 0x09, // events for asyncronous SDO Sequence Layer module191191- kEplEventSinkNmtMnu = 0x0A, // events for NmtMnu module192192- kEplEventSinkLedu = 0x0B, // events for Ledu module193193- kEplEventSinkApi = 0x0F, // events for API module176176+typedef enum {177177+ kEplEventSinkSync = 0x00, // Sync event for application or kernel EPL module178178+ kEplEventSinkNmtk = 0x01, // events for Nmtk module179179+ kEplEventSinkDllk = 0x02, // events for Dllk module180180+ kEplEventSinkDlluCal = 0x03, // events for DlluCal module181181+ kEplEventSinkDllkCal = 0x04, // events for DllkCal module182182+ kEplEventSinkPdok = 0x05, // events for Pdok module183183+ kEplEventSinkNmtu = 0x06, // events for Nmtu module184184+ kEplEventSinkErrk = 0x07, // events for Error handler module185185+ kEplEventSinkErru = 0x08, // events for Error signaling module186186+ kEplEventSinkSdoAsySeq = 0x09, // events for asyncronous SDO Sequence Layer module187187+ kEplEventSinkNmtMnu = 0x0A, // events for NmtMnu module188188+ kEplEventSinkLedu = 0x0B, // events for Ledu module189189+ kEplEventSinkApi = 0x0F, // events for API module194190195191} tEplEventSink;196192197197-198193// EventSource determines the source of an errorevent199199-typedef enum200200-{201201- // kernelspace modules202202- kEplEventSourceDllk = 0x01, // Dllk module203203- kEplEventSourceNmtk = 0x02, // Nmtk module204204- kEplEventSourceObdk = 0x03, // Obdk module205205- kEplEventSourcePdok = 0x04, // Pdok module206206- kEplEventSourceTimerk = 0x05, // Timerk module207207- kEplEventSourceEventk = 0x06, // Eventk module208208- kEplEventSourceSyncCb = 0x07, // sync-Cb209209- kEplEventSourceErrk = 0x08, // Error handler module194194+typedef enum {195195+ // kernelspace modules196196+ kEplEventSourceDllk = 0x01, // Dllk module197197+ kEplEventSourceNmtk = 0x02, // Nmtk module198198+ kEplEventSourceObdk = 0x03, // Obdk module199199+ kEplEventSourcePdok = 0x04, // Pdok module200200+ kEplEventSourceTimerk = 0x05, // Timerk module201201+ kEplEventSourceEventk = 0x06, // Eventk module202202+ kEplEventSourceSyncCb = 0x07, // sync-Cb203203+ kEplEventSourceErrk = 0x08, // Error handler module210204211211- // userspace modules212212- kEplEventSourceDllu = 0x10, // Dllu module213213- kEplEventSourceNmtu = 0x11, // Nmtu module214214- kEplEventSourceNmtCnu = 0x12, // NmtCnu module215215- kEplEventSourceNmtMnu = 0x13, // NmtMnu module216216- kEplEventSourceObdu = 0x14, // Obdu module217217- kEplEventSourceSdoUdp = 0x15, // Sdo/Udp module218218- kEplEventSourceSdoAsnd = 0x16, // Sdo/Asnd module219219- kEplEventSourceSdoAsySeq = 0x17, // Sdo asynchronus Sequence Layer module220220- kEplEventSourceSdoCom = 0x18, // Sdo command layer module221221- kEplEventSourceTimeru = 0x19, // Timeru module222222- kEplEventSourceCfgMau = 0x1A, // CfgMau module223223- kEplEventSourceEventu = 0x1B, // Eventu module224224- kEplEventSourceEplApi = 0x1C, // Api module225225- kEplEventSourceLedu = 0x1D, // Ledu module205205+ // userspace modules206206+ kEplEventSourceDllu = 0x10, // Dllu module207207+ kEplEventSourceNmtu = 0x11, // Nmtu module208208+ kEplEventSourceNmtCnu = 0x12, // NmtCnu module209209+ kEplEventSourceNmtMnu = 0x13, // NmtMnu module210210+ kEplEventSourceObdu = 0x14, // Obdu module211211+ kEplEventSourceSdoUdp = 0x15, // Sdo/Udp module212212+ kEplEventSourceSdoAsnd = 0x16, // Sdo/Asnd module213213+ kEplEventSourceSdoAsySeq = 0x17, // Sdo asynchronus Sequence Layer module214214+ kEplEventSourceSdoCom = 0x18, // Sdo command layer module215215+ kEplEventSourceTimeru = 0x19, // Timeru module216216+ kEplEventSourceCfgMau = 0x1A, // CfgMau module217217+ kEplEventSourceEventu = 0x1B, // Eventu module218218+ kEplEventSourceEplApi = 0x1C, // Api module219219+ kEplEventSourceLedu = 0x1D, // Ledu module226220227221} tEplEventSource;228222229229-230223// structure of EPL event (element order must not be changed!)231231-typedef struct232232-{233233- tEplEventType m_EventType /*:28*/; // event type234234- tEplEventSink m_EventSink /*:4*/; // event sink235235- tEplNetTime m_NetTime; // timestamp236236- unsigned int m_uiSize; // size of argument237237- void * m_pArg; // argument of event224224+typedef struct {225225+ tEplEventType m_EventType /*:28 */ ; // event type226226+ tEplEventSink m_EventSink /*:4 */ ; // event sink227227+ tEplNetTime m_NetTime; // timestamp228228+ unsigned int m_uiSize; // size of argument229229+ void *m_pArg; // argument of event238230239231} tEplEvent;240232241241-242233// short structure of EPL event without argument and its size (element order must not be changed!)243243-typedef struct244244-{245245- tEplEventType m_EventType /*:28*/; // event type246246- tEplEventSink m_EventSink /*:4*/; // event sink247247- tEplNetTime m_NetTime; // timestamp234234+typedef struct {235235+ tEplEventType m_EventType /*:28 */ ; // event type236236+ tEplEventSink m_EventSink /*:4 */ ; // event sink237237+ tEplNetTime m_NetTime; // timestamp248238249239} tEplEventShort;250240251251-252252-typedef struct253253-{254254- unsigned int m_uiIndex;255255- unsigned int m_uiSubIndex;241241+typedef struct {242242+ unsigned int m_uiIndex;243243+ unsigned int m_uiSubIndex;256244257245} tEplEventObdError;258246259259-260247// structure for kEplEventTypeError261261-typedef struct262262-{263263- tEplEventSource m_EventSource; // module which posted this error event264264- tEplKernel m_EplError; // EPL error which occured265265- union266266- {267267- BYTE m_bArg;268268- DWORD m_dwArg;269269- tEplEventSource m_EventSource; // from Eventk/u module (originating error source)270270- tEplEventObdError m_ObdError; // from Obd module248248+typedef struct {249249+ tEplEventSource m_EventSource; // module which posted this error event250250+ tEplKernel m_EplError; // EPL error which occured251251+ union {252252+ BYTE m_bArg;253253+ DWORD m_dwArg;254254+ tEplEventSource m_EventSource; // from Eventk/u module (originating error source)255255+ tEplEventObdError m_ObdError; // from Obd module271256// tEplErrHistoryEntry m_HistoryEntry; // from Nmtk/u module272257273273- } m_Arg;258258+ } m_Arg;274259275260} tEplEventError;276261277277-278262// structure for kEplEventTypeDllError279279-typedef struct280280-{281281- unsigned long m_ulDllErrorEvents; // EPL_DLL_ERR_*282282- unsigned int m_uiNodeId;283283- tEplNmtState m_NmtState;263263+typedef struct {264264+ unsigned long m_ulDllErrorEvents; // EPL_DLL_ERR_*265265+ unsigned int m_uiNodeId;266266+ tEplNmtState m_NmtState;284267285268} tEplErrorHandlerkEvent;286269287287-288270// callback function to get informed about sync event289289-typedef tEplKernel (PUBLIC* tEplSyncCb) (void);271271+typedef tEplKernel(PUBLIC * tEplSyncCb) (void);290272291273// callback function for generic events292292-typedef tEplKernel (PUBLIC* tEplProcessEventCb) (tEplEvent* pEplEvent_p);274274+typedef tEplKernel(PUBLIC * tEplProcessEventCb) (tEplEvent * pEplEvent_p);293275294276//---------------------------------------------------------------------------295277// function prototypes296278//---------------------------------------------------------------------------297279298298-299299-300300-#endif // #ifndef _EPL_EVENT_H_301301-302302-280280+#endif // #ifndef _EPL_EVENT_H_
···66666767 2006/05/22 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_INC_H_···7677// ============================================================================7778#if defined(WIN32) || defined(_WIN32)78797979- #ifdef UNDER_RTSS8080- // RTX header8181- #include <windows.h>8282- #include <process.h>8383- #include <rtapi.h>8080+#ifdef UNDER_RTSS8181+ // RTX header8282+#include <windows.h>8383+#include <process.h>8484+#include <rtapi.h>84858585- #elif __BORLANDC__8686- // borland C header8787- #include <windows.h>8888- #include <process.h>8686+#elif __BORLANDC__8787+ // borland C header8888+#include <windows.h>8989+#include <process.h>89909090- #elif WINCE9191- #include <windows.h>9191+#elif WINCE9292+#include <windows.h>92939393- #else9494- // MSVC needs to include windows.h at first9595- // the following defines ar necessary for function prototypes for waitable timers9696- #define _WIN32_WINDOWS 0x04019797- #define _WIN32_WINNT 0x04009898- #include <windows.h>9999- #include <process.h>100100- #endif9494+#else9595+ // MSVC needs to include windows.h at first9696+ // the following defines ar necessary for function prototypes for waitable timers9797+#define _WIN32_WINDOWS 0x04019898+#define _WIN32_WINNT 0x04009999+#include <windows.h>100100+#include <process.h>101101+#endif101102102103#endif103104···105106// possible other include file needed106107// These constants defines modules which can be included in the Epl application.107108// Use this constants for define EPL_MODULE_INTEGRATION in file EplCfg.h.108108-#define EPL_MODULE_OBDK 0x00000001L // OBD kernel part module109109-#define EPL_MODULE_PDOK 0x00000002L // PDO kernel part module110110-#define EPL_MODULE_NMT_MN 0x00000004L // NMT MN module111111-#define EPL_MODULE_SDOS 0x00000008L // SDO Server module112112-#define EPL_MODULE_SDOC 0x00000010L // SDO Client module113113-#define EPL_MODULE_SDO_ASND 0x00000020L // SDO over Asnd module114114-#define EPL_MODULE_SDO_UDP 0x00000040L // SDO over UDP module115115-#define EPL_MODULE_SDO_PDO 0x00000080L // SDO in PDO module116116-#define EPL_MODULE_NMT_CN 0x00000100L // NMT CN module117117-#define EPL_MODULE_NMTU 0x00000200L // NMT user part module118118-#define EPL_MODULE_NMTK 0x00000400L // NMT kernel part module119119-#define EPL_MODULE_DLLK 0x00000800L // DLL kernel part module120120-#define EPL_MODULE_DLLU 0x00001000L // DLL user part module121121-#define EPL_MODULE_OBDU 0x00002000L // OBD user part module122122-#define EPL_MODULE_CFGMA 0x00004000L // Configuartioan Manager module123123-#define EPL_MODULE_VETH 0x00008000L // virtual ethernet driver module124124-#define EPL_MODULE_PDOU 0x00010000L // PDO user part module125125-#define EPL_MODULE_LEDU 0x00020000L // LED user part module109109+#define EPL_MODULE_OBDK 0x00000001L // OBD kernel part module110110+#define EPL_MODULE_PDOK 0x00000002L // PDO kernel part module111111+#define EPL_MODULE_NMT_MN 0x00000004L // NMT MN module112112+#define EPL_MODULE_SDOS 0x00000008L // SDO Server module113113+#define EPL_MODULE_SDOC 0x00000010L // SDO Client module114114+#define EPL_MODULE_SDO_ASND 0x00000020L // SDO over Asnd module115115+#define EPL_MODULE_SDO_UDP 0x00000040L // SDO over UDP module116116+#define EPL_MODULE_SDO_PDO 0x00000080L // SDO in PDO module117117+#define EPL_MODULE_NMT_CN 0x00000100L // NMT CN module118118+#define EPL_MODULE_NMTU 0x00000200L // NMT user part module119119+#define EPL_MODULE_NMTK 0x00000400L // NMT kernel part module120120+#define EPL_MODULE_DLLK 0x00000800L // DLL kernel part module121121+#define EPL_MODULE_DLLU 0x00001000L // DLL user part module122122+#define EPL_MODULE_OBDU 0x00002000L // OBD user part module123123+#define EPL_MODULE_CFGMA 0x00004000L // Configuartioan Manager module124124+#define EPL_MODULE_VETH 0x00008000L // virtual ethernet driver module125125+#define EPL_MODULE_PDOU 0x00010000L // PDO user part module126126+#define EPL_MODULE_LEDU 0x00020000L // LED user part module126127127127-#include "EplCfg.h" // EPL configuration file (configuration from application)128128+#include "EplCfg.h" // EPL configuration file (configuration from application)128129129129-#include "global.h" // global definitions130130+#include "global.h" // global definitions130131131131-#include "EplDef.h" // EPL configuration file (default configuration)132132-#include "EplInstDef.h" // defines macros for instance types and table133133-#include "Debug.h" // debug definitions132132+#include "EplDef.h" // EPL configuration file (default configuration)133133+#include "EplInstDef.h" // defines macros for instance types and table134134+#include "Debug.h" // debug definitions134135135135-#include "EplErrDef.h" // EPL error codes for API funtions136136+#include "EplErrDef.h" // EPL error codes for API funtions136137137138//---------------------------------------------------------------------------138139// typedef139140//---------------------------------------------------------------------------140141141142// IEEE 1588 conformant net time structure142142-typedef struct143143-{144144- DWORD m_dwSec;145145- DWORD m_dwNanoSec;143143+typedef struct {144144+ DWORD m_dwSec;145145+ DWORD m_dwNanoSec;146146147147} tEplNetTime;148148149149-150150-#include "EplTarget.h" // target specific functions and definitions149149+#include "EplTarget.h" // target specific functions and definitions151150152151#include "EplAmi.h"153152···153156// macros154157// -------------------------------------------------------------------------155158156156-#define EPL_SPEC_VERSION 0x20 // ETHERNET Powerlink V. 2.0159159+#define EPL_SPEC_VERSION 0x20 // ETHERNET Powerlink V. 2.0157160#define EPL_STACK_VERSION(ver,rev,rel) ((((DWORD)(ver)) & 0xFF)|((((DWORD)(rev))&0xFF)<<8)|(((DWORD)(rel))<<16))158161#define EPL_OBJ1018_VERSION(ver,rev,rel) ((((DWORD)(ver))<<16) |(((DWORD)(rev))&0xFFFF))159162#define EPL_STRING_VERSION(ver,rev,rel) "V" #ver "." #rev " r" #rel···176179#define EPL_FEATURE_RT1 0x00001000177180#define EPL_FEATURE_RT2 0x00002000178181179179-180182// generate EPL NMT_FeatureFlags_U32181183#ifndef EPL_DEF_FEATURE_ISOCHR182182- #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0)183183- #define EPL_DEF_FEATURE_ISOCHR (EPL_FEATURE_ISOCHR)184184- #else185185- #define EPL_DEF_FEATURE_ISOCHR 0186186- #endif184184+#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0)185185+#define EPL_DEF_FEATURE_ISOCHR (EPL_FEATURE_ISOCHR)186186+#else187187+#define EPL_DEF_FEATURE_ISOCHR 0188188+#endif187189#endif188190189191#ifndef EPL_DEF_FEATURE_SDO_ASND190190- #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_ASND)) != 0)191191- #define EPL_DEF_FEATURE_SDO_ASND (EPL_FEATURE_SDO_ASND)192192- #else193193- #define EPL_DEF_FEATURE_SDO_ASND 0194194- #endif192192+#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_ASND)) != 0)193193+#define EPL_DEF_FEATURE_SDO_ASND (EPL_FEATURE_SDO_ASND)194194+#else195195+#define EPL_DEF_FEATURE_SDO_ASND 0196196+#endif195197#endif196198197199#ifndef EPL_DEF_FEATURE_SDO_UDP198198- #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_UDP)) != 0)199199- #define EPL_DEF_FEATURE_SDO_UDP (EPL_FEATURE_SDO_UDP)200200- #else201201- #define EPL_DEF_FEATURE_SDO_UDP 0202202- #endif200200+#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_UDP)) != 0)201201+#define EPL_DEF_FEATURE_SDO_UDP (EPL_FEATURE_SDO_UDP)202202+#else203203+#define EPL_DEF_FEATURE_SDO_UDP 0204204+#endif203205#endif204206205207#ifndef EPL_DEF_FEATURE_SDO_PDO206206- #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_PDO)) != 0)207207- #define EPL_DEF_FEATURE_SDO_PDO (EPL_FEATURE_SDO_PDO)208208- #else209209- #define EPL_DEF_FEATURE_SDO_PDO 0210210- #endif208208+#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_PDO)) != 0)209209+#define EPL_DEF_FEATURE_SDO_PDO (EPL_FEATURE_SDO_PDO)210210+#else211211+#define EPL_DEF_FEATURE_SDO_PDO 0212212+#endif211213#endif212214213215#ifndef EPL_DEF_FEATURE_PDO_DYN214214- #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_PDOK)) != 0)215215- #define EPL_DEF_FEATURE_PDO_DYN (EPL_FEATURE_PDO_DYN)216216- #else217217- #define EPL_DEF_FEATURE_PDO_DYN 0218218- #endif216216+#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_PDOK)) != 0)217217+#define EPL_DEF_FEATURE_PDO_DYN (EPL_FEATURE_PDO_DYN)218218+#else219219+#define EPL_DEF_FEATURE_PDO_DYN 0220220+#endif219221#endif220222221223#ifndef EPL_DEF_FEATURE_CFGMA222222- #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_CFGMA)) != 0)223223- #define EPL_DEF_FEATURE_CFGMA (EPL_FEATURE_CFGMA)224224- #else225225- #define EPL_DEF_FEATURE_CFGMA 0226226- #endif224224+#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_CFGMA)) != 0)225225+#define EPL_DEF_FEATURE_CFGMA (EPL_FEATURE_CFGMA)226226+#else227227+#define EPL_DEF_FEATURE_CFGMA 0228228+#endif227229#endif228230229231#define EPL_DEF_FEATURE_FLAGS (EPL_DEF_FEATURE_ISOCHR \···232236 | EPL_DEF_FEATURE_PDO_DYN \233237 | EPL_DEF_FEATURE_CFGMA)234238235235-236239#ifndef tabentries237240#define tabentries(a) (sizeof(a)/sizeof(*(a)))238241#endif239239-240242241243//---------------------------------------------------------------------------242244// const defines···243249// definitions for DLL export244250#if ((DEV_SYSTEM == _DEV_WIN32_) || (DEV_SYSTEM == _DEV_WIN_CE_)) && defined (COP_LIB)245251246246- #define EPLDLLEXPORT __declspec (dllexport)252252+#define EPLDLLEXPORT __declspec (dllexport)247253248254#else249255250250- #define EPLDLLEXPORT256256+#define EPLDLLEXPORT251257252258#endif253253-254259255260// ============================================================================256261// common debug macros···266273// default level is defined in copdef.h267274268275// debug-level and TRACE-macros // standard-level // flags for DEF_DEBUG_LVL269269-#define EPL_DBGLVL_EDRV DEBUG_LVL_01 // 0x00000001L276276+#define EPL_DBGLVL_EDRV DEBUG_LVL_01 // 0x00000001L270277#define EPL_DBGLVL_EDRV_TRACE0 DEBUG_LVL_01_TRACE0271278#define EPL_DBGLVL_EDRV_TRACE1 DEBUG_LVL_01_TRACE1272279#define EPL_DBGLVL_EDRV_TRACE2 DEBUG_LVL_01_TRACE2273280#define EPL_DBGLVL_EDRV_TRACE3 DEBUG_LVL_01_TRACE3274281#define EPL_DBGLVL_EDRV_TRACE4 DEBUG_LVL_01_TRACE4275282276276-#define EPL_DBGLVL_DLL DEBUG_LVL_02 // 0x00000002L283283+#define EPL_DBGLVL_DLL DEBUG_LVL_02 // 0x00000002L277284#define EPL_DBGLVL_DLL_TRACE0 DEBUG_LVL_02_TRACE0278285#define EPL_DBGLVL_DLL_TRACE1 DEBUG_LVL_02_TRACE1279286#define EPL_DBGLVL_DLL_TRACE2 DEBUG_LVL_02_TRACE2280287#define EPL_DBGLVL_DLL_TRACE3 DEBUG_LVL_02_TRACE3281288#define EPL_DBGLVL_DLL_TRACE4 DEBUG_LVL_02_TRACE4282289283283-#define EPL_DBGLVL_OBD DEBUG_LVL_03 // 0x00000004L290290+#define EPL_DBGLVL_OBD DEBUG_LVL_03 // 0x00000004L284291#define EPL_DBGLVL_OBD_TRACE0 DEBUG_LVL_03_TRACE0285292#define EPL_DBGLVL_OBD_TRACE1 DEBUG_LVL_03_TRACE1286293#define EPL_DBGLVL_OBD_TRACE2 DEBUG_LVL_03_TRACE2287294#define EPL_DBGLVL_OBD_TRACE3 DEBUG_LVL_03_TRACE3288295#define EPL_DBGLVL_OBD_TRACE4 DEBUG_LVL_03_TRACE4289296290290-#define EPL_DBGLVL_NMTK DEBUG_LVL_04 // 0x00000008L297297+#define EPL_DBGLVL_NMTK DEBUG_LVL_04 // 0x00000008L291298#define EPL_DBGLVL_NMTK_TRACE0 DEBUG_LVL_04_TRACE0292299#define EPL_DBGLVL_NMTK_TRACE1 DEBUG_LVL_04_TRACE1293300#define EPL_DBGLVL_NMTK_TRACE2 DEBUG_LVL_04_TRACE2294301#define EPL_DBGLVL_NMTK_TRACE3 DEBUG_LVL_04_TRACE3295302#define EPL_DBGLVL_NMTK_TRACE4 DEBUG_LVL_04_TRACE4296303297297-#define EPL_DBGLVL_NMTCN DEBUG_LVL_05 // 0x00000010L304304+#define EPL_DBGLVL_NMTCN DEBUG_LVL_05 // 0x00000010L298305#define EPL_DBGLVL_NMTCN_TRACE0 DEBUG_LVL_05_TRACE0299306#define EPL_DBGLVL_NMTCN_TRACE1 DEBUG_LVL_05_TRACE1300307#define EPL_DBGLVL_NMTCN_TRACE2 DEBUG_LVL_05_TRACE2301308#define EPL_DBGLVL_NMTCN_TRACE3 DEBUG_LVL_05_TRACE3302309#define EPL_DBGLVL_NMTCN_TRACE4 DEBUG_LVL_05_TRACE4303310304304-#define EPL_DBGLVL_NMTU DEBUG_LVL_06 // 0x00000020L311311+#define EPL_DBGLVL_NMTU DEBUG_LVL_06 // 0x00000020L305312#define EPL_DBGLVL_NMTU_TRACE0 DEBUG_LVL_06_TRACE0306313#define EPL_DBGLVL_NMTU_TRACE1 DEBUG_LVL_06_TRACE1307314#define EPL_DBGLVL_NMTU_TRACE2 DEBUG_LVL_06_TRACE2308315#define EPL_DBGLVL_NMTU_TRACE3 DEBUG_LVL_06_TRACE3309316#define EPL_DBGLVL_NMTU_TRACE4 DEBUG_LVL_06_TRACE4310317311311-#define EPL_DBGLVL_NMTMN DEBUG_LVL_07 // 0x00000040L318318+#define EPL_DBGLVL_NMTMN DEBUG_LVL_07 // 0x00000040L312319#define EPL_DBGLVL_NMTMN_TRACE0 DEBUG_LVL_07_TRACE0313320#define EPL_DBGLVL_NMTMN_TRACE1 DEBUG_LVL_07_TRACE1314321#define EPL_DBGLVL_NMTMN_TRACE2 DEBUG_LVL_07_TRACE2···317324318325//...319326320320-#define EPL_DBGLVL_SDO DEBUG_LVL_25 // 0x01000000327327+#define EPL_DBGLVL_SDO DEBUG_LVL_25 // 0x01000000321328#define EPL_DBGLVL_SDO_TRACE0 DEBUG_LVL_25_TRACE0322329#define EPL_DBGLVL_SDO_TRACE1 DEBUG_LVL_25_TRACE1323330#define EPL_DBGLVL_SDO_TRACE2 DEBUG_LVL_25_TRACE2324331#define EPL_DBGLVL_SDO_TRACE3 DEBUG_LVL_25_TRACE3325332#define EPL_DBGLVL_SDO_TRACE4 DEBUG_LVL_25_TRACE4326333327327-#define EPL_DBGLVL_VETH DEBUG_LVL_26 // 0x02000000334334+#define EPL_DBGLVL_VETH DEBUG_LVL_26 // 0x02000000328335#define EPL_DBGLVL_VETH_TRACE0 DEBUG_LVL_26_TRACE0329336#define EPL_DBGLVL_VETH_TRACE1 DEBUG_LVL_26_TRACE1330337#define EPL_DBGLVL_VETH_TRACE2 DEBUG_LVL_26_TRACE2331338#define EPL_DBGLVL_VETH_TRACE3 DEBUG_LVL_26_TRACE3332339#define EPL_DBGLVL_VETH_TRACE4 DEBUG_LVL_26_TRACE4333340334334-#define EPL_DBGLVL_EVENTK DEBUG_LVL_27 // 0x04000000341341+#define EPL_DBGLVL_EVENTK DEBUG_LVL_27 // 0x04000000335342#define EPL_DBGLVL_EVENTK_TRACE0 DEBUG_LVL_27_TRACE0336343#define EPL_DBGLVL_EVENTK_TRACE1 DEBUG_LVL_27_TRACE1337344#define EPL_DBGLVL_EVENTK_TRACE2 DEBUG_LVL_27_TRACE2338345#define EPL_DBGLVL_EVENTK_TRACE3 DEBUG_LVL_27_TRACE3339346#define EPL_DBGLVL_EVENTK_TRACE4 DEBUG_LVL_27_TRACE4340347341341-#define EPL_DBGLVL_EVENTU DEBUG_LVL_28 // 0x08000000348348+#define EPL_DBGLVL_EVENTU DEBUG_LVL_28 // 0x08000000342349#define EPL_DBGLVL_EVENTU_TRACE0 DEBUG_LVL_28_TRACE0343350#define EPL_DBGLVL_EVENTU_TRACE1 DEBUG_LVL_28_TRACE1344351#define EPL_DBGLVL_EVENTU_TRACE2 DEBUG_LVL_28_TRACE2···346353#define EPL_DBGLVL_EVENTU_TRACE4 DEBUG_LVL_28_TRACE4347354348355// SharedBuff349349-#define EPL_DBGLVL_SHB DEBUG_LVL_29 // 0x10000000356356+#define EPL_DBGLVL_SHB DEBUG_LVL_29 // 0x10000000350357#define EPL_DBGLVL_SHB_TRACE0 DEBUG_LVL_29_TRACE0351358#define EPL_DBGLVL_SHB_TRACE1 DEBUG_LVL_29_TRACE1352359#define EPL_DBGLVL_SHB_TRACE2 DEBUG_LVL_29_TRACE2353360#define EPL_DBGLVL_SHB_TRACE3 DEBUG_LVL_29_TRACE3354361#define EPL_DBGLVL_SHB_TRACE4 DEBUG_LVL_29_TRACE4355362356356-#define EPL_DBGLVL_ASSERT DEBUG_LVL_ASSERT // 0x20000000L363363+#define EPL_DBGLVL_ASSERT DEBUG_LVL_ASSERT // 0x20000000L357364#define EPL_DBGLVL_ASSERT_TRACE0 DEBUG_LVL_ASSERT_TRACE0358365#define EPL_DBGLVL_ASSERT_TRACE1 DEBUG_LVL_ASSERT_TRACE1359366#define EPL_DBGLVL_ASSERT_TRACE2 DEBUG_LVL_ASSERT_TRACE2360367#define EPL_DBGLVL_ASSERT_TRACE3 DEBUG_LVL_ASSERT_TRACE3361368#define EPL_DBGLVL_ASSERT_TRACE4 DEBUG_LVL_ASSERT_TRACE4362369363363-#define EPL_DBGLVL_ERROR DEBUG_LVL_ERROR // 0x40000000L370370+#define EPL_DBGLVL_ERROR DEBUG_LVL_ERROR // 0x40000000L364371#define EPL_DBGLVL_ERROR_TRACE0 DEBUG_LVL_ERROR_TRACE0365372#define EPL_DBGLVL_ERROR_TRACE1 DEBUG_LVL_ERROR_TRACE1366373#define EPL_DBGLVL_ERROR_TRACE2 DEBUG_LVL_ERROR_TRACE2367374#define EPL_DBGLVL_ERROR_TRACE3 DEBUG_LVL_ERROR_TRACE3368375#define EPL_DBGLVL_ERROR_TRACE4 DEBUG_LVL_ERROR_TRACE4369376370370-#define EPL_DBGLVL_ALWAYS DEBUG_LVL_ALWAYS // 0x80000000L377377+#define EPL_DBGLVL_ALWAYS DEBUG_LVL_ALWAYS // 0x80000000L371378#define EPL_DBGLVL_ALWAYS_TRACE0 DEBUG_LVL_ALWAYS_TRACE0372379#define EPL_DBGLVL_ALWAYS_TRACE1 DEBUG_LVL_ALWAYS_TRACE1373380#define EPL_DBGLVL_ALWAYS_TRACE2 DEBUG_LVL_ALWAYS_TRACE2374381#define EPL_DBGLVL_ALWAYS_TRACE3 DEBUG_LVL_ALWAYS_TRACE3375382#define EPL_DBGLVL_ALWAYS_TRACE4 DEBUG_LVL_ALWAYS_TRACE4376383377377-378384//---------------------------------------------------------------------------379385// typedef380386//---------------------------------------------------------------------------381381-382382-383387384388//---------------------------------------------------------------------------385389// function prototypes386390//---------------------------------------------------------------------------387391388388-389389-#endif // #ifndef _EPL_INC_H_390390-391391-392392+#endif // #ifndef _EPL_INC_H_
+106-115
drivers/staging/epl/EplInstDef.h
···7171#ifndef _EPLINSTDEF_H_7272#define _EPLINSTDEF_H_73737474-7574// =========================================================================7675// types and macros for generating instances7776// =========================================================================78777979-typedef enum8080-{8181- kStateUnused = 0,8282- kStateDeleted = 1,8383- kStateUsed = 0xFF8484-7878+typedef enum {7979+ kStateUnused = 0,8080+ kStateDeleted = 1,8181+ kStateUsed = 0xFF8582} tInstState;86838784//------------------------------------------------------------------------------------------88858989-typedef void MEM* tEplPtrInstance;9090-typedef BYTE tEplInstanceHdl;8686+typedef void MEM *tEplPtrInstance;8787+typedef BYTE tEplInstanceHdl;91889289// define const for illegale values9390#define CCM_ILLINSTANCE NULL···99102 //--------------------------------------------------------------------------------------100103101104 // memory attributes for instance table102102- #define INST_NEAR // faster access to variables103103- #define INST_FAR // variables wich have to located in xdata104104- #define STATIC // prevent warnings for variables with same name105105+#define INST_NEAR // faster access to variables106106+#define INST_FAR // variables wich have to located in xdata107107+#define STATIC // prevent warnings for variables with same name105108106106- #define INSTANCE_TYPE_BEGIN typedef struct {107107- #define INSTANCE_TYPE_END } tEplInstanceInfo;108108-109109+#define INSTANCE_TYPE_BEGIN typedef struct {110110+#define INSTANCE_TYPE_END } tEplInstanceInfo;109111110112 //--------------------------------------------------------------------------------------111113 // macro definition for API interface···113117 // declaration:114118115119 // macros for declaration within function header or prototype of API functions116116- #define CCM_DECL_INSTANCE_HDL tEplInstanceHdl InstanceHandle117117- #define CCM_DECL_INSTANCE_HDL_ tEplInstanceHdl InstanceHandle,120120+#define CCM_DECL_INSTANCE_HDL tEplInstanceHdl InstanceHandle121121+#define CCM_DECL_INSTANCE_HDL_ tEplInstanceHdl InstanceHandle,118122119123 // macros for declaration of pointer to instance handle within function header or prototype of API functions120120- #define CCM_DECL_PTR_INSTANCE_HDL tEplInstanceHdl MEM* pInstanceHandle121121- #define CCM_DECL_PTR_INSTANCE_HDL_ tEplInstanceHdl MEM* pInstanceHandle,124124+#define CCM_DECL_PTR_INSTANCE_HDL tEplInstanceHdl MEM* pInstanceHandle125125+#define CCM_DECL_PTR_INSTANCE_HDL_ tEplInstanceHdl MEM* pInstanceHandle,122126123127 // macros for declaration instance as lokacl variable within functions124124- #define CCM_DECL_INSTANCE_PTR_LOCAL tCcmInstanceInfo MEM* pInstance;125125- #define CCM_DECL_PTR_INSTANCE_HDL_LOCAL tEplInstanceHdl MEM* pInstanceHandle;128128+#define CCM_DECL_INSTANCE_PTR_LOCAL tCcmInstanceInfo MEM* pInstance;129129+#define CCM_DECL_PTR_INSTANCE_HDL_LOCAL tEplInstanceHdl MEM* pInstanceHandle;126130127131 // reference:128132129133 // macros for reference of instance handle for function parameters130130- #define CCM_INSTANCE_HDL InstanceHandle131131- #define CCM_INSTANCE_HDL_ InstanceHandle,134134+#define CCM_INSTANCE_HDL InstanceHandle135135+#define CCM_INSTANCE_HDL_ InstanceHandle,132136133137 // macros for reference of instance parameter for function parameters134134- #define CCM_INSTANCE_PARAM(par) par135135- #define CCM_INSTANCE_PARAM_(par) par,138138+#define CCM_INSTANCE_PARAM(par) par139139+#define CCM_INSTANCE_PARAM_(par) par,136140137141 // macros for reference of instance parameter for writing or reading values138138- #define CCM_INST_ENTRY (*((tEplPtrInstance)pInstance))142142+#define CCM_INST_ENTRY (*((tEplPtrInstance)pInstance))139143140144 // processing:141145142146 // macros for process instance handle143143- #define CCM_CHECK_INSTANCE_HDL() if (InstanceHandle >= EPL_MAX_INSTANCES) \147147+#define CCM_CHECK_INSTANCE_HDL() if (InstanceHandle >= EPL_MAX_INSTANCES) \144148 {return (kEplIllegalInstance);}145149146146-147150 // macros for process pointer to instance handle148148- #define CCM_CHECK_PTR_INSTANCE_HDL() if (pInstanceHandle == NULL) \151151+#define CCM_CHECK_PTR_INSTANCE_HDL() if (pInstanceHandle == NULL) \149152 {return (kEplInvalidInstanceParam);}150153151154 // This macro returned the handle and pointer to next free instance.152152- #define CCM_GET_FREE_INSTANCE_AND_HDL() pInstance = CcmGetFreeInstanceAndHandle (pInstanceHandle); \155155+#define CCM_GET_FREE_INSTANCE_AND_HDL() pInstance = CcmGetFreeInstanceAndHandle (pInstanceHandle); \153156 ASSERT (*pInstanceHandle != CCM_ILLINSTANCE_HDL);154157155155- #define CCM_CHECK_INSTANCE_PTR() if (pInstance == CCM_ILLINSTANCE) \158158+#define CCM_CHECK_INSTANCE_PTR() if (pInstance == CCM_ILLINSTANCE) \156159 {return (kEplNoFreeInstance);}157160158158- #define CCM_GET_INSTANCE_PTR() pInstance = CcmGetInstancePtr (InstanceHandle);159159- #define CCM_GET_FREE_INSTANCE_PTR() pInstance = GetFreeInstance (); \161161+#define CCM_GET_INSTANCE_PTR() pInstance = CcmGetInstancePtr (InstanceHandle);162162+#define CCM_GET_FREE_INSTANCE_PTR() pInstance = GetFreeInstance (); \160163 ASSERT (pInstance != CCM_ILLINSTANCE);161161-162164163165 //--------------------------------------------------------------------------------------164166 // macro definition for stack interface···165171 // macros for declaration within the function header, prototype or local var list166172 // Declaration of pointers within function paramater list must defined as void MEM*167173 // pointer.168168- #define EPL_MCO_DECL_INSTANCE_PTR void MEM* pInstance169169- #define EPL_MCO_DECL_INSTANCE_PTR_ void MEM* pInstance,170170- #define EPL_MCO_DECL_INSTANCE_PTR_LOCAL tEplPtrInstance pInstance;174174+#define EPL_MCO_DECL_INSTANCE_PTR void MEM* pInstance175175+#define EPL_MCO_DECL_INSTANCE_PTR_ void MEM* pInstance,176176+#define EPL_MCO_DECL_INSTANCE_PTR_LOCAL tEplPtrInstance pInstance;171177172178 // macros for reference of pointer to instance173179 // These macros are used for parameter passing to called function.174174- #define EPL_MCO_INSTANCE_PTR pInstance175175- #define EPL_MCO_INSTANCE_PTR_ pInstance,176176- #define EPL_MCO_ADDR_INSTANCE_PTR_ &pInstance,180180+#define EPL_MCO_INSTANCE_PTR pInstance181181+#define EPL_MCO_INSTANCE_PTR_ pInstance,182182+#define EPL_MCO_ADDR_INSTANCE_PTR_ &pInstance,177183178184 // macro for access of struct members of one instance179185 // An access to a member of instance table must be casted by the local180186 // defined type of instance table.181181- #define EPL_MCO_INST_ENTRY (*(tEplPtrInstance)pInstance)182182- #define EPL_MCO_GLB_VAR(var) (((tEplPtrInstance)pInstance)->var)187187+#define EPL_MCO_INST_ENTRY (*(tEplPtrInstance)pInstance)188188+#define EPL_MCO_GLB_VAR(var) (((tEplPtrInstance)pInstance)->var)183189184190 // macros for process pointer to instance185185- #define EPL_MCO_GET_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetInstancePtr (InstanceHandle);186186- #define EPL_MCO_GET_FREE_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetFreeInstance (); \191191+#define EPL_MCO_GET_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetInstancePtr (InstanceHandle);192192+#define EPL_MCO_GET_FREE_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetFreeInstance (); \187193 ASSERT (pInstance != CCM_ILLINSTANCE);188194189195 // This macro should be used to check the passed pointer to an public function190190- #define EPL_MCO_CHECK_INSTANCE_STATE() ASSERT (pInstance != NULL); \196196+#define EPL_MCO_CHECK_INSTANCE_STATE() ASSERT (pInstance != NULL); \191197 ASSERT (((tEplPtrInstance)pInstance)->m_InstState == kStateUsed);192198193199 // macros for declaration of pointer to instance pointer194194- #define EPL_MCO_DECL_PTR_INSTANCE_PTR void MEM* MEM* pInstancePtr195195- #define EPL_MCO_DECL_PTR_INSTANCE_PTR_ void MEM* MEM* pInstancePtr,200200+#define EPL_MCO_DECL_PTR_INSTANCE_PTR void MEM* MEM* pInstancePtr201201+#define EPL_MCO_DECL_PTR_INSTANCE_PTR_ void MEM* MEM* pInstancePtr,196202197203 // macros for reference of pointer to instance pointer198204 // These macros are used for parameter passing to called function.199199- #define EPL_MCO_PTR_INSTANCE_PTR pInstancePtr200200- #define EPL_MCO_PTR_INSTANCE_PTR_ pInstancePtr,205205+#define EPL_MCO_PTR_INSTANCE_PTR pInstancePtr206206+#define EPL_MCO_PTR_INSTANCE_PTR_ pInstancePtr,201207202208 // macros for process pointer to instance pointer203203- #define EPL_MCO_CHECK_PTR_INSTANCE_PTR() ASSERT (pInstancePtr != NULL);204204- #define EPL_MCO_SET_PTR_INSTANCE_PTR() (*pInstancePtr = pInstance);209209+#define EPL_MCO_CHECK_PTR_INSTANCE_PTR() ASSERT (pInstancePtr != NULL);210210+#define EPL_MCO_SET_PTR_INSTANCE_PTR() (*pInstancePtr = pInstance);205211206206- #define EPL_MCO_INSTANCE_PARAM(a) (a)207207- #define EPL_MCO_INSTANCE_PARAM_(a) (a),208208- #define EPL_MCO_INSTANCE_PARAM_IDX_() EPL_MCO_INSTANCE_PARAM_ (EPL_MCO_GLB_VAR (m_bInstIndex))209209- #define EPL_MCO_INSTANCE_PARAM_IDX() EPL_MCO_INSTANCE_PARAM (EPL_MCO_GLB_VAR (m_bInstIndex))210210- #define EPL_MCO_WRITE_INSTANCE_STATE(a) EPL_MCO_GLB_VAR (m_InstState) = a;212212+#define EPL_MCO_INSTANCE_PARAM(a) (a)213213+#define EPL_MCO_INSTANCE_PARAM_(a) (a),214214+#define EPL_MCO_INSTANCE_PARAM_IDX_() EPL_MCO_INSTANCE_PARAM_ (EPL_MCO_GLB_VAR (m_bInstIndex))215215+#define EPL_MCO_INSTANCE_PARAM_IDX() EPL_MCO_INSTANCE_PARAM (EPL_MCO_GLB_VAR (m_bInstIndex))216216+#define EPL_MCO_WRITE_INSTANCE_STATE(a) EPL_MCO_GLB_VAR (m_InstState) = a;211217212218 // this macro deletes all instance entries as unused213213- #define EPL_MCO_DELETE_INSTANCE_TABLE() \219219+#define EPL_MCO_DELETE_INSTANCE_TABLE() \214220 { \215221 tEplInstanceInfo MEM* pInstance = &aEplInstanceTable_g[0]; \216222 tFastByte InstNumber = 0; \···223229 }224230225231 // definition of functions which has to be defined in each module of CANopen stack226226- #define EPL_MCO_DEFINE_INSTANCE_FCT() \232232+#define EPL_MCO_DEFINE_INSTANCE_FCT() \227233 static tEplPtrInstance GetInstancePtr (tEplInstanceHdl InstHandle_p); \228234 static tEplPtrInstance GetFreeInstance (void);229229- #define EPL_MCO_DECL_INSTANCE_FCT() \235235+#define EPL_MCO_DECL_INSTANCE_FCT() \230236 static tEplPtrInstance GetInstancePtr (tEplInstanceHdl InstHandle_p) { \231237 return &aEplInstanceTable_g[InstHandle_p]; } \232238 static tEplPtrInstance GetFreeInstance (void) { \···239245 return CCM_ILLINSTANCE; }240246241247 // this macro defines the instance table. Each entry is reserved for an instance of CANopen.242242- #define EPL_MCO_DECL_INSTANCE_VAR() \248248+#define EPL_MCO_DECL_INSTANCE_VAR() \243249 static tEplInstanceInfo MEM aEplInstanceTable_g [EPL_MAX_INSTANCES];244250245251 // this macro defines member variables in instance table which are needed in246252 // all modules of Epl stack247247- #define EPL_MCO_DECL_INSTANCE_MEMBER() \253253+#define EPL_MCO_DECL_INSTANCE_MEMBER() \248254 STATIC BYTE m_InstState; \249255 STATIC BYTE m_bInstIndex;250256251251- #define EPL_MCO_INSTANCE_PARAM_IDX_() EPL_MCO_INSTANCE_PARAM_ (EPL_MCO_GLB_VAR (m_bInstIndex))252252- #define EPL_MCO_INSTANCE_PARAM_IDX() EPL_MCO_INSTANCE_PARAM (EPL_MCO_GLB_VAR (m_bInstIndex))257257+#define EPL_MCO_INSTANCE_PARAM_IDX_() EPL_MCO_INSTANCE_PARAM_ (EPL_MCO_GLB_VAR (m_bInstIndex))258258+#define EPL_MCO_INSTANCE_PARAM_IDX() EPL_MCO_INSTANCE_PARAM (EPL_MCO_GLB_VAR (m_bInstIndex))253259254254-#else // only one instance is used260260+#else // only one instance is used255261256262 // Memory attributes for instance table.257257- #define INST_NEAR NEAR // faster access to variables258258- #define INST_FAR MEM // variables wich have to located in xdata259259- #define STATIC static // prevent warnings for variables with same name263263+#define INST_NEAR NEAR // faster access to variables264264+#define INST_FAR MEM // variables wich have to located in xdata265265+#define STATIC static // prevent warnings for variables with same name260266261261- #define INSTANCE_TYPE_BEGIN262262- #define INSTANCE_TYPE_END267267+#define INSTANCE_TYPE_BEGIN268268+#define INSTANCE_TYPE_END263269264270// macros for declaration, initializing and member access for instance handle265271// This class of macros are used by API function to inform CCM-modul which···267273268274 // macros for reference of instance handle269275 // These macros are used for parameter passing to CANopen API function.270270- #define CCM_INSTANCE_HDL271271- #define CCM_INSTANCE_HDL_276276+#define CCM_INSTANCE_HDL277277+#define CCM_INSTANCE_HDL_272278273273- #define CCM_DECL_INSTANCE_PTR_LOCAL279279+#define CCM_DECL_INSTANCE_PTR_LOCAL274280275281 // macros for declaration within the function header or prototype276276- #define CCM_DECL_INSTANCE_HDL void277277- #define CCM_DECL_INSTANCE_HDL_282282+#define CCM_DECL_INSTANCE_HDL void283283+#define CCM_DECL_INSTANCE_HDL_278284279285 // macros for process instance handle280280- #define CCM_CHECK_INSTANCE_HDL()286286+#define CCM_CHECK_INSTANCE_HDL()281287282288 // macros for declaration of pointer to instance handle283283- #define CCM_DECL_PTR_INSTANCE_HDL void284284- #define CCM_DECL_PTR_INSTANCE_HDL_289289+#define CCM_DECL_PTR_INSTANCE_HDL void290290+#define CCM_DECL_PTR_INSTANCE_HDL_285291286292 // macros for process pointer to instance handle287287- #define CCM_CHECK_PTR_INSTANCE_HDL()293293+#define CCM_CHECK_PTR_INSTANCE_HDL()288294289295 // This macro returned the handle and pointer to next free instance.290290- #define CCM_GET_FREE_INSTANCE_AND_HDL()296296+#define CCM_GET_FREE_INSTANCE_AND_HDL()291297292292- #define CCM_CHECK_INSTANCE_PTR()298298+#define CCM_CHECK_INSTANCE_PTR()293299294294- #define CCM_GET_INSTANCE_PTR()295295- #define CCM_GET_FREE_INSTANCE_PTR()300300+#define CCM_GET_INSTANCE_PTR()301301+#define CCM_GET_FREE_INSTANCE_PTR()296302297297- #define CCM_INSTANCE_PARAM(par)298298- #define CCM_INSTANCE_PARAM_(par)303303+#define CCM_INSTANCE_PARAM(par)304304+#define CCM_INSTANCE_PARAM_(par)299305300300- #define CCM_INST_ENTRY aCcmInstanceTable_g[0]306306+#define CCM_INST_ENTRY aCcmInstanceTable_g[0]301307302308// macros for declaration, initializing and member access for instance pointer303309// This class of macros are used by CANopen internal function to point to one instance.304310305311 // macros for declaration within the function header, prototype or local var list306306- #define EPL_MCO_DECL_INSTANCE_PTR void307307- #define EPL_MCO_DECL_INSTANCE_PTR_308308- #define EPL_MCO_DECL_INSTANCE_PTR_LOCAL312312+#define EPL_MCO_DECL_INSTANCE_PTR void313313+#define EPL_MCO_DECL_INSTANCE_PTR_314314+#define EPL_MCO_DECL_INSTANCE_PTR_LOCAL309315310316 // macros for reference of pointer to instance311317 // These macros are used for parameter passing to called function.312312- #define EPL_MCO_INSTANCE_PTR313313- #define EPL_MCO_INSTANCE_PTR_314314- #define EPL_MCO_ADDR_INSTANCE_PTR_318318+#define EPL_MCO_INSTANCE_PTR319319+#define EPL_MCO_INSTANCE_PTR_320320+#define EPL_MCO_ADDR_INSTANCE_PTR_315321316322 // macros for process pointer to instance317317- #define EPL_MCO_GET_INSTANCE_PTR()318318- #define EPL_MCO_GET_FREE_INSTANCE_PTR()323323+#define EPL_MCO_GET_INSTANCE_PTR()324324+#define EPL_MCO_GET_FREE_INSTANCE_PTR()319325320326 // This macro should be used to check the passed pointer to an public function321321- #define EPL_MCO_CHECK_INSTANCE_STATE()327327+#define EPL_MCO_CHECK_INSTANCE_STATE()322328323329 // macros for declaration of pointer to instance pointer324324- #define EPL_MCO_DECL_PTR_INSTANCE_PTR void325325- #define EPL_MCO_DECL_PTR_INSTANCE_PTR_330330+#define EPL_MCO_DECL_PTR_INSTANCE_PTR void331331+#define EPL_MCO_DECL_PTR_INSTANCE_PTR_326332327333 // macros for reference of pointer to instance pointer328334 // These macros are used for parameter passing to called function.329329- #define EPL_MCO_PTR_INSTANCE_PTR330330- #define EPL_MCO_PTR_INSTANCE_PTR_335335+#define EPL_MCO_PTR_INSTANCE_PTR336336+#define EPL_MCO_PTR_INSTANCE_PTR_331337332338 // macros for process pointer to instance pointer333333- #define EPL_MCO_CHECK_PTR_INSTANCE_PTR()334334- #define EPL_MCO_SET_PTR_INSTANCE_PTR()339339+#define EPL_MCO_CHECK_PTR_INSTANCE_PTR()340340+#define EPL_MCO_SET_PTR_INSTANCE_PTR()335341336336- #define EPL_MCO_INSTANCE_PARAM(a)337337- #define EPL_MCO_INSTANCE_PARAM_(a)338338- #define EPL_MCO_INSTANCE_PARAM_IDX_()339339- #define EPL_MCO_INSTANCE_PARAM_IDX()342342+#define EPL_MCO_INSTANCE_PARAM(a)343343+#define EPL_MCO_INSTANCE_PARAM_(a)344344+#define EPL_MCO_INSTANCE_PARAM_IDX_()345345+#define EPL_MCO_INSTANCE_PARAM_IDX()340346341347 // macro for access of struct members of one instance342342- #define EPL_MCO_INST_ENTRY aEplInstanceTable_g[0]343343- #define EPL_MCO_GLB_VAR(var) (var)344344- #define EPL_MCO_WRITE_INSTANCE_STATE(a)348348+#define EPL_MCO_INST_ENTRY aEplInstanceTable_g[0]349349+#define EPL_MCO_GLB_VAR(var) (var)350350+#define EPL_MCO_WRITE_INSTANCE_STATE(a)345351346352 // this macro deletes all instance entries as unused347347- #define EPL_MCO_DELETE_INSTANCE_TABLE()353353+#define EPL_MCO_DELETE_INSTANCE_TABLE()348354349355 // definition of functions which has to be defined in each module of CANopen stack350350- #define EPL_MCO_DEFINE_INSTANCE_FCT()351351- #define EPL_MCO_DECL_INSTANCE_FCT()356356+#define EPL_MCO_DEFINE_INSTANCE_FCT()357357+#define EPL_MCO_DECL_INSTANCE_FCT()352358353359 // this macro defines the instance table. Each entry is reserved for an instance of CANopen.354354- #define EPL_MCO_DECL_INSTANCE_VAR()360360+#define EPL_MCO_DECL_INSTANCE_VAR()355361356362 // this macro defines member variables in instance table which are needed in357363 // all modules of CANopen stack358358- #define EPL_MCO_DECL_INSTANCE_MEMBER()364364+#define EPL_MCO_DECL_INSTANCE_MEMBER()359365360366#endif361361-362367363368/*364369#if (CDRV_MAX_INSTANCES > 1)···371378#endif372379*/373380374374-375381#endif // _EPLINSTDEF_H_376382377383// Die letzte Zeile mu� unbedingt eine leere Zeile sein, weil manche Compiler378384// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).379379-
···66666767 2006/06/09 k.t.: start of the implementation68686969-7069****************************************************************************/71707271#ifndef _EPLNMT_H_···7879//---------------------------------------------------------------------------79808081// define super-states and masks to identify a super-state8181-#define EPL_NMT_GS_POWERED 0x0008 // super state8282-#define EPL_NMT_GS_INITIALISATION 0x0009 // super state8383-#define EPL_NMT_GS_COMMUNICATING 0x000C // super state8484-#define EPL_NMT_CS_EPLMODE 0x000D // super state8585-#define EPL_NMT_MS_EPLMODE 0x000D // super state8282+#define EPL_NMT_GS_POWERED 0x0008 // super state8383+#define EPL_NMT_GS_INITIALISATION 0x0009 // super state8484+#define EPL_NMT_GS_COMMUNICATING 0x000C // super state8585+#define EPL_NMT_CS_EPLMODE 0x000D // super state8686+#define EPL_NMT_MS_EPLMODE 0x000D // super state86878787-#define EPL_NMT_SUPERSTATE_MASK 0x000F // mask to select state8888+#define EPL_NMT_SUPERSTATE_MASK 0x000F // mask to select state88898989-#define EPL_NMT_TYPE_UNDEFINED 0x0000 // type of NMT state is still undefined9090-#define EPL_NMT_TYPE_CS 0x0100 // CS type of NMT state9191-#define EPL_NMT_TYPE_MS 0x0200 // MS type of NMT state9292-#define EPL_NMT_TYPE_MASK 0x0300 // mask to select type of NMT state (i.e. CS or MS)9090+#define EPL_NMT_TYPE_UNDEFINED 0x0000 // type of NMT state is still undefined9191+#define EPL_NMT_TYPE_CS 0x0100 // CS type of NMT state9292+#define EPL_NMT_TYPE_MS 0x0200 // MS type of NMT state9393+#define EPL_NMT_TYPE_MASK 0x0300 // mask to select type of NMT state (i.e. CS or MS)93949495//---------------------------------------------------------------------------9596// typedef···105106// --> there are masks defined to indentify the106107// super-states107108108108-typedef enum109109-{110110- kEplNmtGsOff = 0x0000,111111- kEplNmtGsInitialising = 0x0019,112112- kEplNmtGsResetApplication = 0x0029,113113- kEplNmtGsResetCommunication = 0x0039,114114- kEplNmtGsResetConfiguration = 0x0079,115115- kEplNmtCsNotActive = 0x011C,116116- kEplNmtCsPreOperational1 = 0x011D,117117- kEplNmtCsStopped = 0x014D,118118- kEplNmtCsPreOperational2 = 0x015D,119119- kEplNmtCsReadyToOperate = 0x016D,120120- kEplNmtCsOperational = 0x01FD,121121- kEplNmtCsBasicEthernet = 0x011E,122122- kEplNmtMsNotActive = 0x021C,123123- kEplNmtMsPreOperational1 = 0x021D,124124- kEplNmtMsPreOperational2 = 0x025D,125125- kEplNmtMsReadyToOperate = 0x026D,126126- kEplNmtMsOperational = 0x02FD,127127- kEplNmtMsBasicEthernet = 0x021E128128-109109+typedef enum {110110+ kEplNmtGsOff = 0x0000,111111+ kEplNmtGsInitialising = 0x0019,112112+ kEplNmtGsResetApplication = 0x0029,113113+ kEplNmtGsResetCommunication = 0x0039,114114+ kEplNmtGsResetConfiguration = 0x0079,115115+ kEplNmtCsNotActive = 0x011C,116116+ kEplNmtCsPreOperational1 = 0x011D,117117+ kEplNmtCsStopped = 0x014D,118118+ kEplNmtCsPreOperational2 = 0x015D,119119+ kEplNmtCsReadyToOperate = 0x016D,120120+ kEplNmtCsOperational = 0x01FD,121121+ kEplNmtCsBasicEthernet = 0x011E,122122+ kEplNmtMsNotActive = 0x021C,123123+ kEplNmtMsPreOperational1 = 0x021D,124124+ kEplNmtMsPreOperational2 = 0x025D,125125+ kEplNmtMsReadyToOperate = 0x026D,126126+ kEplNmtMsOperational = 0x02FD,127127+ kEplNmtMsBasicEthernet = 0x021E129128} tEplNmtState;130129131130// NMT-events132132-typedef enum133133-{134134- // Events from DLL135135- // Events defined by EPL V2 specification136136- kEplNmtEventNoEvent = 0x00,131131+typedef enum {132132+ // Events from DLL133133+ // Events defined by EPL V2 specification134134+ kEplNmtEventNoEvent = 0x00,137135// kEplNmtEventDllMePres = 0x01,138138- kEplNmtEventDllMePresTimeout = 0x02,136136+ kEplNmtEventDllMePresTimeout = 0x02,139137// kEplNmtEventDllMeAsnd = 0x03,140138// kEplNmtEventDllMeAsndTimeout = 0x04,141141- kEplNmtEventDllMeSoaSent = 0x04,142142- kEplNmtEventDllMeSocTrig = 0x05,143143- kEplNmtEventDllMeSoaTrig = 0x06,144144- kEplNmtEventDllCeSoc = 0x07,145145- kEplNmtEventDllCePreq = 0x08,146146- kEplNmtEventDllCePres = 0x09,147147- kEplNmtEventDllCeSoa = 0x0A,148148- kEplNmtEventDllCeAsnd = 0x0B,149149- kEplNmtEventDllCeFrameTimeout = 0x0C,139139+ kEplNmtEventDllMeSoaSent = 0x04,140140+ kEplNmtEventDllMeSocTrig = 0x05,141141+ kEplNmtEventDllMeSoaTrig = 0x06,142142+ kEplNmtEventDllCeSoc = 0x07,143143+ kEplNmtEventDllCePreq = 0x08,144144+ kEplNmtEventDllCePres = 0x09,145145+ kEplNmtEventDllCeSoa = 0x0A,146146+ kEplNmtEventDllCeAsnd = 0x0B,147147+ kEplNmtEventDllCeFrameTimeout = 0x0C,150148151151- // Events triggered by NMT-Commands152152- kEplNmtEventSwReset = 0x10, // NMT_GT1, NMT_GT2, NMT_GT8153153- kEplNmtEventResetNode = 0x11,154154- kEplNmtEventResetCom = 0x12,155155- kEplNmtEventResetConfig = 0x13,156156- kEplNmtEventEnterPreOperational2= 0x14,157157- kEplNmtEventEnableReadyToOperate= 0x15,158158- kEplNmtEventStartNode = 0x16, // NMT_CT7159159- kEplNmtEventStopNode = 0x17,149149+ // Events triggered by NMT-Commands150150+ kEplNmtEventSwReset = 0x10, // NMT_GT1, NMT_GT2, NMT_GT8151151+ kEplNmtEventResetNode = 0x11,152152+ kEplNmtEventResetCom = 0x12,153153+ kEplNmtEventResetConfig = 0x13,154154+ kEplNmtEventEnterPreOperational2 = 0x14,155155+ kEplNmtEventEnableReadyToOperate = 0x15,156156+ kEplNmtEventStartNode = 0x16, // NMT_CT7157157+ kEplNmtEventStopNode = 0x17,160158161161- // Events triggered by higher layer162162- kEplNmtEventEnterResetApp = 0x20,163163- kEplNmtEventEnterResetCom = 0x21,164164- kEplNmtEventInternComError = 0x22, // NMT_GT6, internal communication error -> enter ResetCommunication165165- kEplNmtEventEnterResetConfig = 0x23,166166- kEplNmtEventEnterCsNotActive = 0x24,167167- kEplNmtEventEnterMsNotActive = 0x25,168168- kEplNmtEventTimerBasicEthernet = 0x26, // NMT_CT3; timer triggered state change (NotActive -> BasicEth)169169- kEplNmtEventTimerMsPreOp1 = 0x27, // enter PreOp1 on MN (NotActive -> MsPreOp1)170170- kEplNmtEventNmtCycleError = 0x28, // NMT_CT11, NMT_MT6; error during cycle -> enter PreOp1171171- kEplNmtEventTimerMsPreOp2 = 0x29, // enter PreOp2 on MN (MsPreOp1 -> MsPreOp2 if kEplNmtEventAllMandatoryCNIdent)172172- kEplNmtEventAllMandatoryCNIdent = 0x2A, // enter PreOp2 on MN if kEplNmtEventTimerMsPreOp2173173- kEplNmtEventEnterReadyToOperate = 0x2B, // application ready for the state ReadyToOp174174- kEplNmtEventEnterMsOperational = 0x2C, // enter Operational on MN175175- kEplNmtEventSwitchOff = 0x2D, // enter state Off176176- kEplNmtEventCriticalError = 0x2E, // enter state Off because of critical error159159+ // Events triggered by higher layer160160+ kEplNmtEventEnterResetApp = 0x20,161161+ kEplNmtEventEnterResetCom = 0x21,162162+ kEplNmtEventInternComError = 0x22, // NMT_GT6, internal communication error -> enter ResetCommunication163163+ kEplNmtEventEnterResetConfig = 0x23,164164+ kEplNmtEventEnterCsNotActive = 0x24,165165+ kEplNmtEventEnterMsNotActive = 0x25,166166+ kEplNmtEventTimerBasicEthernet = 0x26, // NMT_CT3; timer triggered state change (NotActive -> BasicEth)167167+ kEplNmtEventTimerMsPreOp1 = 0x27, // enter PreOp1 on MN (NotActive -> MsPreOp1)168168+ kEplNmtEventNmtCycleError = 0x28, // NMT_CT11, NMT_MT6; error during cycle -> enter PreOp1169169+ kEplNmtEventTimerMsPreOp2 = 0x29, // enter PreOp2 on MN (MsPreOp1 -> MsPreOp2 if kEplNmtEventAllMandatoryCNIdent)170170+ kEplNmtEventAllMandatoryCNIdent = 0x2A, // enter PreOp2 on MN if kEplNmtEventTimerMsPreOp2171171+ kEplNmtEventEnterReadyToOperate = 0x2B, // application ready for the state ReadyToOp172172+ kEplNmtEventEnterMsOperational = 0x2C, // enter Operational on MN173173+ kEplNmtEventSwitchOff = 0x2D, // enter state Off174174+ kEplNmtEventCriticalError = 0x2E, // enter state Off because of critical error177175178176} tEplNmtEvent;179177180180-181178// type for argument of event kEplEventTypeNmtStateChange182182-typedef struct183183-{184184- tEplNmtState m_NewNmtState;185185- tEplNmtEvent m_NmtEvent;179179+typedef struct {180180+ tEplNmtState m_NewNmtState;181181+ tEplNmtEvent m_NmtEvent;186182187183} tEplEventNmtStateChange;188184189189-190185// structure for kEplEventTypeHeartbeat191191-typedef struct192192-{193193- unsigned int m_uiNodeId; // NodeId194194- tEplNmtState m_NmtState; // NMT state (remember distinguish between MN / CN)195195- WORD m_wErrorCode; // EPL error code in case of NMT state NotActive186186+typedef struct {187187+ unsigned int m_uiNodeId; // NodeId188188+ tEplNmtState m_NmtState; // NMT state (remember distinguish between MN / CN)189189+ WORD m_wErrorCode; // EPL error code in case of NMT state NotActive196190197191} tEplHeartbeatEvent;198192199199-200200-typedef enum201201-{202202- kEplNmtNodeEventFound = 0x00,203203- kEplNmtNodeEventUpdateSw = 0x01, // application shall update software on CN204204- kEplNmtNodeEventCheckConf = 0x02, // application / Configuration Manager shall check and update configuration on CN205205- kEplNmtNodeEventUpdateConf = 0x03, // application / Configuration Manager shall update configuration on CN (check was done by NmtMn module)206206- kEplNmtNodeEventVerifyConf = 0x04, // application / Configuration Manager shall verify configuration of CN207207- kEplNmtNodeEventReadyToStart= 0x05, // issued if EPL_NMTST_NO_STARTNODE set208208- // application must call EplNmtMnuSendNmtCommand(kEplNmtCmdStartNode) manually209209- kEplNmtNodeEventNmtState = 0x06,210210- kEplNmtNodeEventError = 0x07, // NMT error of CN193193+typedef enum {194194+ kEplNmtNodeEventFound = 0x00,195195+ kEplNmtNodeEventUpdateSw = 0x01, // application shall update software on CN196196+ kEplNmtNodeEventCheckConf = 0x02, // application / Configuration Manager shall check and update configuration on CN197197+ kEplNmtNodeEventUpdateConf = 0x03, // application / Configuration Manager shall update configuration on CN (check was done by NmtMn module)198198+ kEplNmtNodeEventVerifyConf = 0x04, // application / Configuration Manager shall verify configuration of CN199199+ kEplNmtNodeEventReadyToStart = 0x05, // issued if EPL_NMTST_NO_STARTNODE set200200+ // application must call EplNmtMnuSendNmtCommand(kEplNmtCmdStartNode) manually201201+ kEplNmtNodeEventNmtState = 0x06,202202+ kEplNmtNodeEventError = 0x07, // NMT error of CN211203212204} tEplNmtNodeEvent;213205214214-215215-typedef enum216216-{217217- kEplNmtNodeCommandBoot = 0x01, // if EPL_NODEASSIGN_START_CN not set it must be issued after kEplNmtNodeEventFound218218- kEplNmtNodeCommandSwOk = 0x02, // application updated software on CN successfully219219- kEplNmtNodeCommandSwUpdated = 0x03, // application updated software on CN successfully220220- kEplNmtNodeCommandConfOk = 0x04, // application / Configuration Manager has updated configuration on CN successfully221221- kEplNmtNodeCommandConfReset = 0x05, // application / Configuration Manager has updated configuration on CN successfully222222- // and CN needs ResetConf so that the configuration gets actived223223- kEplNmtNodeCommandConfErr = 0x06, // application / Configuration Manager failed on updating configuration on CN224224- kEplNmtNodeCommandStart = 0x07, // if EPL_NMTST_NO_STARTNODE set it must be issued after kEplNmtNodeEventReadyToStart206206+typedef enum {207207+ kEplNmtNodeCommandBoot = 0x01, // if EPL_NODEASSIGN_START_CN not set it must be issued after kEplNmtNodeEventFound208208+ kEplNmtNodeCommandSwOk = 0x02, // application updated software on CN successfully209209+ kEplNmtNodeCommandSwUpdated = 0x03, // application updated software on CN successfully210210+ kEplNmtNodeCommandConfOk = 0x04, // application / Configuration Manager has updated configuration on CN successfully211211+ kEplNmtNodeCommandConfReset = 0x05, // application / Configuration Manager has updated configuration on CN successfully212212+ // and CN needs ResetConf so that the configuration gets actived213213+ kEplNmtNodeCommandConfErr = 0x06, // application / Configuration Manager failed on updating configuration on CN214214+ kEplNmtNodeCommandStart = 0x07, // if EPL_NMTST_NO_STARTNODE set it must be issued after kEplNmtNodeEventReadyToStart225215226216} tEplNmtNodeCommand;227217228228-229229-typedef enum230230-{231231- kEplNmtBootEventBootStep1Finish = 0x00, // PreOp2 is possible232232- kEplNmtBootEventBootStep2Finish = 0x01, // ReadyToOp is possible233233- kEplNmtBootEventCheckComFinish = 0x02, // Operational is possible234234- kEplNmtBootEventOperational = 0x03, // all mandatory CNs are Operational235235- kEplNmtBootEventError = 0x04, // boot process halted because of an error218218+typedef enum {219219+ kEplNmtBootEventBootStep1Finish = 0x00, // PreOp2 is possible220220+ kEplNmtBootEventBootStep2Finish = 0x01, // ReadyToOp is possible221221+ kEplNmtBootEventCheckComFinish = 0x02, // Operational is possible222222+ kEplNmtBootEventOperational = 0x03, // all mandatory CNs are Operational223223+ kEplNmtBootEventError = 0x04, // boot process halted because of an error236224237225} tEplNmtBootEvent;238238-239226240227//---------------------------------------------------------------------------241228// function prototypes242229//---------------------------------------------------------------------------243230244244-245245-#endif // #ifndef _EPLNMT_H_246246-247247-231231+#endif // #ifndef _EPLNMT_H_
+181-221
drivers/staging/epl/EplObd.h
···66666767 2006/06/02 k.t.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#include "EplInc.h"73727473#ifndef _EPLOBD_H_7574#define _EPLOBD_H_7676-77757876// ============================================================================7977// defines···9597// ============================================================================96989799// directions for access to object dictionary9898-typedef enum9999-{100100- kEplObdDirInit = 0x00, // initialising after power on101101- kEplObdDirStore = 0x01, // store all object values to non volatile memory102102- kEplObdDirLoad = 0x02, // load all object values from non volatile memory103103- kEplObdDirRestore = 0x03, // deletes non volatile memory (restore)104104- kEplObdDirOBKCheck = 0xFF // reserved105105-106106-}tEplObdDir;100100+typedef enum {101101+ kEplObdDirInit = 0x00, // initialising after power on102102+ kEplObdDirStore = 0x01, // store all object values to non volatile memory103103+ kEplObdDirLoad = 0x02, // load all object values from non volatile memory104104+ kEplObdDirRestore = 0x03, // deletes non volatile memory (restore)105105+ kEplObdDirOBKCheck = 0xFF // reserved106106+} tEplObdDir;107107108108// commands for store109109-typedef enum110110-{111111- kEplObdCommNothing = 0x00,112112- kEplObdCommOpenWrite = 0x01,113113- kEplObdCommWriteObj = 0x02,114114- kEplObdCommCloseWrite = 0x03,115115- kEplObdCommOpenRead = 0x04,116116- kEplObdCommReadObj = 0x05,117117- kEplObdCommCloseRead = 0x06,118118- kEplObdCommClear = 0x07,119119- kEplObdCommUnknown = 0xFF120120-}tEplObdCommand;109109+typedef enum {110110+ kEplObdCommNothing = 0x00,111111+ kEplObdCommOpenWrite = 0x01,112112+ kEplObdCommWriteObj = 0x02,113113+ kEplObdCommCloseWrite = 0x03,114114+ kEplObdCommOpenRead = 0x04,115115+ kEplObdCommReadObj = 0x05,116116+ kEplObdCommCloseRead = 0x06,117117+ kEplObdCommClear = 0x07,118118+ kEplObdCommUnknown = 0xFF119119+} tEplObdCommand;121120122121//-----------------------------------------------------------------------------------------------------------123122// events of object callback function124124-typedef enum125125-{123123+typedef enum {126124// m_pArg points to127125// ---------------------128128- kEplObdEvCheckExist = 0x06, // checking if object does exist (reading and writing) NULL129129- kEplObdEvPreRead = 0x00, // before reading an object source data buffer in OD130130- kEplObdEvPostRead = 0x01, // after reading an object destination data buffer from caller131131- kEplObdEvWrStringDomain = 0x07, // event for changing string/domain data pointer or size struct tEplObdVStringDomain in RAM132132- kEplObdEvInitWrite = 0x04, // initializes writing an object (checking object size) size of object in OD (tEplObdSize)133133- kEplObdEvPreWrite = 0x02, // before writing an object source data buffer from caller134134- kEplObdEvPostWrite = 0x03, // after writing an object destination data buffer in OD126126+ kEplObdEvCheckExist = 0x06, // checking if object does exist (reading and writing) NULL127127+ kEplObdEvPreRead = 0x00, // before reading an object source data buffer in OD128128+ kEplObdEvPostRead = 0x01, // after reading an object destination data buffer from caller129129+ kEplObdEvWrStringDomain = 0x07, // event for changing string/domain data pointer or size struct tEplObdVStringDomain in RAM130130+ kEplObdEvInitWrite = 0x04, // initializes writing an object (checking object size) size of object in OD (tEplObdSize)131131+ kEplObdEvPreWrite = 0x02, // before writing an object source data buffer from caller132132+ kEplObdEvPostWrite = 0x03, // after writing an object destination data buffer in OD135133// kEplObdEvAbortSdo = 0x05 // after an abort of an SDO transfer136134137135} tEplObdEvent;···135141// part of OD (bit oriented)136142typedef unsigned int tEplObdPart;137143138138-#define kEplObdPartNo 0x00 // nothing139139-#define kEplObdPartGen 0x01 // part (0x1000 - 0x1FFF)140140-#define kEplObdPartMan 0x02 // manufacturer part (0x2000 - 0x5FFF)141141-#define kEplObdPartDev 0x04 // device part (0x6000 - 0x9FFF)142142-#define kEplObdPartUsr 0x08 // dynamic part e.g. for ICE61131-3144144+#define kEplObdPartNo 0x00 // nothing145145+#define kEplObdPartGen 0x01 // part (0x1000 - 0x1FFF)146146+#define kEplObdPartMan 0x02 // manufacturer part (0x2000 - 0x5FFF)147147+#define kEplObdPartDev 0x04 // device part (0x6000 - 0x9FFF)148148+#define kEplObdPartUsr 0x08 // dynamic part e.g. for ICE61131-3143149144150// combinations145145-#define kEplObdPartApp ( kEplObdPartMan | kEplObdPartDev | kEplObdPartUsr) // manufacturer and device part (0x2000 - 0x9FFF) and user OD146146-#define kEplObdPartAll (kEplObdPartGen | kEplObdPartMan | kEplObdPartDev | kEplObdPartUsr) // whole OD151151+#define kEplObdPartApp ( kEplObdPartMan | kEplObdPartDev | kEplObdPartUsr) // manufacturer and device part (0x2000 - 0x9FFF) and user OD152152+#define kEplObdPartAll (kEplObdPartGen | kEplObdPartMan | kEplObdPartDev | kEplObdPartUsr) // whole OD147153148154//-----------------------------------------------------------------------------------------------------------149155// access types for objects150156// must be a difine because bit-flags151157typedef unsigned int tEplObdAccess;152158153153-#define kEplObdAccRead 0x01 // object can be read154154-#define kEplObdAccWrite 0x02 // object can be written155155-#define kEplObdAccConst 0x04 // object contains a constant value156156-#define kEplObdAccPdo 0x08 // object can be mapped in a PDO157157-#define kEplObdAccArray 0x10 // object contains an array of numerical values158158-#define kEplObdAccRange 0x20 // object contains lower and upper limit159159-#define kEplObdAccVar 0x40 // object data is placed in application160160-#define kEplObdAccStore 0x80 // object data can be stored to non volatile memory159159+#define kEplObdAccRead 0x01 // object can be read160160+#define kEplObdAccWrite 0x02 // object can be written161161+#define kEplObdAccConst 0x04 // object contains a constant value162162+#define kEplObdAccPdo 0x08 // object can be mapped in a PDO163163+#define kEplObdAccArray 0x10 // object contains an array of numerical values164164+#define kEplObdAccRange 0x20 // object contains lower and upper limit165165+#define kEplObdAccVar 0x40 // object data is placed in application166166+#define kEplObdAccStore 0x80 // object data can be stored to non volatile memory161167162168// combinations (not all combinations are required)163169#define kEplObdAccR (0 | 0 | 0 | 0 | 0 | 0 | kEplObdAccRead)···199205#define kEplObdAccSVGPW (kEplObdAccStore | kEplObdAccVar | kEplObdAccRange | kEplObdAccPdo | 0 | kEplObdAccWrite | 0 )200206#define kEplObdAccSVGPRW (kEplObdAccStore | kEplObdAccVar | kEplObdAccRange | kEplObdAccPdo | 0 | kEplObdAccWrite | kEplObdAccRead)201207202202-203203-204204-typedef unsigned int tEplObdSize; // For all objects as objects size are used an unsigned int.205205-208208+typedef unsigned int tEplObdSize; // For all objects as objects size are used an unsigned int.206209207210// -------------------------------------------------------------------------208211// types for data types defined in DS301···207216208217// types of objects in object dictionary209218// DS-301 defines these types as WORD210210-typedef enum211211-{219219+typedef enum {212220// types which are always supported213213- kEplObdTypBool = 0x0001,221221+ kEplObdTypBool = 0x0001,214222215215- kEplObdTypInt8 = 0x0002,216216- kEplObdTypInt16 = 0x0003,217217- kEplObdTypInt32 = 0x0004,218218- kEplObdTypUInt8 = 0x0005,219219- kEplObdTypUInt16 = 0x0006,220220- kEplObdTypUInt32 = 0x0007,221221- kEplObdTypReal32 = 0x0008,222222- kEplObdTypVString = 0x0009,223223- kEplObdTypOString = 0x000A,224224- kEplObdTypDomain = 0x000F,223223+ kEplObdTypInt8 = 0x0002,224224+ kEplObdTypInt16 = 0x0003,225225+ kEplObdTypInt32 = 0x0004,226226+ kEplObdTypUInt8 = 0x0005,227227+ kEplObdTypUInt16 = 0x0006,228228+ kEplObdTypUInt32 = 0x0007,229229+ kEplObdTypReal32 = 0x0008,230230+ kEplObdTypVString = 0x0009,231231+ kEplObdTypOString = 0x000A,232232+ kEplObdTypDomain = 0x000F,225233226226- kEplObdTypInt24 = 0x0010,227227- kEplObdTypUInt24 = 0x0016,234234+ kEplObdTypInt24 = 0x0010,235235+ kEplObdTypUInt24 = 0x0016,228236229229- kEplObdTypReal64 = 0x0011,230230- kEplObdTypInt40 = 0x0012,231231- kEplObdTypInt48 = 0x0013,232232- kEplObdTypInt56 = 0x0014,233233- kEplObdTypInt64 = 0x0015,234234- kEplObdTypUInt40 = 0x0018,235235- kEplObdTypUInt48 = 0x0019,236236- kEplObdTypUInt56 = 0x001A,237237- kEplObdTypUInt64 = 0x001B,238238- kEplObdTypTimeOfDay = 0x000C,239239- kEplObdTypTimeDiff = 0x000D240240-241241-}tEplObdType;237237+ kEplObdTypReal64 = 0x0011,238238+ kEplObdTypInt40 = 0x0012,239239+ kEplObdTypInt48 = 0x0013,240240+ kEplObdTypInt56 = 0x0014,241241+ kEplObdTypInt64 = 0x0015,242242+ kEplObdTypUInt40 = 0x0018,243243+ kEplObdTypUInt48 = 0x0019,244244+ kEplObdTypUInt56 = 0x001A,245245+ kEplObdTypUInt64 = 0x001B,246246+ kEplObdTypTimeOfDay = 0x000C,247247+ kEplObdTypTimeDiff = 0x000D248248+} tEplObdType;242249// other types are not supported in this version243243-244250245251// -------------------------------------------------------------------------246252// types for data types defined in DS301247253// -------------------------------------------------------------------------248254249249-typedef unsigned char tEplObdBoolean; // 0001250250-typedef signed char tEplObdInteger8; // 0002251251-typedef signed short int tEplObdInteger16; // 0003252252-typedef signed long tEplObdInteger32; // 0004253253-typedef unsigned char tEplObdUnsigned8; // 0005254254-typedef unsigned short int tEplObdUnsigned16; // 0006255255-typedef unsigned long tEplObdUnsigned32; // 0007256256-typedef float tEplObdReal32; // 0008257257-typedef unsigned char tEplObdDomain; // 000F258258-typedef signed long tEplObdInteger24; // 0010259259-typedef unsigned long tEplObdUnsigned24; // 0016255255+typedef unsigned char tEplObdBoolean; // 0001256256+typedef signed char tEplObdInteger8; // 0002257257+typedef signed short int tEplObdInteger16; // 0003258258+typedef signed long tEplObdInteger32; // 0004259259+typedef unsigned char tEplObdUnsigned8; // 0005260260+typedef unsigned short int tEplObdUnsigned16; // 0006261261+typedef unsigned long tEplObdUnsigned32; // 0007262262+typedef float tEplObdReal32; // 0008263263+typedef unsigned char tEplObdDomain; // 000F264264+typedef signed long tEplObdInteger24; // 0010265265+typedef unsigned long tEplObdUnsigned24; // 0016260266261261-typedef signed QWORD tEplObdInteger40; // 0012262262-typedef signed QWORD tEplObdInteger48; // 0013263263-typedef signed QWORD tEplObdInteger56; // 0014264264-typedef signed QWORD tEplObdInteger64; // 0015267267+typedef signed QWORD tEplObdInteger40; // 0012268268+typedef signed QWORD tEplObdInteger48; // 0013269269+typedef signed QWORD tEplObdInteger56; // 0014270270+typedef signed QWORD tEplObdInteger64; // 0015265271266266-typedef unsigned QWORD tEplObdUnsigned40; // 0018267267-typedef unsigned QWORD tEplObdUnsigned48; // 0019268268-typedef unsigned QWORD tEplObdUnsigned56; // 001A269269-typedef unsigned QWORD tEplObdUnsigned64; // 001B272272+typedef unsigned QWORD tEplObdUnsigned40; // 0018273273+typedef unsigned QWORD tEplObdUnsigned48; // 0019274274+typedef unsigned QWORD tEplObdUnsigned56; // 001A275275+typedef unsigned QWORD tEplObdUnsigned64; // 001B270276271271-typedef double tEplObdReal64; // 0011277277+typedef double tEplObdReal64; // 0011272278273273-typedef tTimeOfDay tEplObdTimeOfDay; // 000C274274-typedef tTimeOfDay tEplObdTimeDifference; // 000D275275-279279+typedef tTimeOfDay tEplObdTimeOfDay; // 000C280280+typedef tTimeOfDay tEplObdTimeDifference; // 000D276281277282// -------------------------------------------------------------------------278283// structur for defining a variable279284// -------------------------------------------------------------------------280285// -------------------------------------------------------------------------281281-typedef enum282282-{283283- kVarValidSize = 0x01,284284- kVarValidData = 0x02,286286+typedef enum {287287+ kVarValidSize = 0x01,288288+ kVarValidData = 0x02,285289// kVarValidCallback = 0x04,286290// kVarValidArg = 0x08,287291288288- kVarValidAll = 0x03 // currently only size and data are implemented and used292292+ kVarValidAll = 0x03 // currently only size and data are implemented and used293293+} tEplVarParamValid;289294290290-}tEplVarParamValid;295295+typedef tEplKernel(PUBLIC ROM * tEplVarCallback) (CCM_DECL_INSTANCE_HDL_296296+ void *pParam_p);291297292292-293293-typedef tEplKernel (PUBLIC ROM* tEplVarCallback) (CCM_DECL_INSTANCE_HDL_294294- void * pParam_p);295295-296296-typedef struct297297-{298298- tEplVarParamValid m_ValidFlag;299299- unsigned int m_uiIndex;300300- unsigned int m_uiSubindex;301301- tEplObdSize m_Size;302302- void MEM* m_pData;298298+typedef struct {299299+ tEplVarParamValid m_ValidFlag;300300+ unsigned int m_uiIndex;301301+ unsigned int m_uiSubindex;302302+ tEplObdSize m_Size;303303+ void MEM *m_pData;303304// tEplVarCallback m_fpCallback;304305// void * m_pArg;305306306307} tEplVarParam;307308308308-typedef struct309309-{310310- void MEM* m_pData;311311- tEplObdSize m_Size;309309+typedef struct {310310+ void MEM *m_pData;311311+ tEplObdSize m_Size;312312/*313313 #if (EPL_PDO_USE_STATIC_MAPPING == FALSE)314314 tEplVarCallback m_fpCallback;···308326*/309327} tEplObdVarEntry;310328311311-typedef struct312312-{313313- tEplObdSize m_Size;314314- BYTE * m_pString;329329+typedef struct {330330+ tEplObdSize m_Size;331331+ BYTE *m_pString;315332316316-} tEplObdOString; // 000C333333+} tEplObdOString; // 000C317334318318-typedef struct319319-{320320- tEplObdSize m_Size;321321- char * m_pString;322322-} tEplObdVString; // 000D335335+typedef struct {336336+ tEplObdSize m_Size;337337+ char *m_pString;338338+} tEplObdVString; // 000D323339324324-325325-typedef struct326326-{327327- tEplObdSize m_Size;328328- char * m_pDefString; // $$$ d.k. it is unused, so we could delete it329329- char * m_pString;340340+typedef struct {341341+ tEplObdSize m_Size;342342+ char *m_pDefString; // $$$ d.k. it is unused, so we could delete it343343+ char *m_pString;330344331345} tEplObdVStringDef;332346333333-typedef struct334334-{335335- tEplObdSize m_Size;336336- BYTE * m_pDefString; // $$$ d.k. it is unused, so we could delete it337337- BYTE * m_pString;347347+typedef struct {348348+ tEplObdSize m_Size;349349+ BYTE *m_pDefString; // $$$ d.k. it is unused, so we could delete it350350+ BYTE *m_pString;338351339352} tEplObdOStringDef;340353341354//r.d. parameter struct for changing object size and/or pointer to data of Strings or Domains342342-typedef struct343343-{344344- tEplObdSize m_DownloadSize; // download size from SDO or APP345345- tEplObdSize m_ObjSize; // current object size from OD - should be changed from callback function346346- void * m_pData; // current object ptr from OD - should be changed from callback function355355+typedef struct {356356+ tEplObdSize m_DownloadSize; // download size from SDO or APP357357+ tEplObdSize m_ObjSize; // current object size from OD - should be changed from callback function358358+ void *m_pData; // current object ptr from OD - should be changed from callback function347359348348-} tEplObdVStringDomain; // 000D349349-360360+} tEplObdVStringDomain; // 000D350361351362// ============================================================================352363// types···349374// -------------------------------------------------------------------------350375351376// Change not the order for this struct!!!352352-typedef struct353353-{354354- unsigned int m_uiSubIndex;355355- tEplObdType m_Type;356356- tEplObdAccess m_Access;357357- void * m_pDefault;358358- void MEM* m_pCurrent; // points always to RAM377377+typedef struct {378378+ unsigned int m_uiSubIndex;379379+ tEplObdType m_Type;380380+ tEplObdAccess m_Access;381381+ void *m_pDefault;382382+ void MEM *m_pCurrent; // points always to RAM359383360384} tEplObdSubEntry;361385362386// r.d.: has always to be because new OBD-Macros for arrays363363-typedef tEplObdSubEntry * tEplObdSubEntryPtr;387387+typedef tEplObdSubEntry *tEplObdSubEntryPtr;364388365389// -------------------------------------------------------------------------366390// callback function for objdictionary modul367391// -------------------------------------------------------------------------368392369393// parameters for callback function370370-typedef struct371371-{372372- tEplObdEvent m_ObdEvent;373373- unsigned int m_uiIndex;374374- unsigned int m_uiSubIndex;375375- void * m_pArg;376376- DWORD m_dwAbortCode;394394+typedef struct {395395+ tEplObdEvent m_ObdEvent;396396+ unsigned int m_uiIndex;397397+ unsigned int m_uiSubIndex;398398+ void *m_pArg;399399+ DWORD m_dwAbortCode;377400378401} tEplObdCbParam;379402380403// define type for callback function: pParam_p points to tEplObdCbParam381381-typedef tEplKernel (PUBLIC ROM* tEplObdCallback) (CCM_DECL_INSTANCE_HDL_382382- tEplObdCbParam MEM* pParam_p);404404+typedef tEplKernel(PUBLIC ROM * tEplObdCallback) (CCM_DECL_INSTANCE_HDL_405405+ tEplObdCbParam MEM *406406+ pParam_p);383407384408// do not change the order for this struct!!!385409386386-typedef struct387387-{388388- unsigned int m_uiIndex;389389- tEplObdSubEntryPtr m_pSubIndex;390390- unsigned int m_uiCount;391391- tEplObdCallback m_fpCallback; // function is called back if object access410410+typedef struct {411411+ unsigned int m_uiIndex;412412+ tEplObdSubEntryPtr m_pSubIndex;413413+ unsigned int m_uiCount;414414+ tEplObdCallback m_fpCallback; // function is called back if object access392415393416} tEplObdEntry;394417395395-396418// allways pointer397397-typedef tEplObdEntry * tEplObdEntryPtr;398398-399399-419419+typedef tEplObdEntry *tEplObdEntryPtr;400420401421// -------------------------------------------------------------------------402422// structur to initialize OBD module403423// -------------------------------------------------------------------------404424405405-typedef struct406406-{407407- tEplObdEntryPtr m_pPart;408408- tEplObdEntryPtr m_pManufacturerPart;409409- tEplObdEntryPtr m_pDevicePart;425425+typedef struct {426426+ tEplObdEntryPtr m_pPart;427427+ tEplObdEntryPtr m_pManufacturerPart;428428+ tEplObdEntryPtr m_pDevicePart;410429411411- #if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE))430430+#if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE))412431413413- tEplObdEntryPtr m_pUserPart;432432+ tEplObdEntryPtr m_pUserPart;414433415415- #endif434434+#endif416435417436} tEplObdInitParam;418418-419437420438// -------------------------------------------------------------------------421439// structur for parameters of STORE RESTORE command422440// -------------------------------------------------------------------------423441424424-typedef struct425425-{426426- tEplObdCommand m_bCommand;427427- tEplObdPart m_bCurrentOdPart;428428- void MEM* m_pData;429429- tEplObdSize m_ObjSize;442442+typedef struct {443443+ tEplObdCommand m_bCommand;444444+ tEplObdPart m_bCurrentOdPart;445445+ void MEM *m_pData;446446+ tEplObdSize m_ObjSize;430447431448} tEplObdCbStoreParam;432449450450+typedef tEplKernel(PUBLIC ROM * tInitTabEntryCallback) (void MEM * pTabEntry_p,451451+ unsigned int452452+ uiObjIndex_p);433453434434-typedef tEplKernel (PUBLIC ROM* tInitTabEntryCallback) (435435- void MEM* pTabEntry_p,436436- unsigned int uiObjIndex_p);437437-438438-typedef tEplKernel (PUBLIC ROM* tEplObdStoreLoadObjCallback) (CCM_DECL_INSTANCE_HDL_439439- tEplObdCbStoreParam MEM* pCbStoreParam_p);454454+typedef tEplKernel(PUBLIC ROM *455455+ tEplObdStoreLoadObjCallback) (CCM_DECL_INSTANCE_HDL_456456+ tEplObdCbStoreParam MEM *457457+ pCbStoreParam_p);440458441459// -------------------------------------------------------------------------442460// this stucture is used for parameters for function ObdInitModuleTab()443461// -------------------------------------------------------------------------444444-typedef struct445445-{446446- unsigned int m_uiLowerObjIndex; // lower limit of ObjIndex447447- unsigned int m_uiUpperObjIndex; // upper limit of ObjIndex448448- tInitTabEntryCallback m_fpInitTabEntry; // will be called if ObjIndex was found449449- void MEM* m_pTabBase; // base address of table450450- unsigned int m_uiEntrySize; // size of table entry // 25-feb-2005 r.d.: expansion from BYTE to WORD necessary for PDO bit mapping451451- unsigned int m_uiMaxEntries; // max. tabel entries462462+typedef struct {463463+ unsigned int m_uiLowerObjIndex; // lower limit of ObjIndex464464+ unsigned int m_uiUpperObjIndex; // upper limit of ObjIndex465465+ tInitTabEntryCallback m_fpInitTabEntry; // will be called if ObjIndex was found466466+ void MEM *m_pTabBase; // base address of table467467+ unsigned int m_uiEntrySize; // size of table entry // 25-feb-2005 r.d.: expansion from BYTE to WORD necessary for PDO bit mapping468468+ unsigned int m_uiMaxEntries; // max. tabel entries452469453470} tEplObdModulTabParam;454471455472//-------------------------------------------------------------------456473// enum for function EplObdSetNodeId457474//-------------------------------------------------------------------458458-typedef enum459459-{460460- kEplObdNodeIdUnknown = 0x00, // unknown how the node id was set461461- kEplObdNodeIdSoftware = 0x01, // node id set by software462462- kEplObdNodeIdHardware = 0x02 // node id set by hardware463463-464464-}tEplObdNodeIdType;475475+typedef enum {476476+ kEplObdNodeIdUnknown = 0x00, // unknown how the node id was set477477+ kEplObdNodeIdSoftware = 0x01, // node id set by software478478+ kEplObdNodeIdHardware = 0x02 // node id set by hardware479479+} tEplObdNodeIdType;465480466481// ============================================================================467482// global variables468483// ============================================================================469484470470-471471-472485// ============================================================================473486// public functions474487// ============================================================================475488476476-477477-#endif // #ifndef _EPLOBD_H_478478-479479-489489+#endif // #ifndef _EPLOBD_H_
···7171#ifndef _EPLOBJDEF_H_7272#define _EPLOBJDEF_H_73737474-7574//---------------------------------------------------------------------------7675// security checks7776//---------------------------------------------------------------------------7878-79778078//---------------------------------------------------------------------------8179// macros to help building OD8280//---------------------------------------------------------------------------83818484-8582//---------------------------------------------------------------------------8683#if (defined (EPL_OBD_USE_VARIABLE_SUBINDEX_TAB) && (EPL_OBD_USE_VARIABLE_SUBINDEX_TAB != FALSE))87848888- #define CCM_SUBINDEX_RAM_ONLY(a) a;8989- #define CCM_SUBINDEX_RAM_ONEOF(a,b) a8585+#define CCM_SUBINDEX_RAM_ONLY(a) a;8686+#define CCM_SUBINDEX_RAM_ONEOF(a,b) a90879188#else92899393- #define CCM_SUBINDEX_RAM_ONLY(a)9494- #define CCM_SUBINDEX_RAM_ONEOF(a,b) b9090+#define CCM_SUBINDEX_RAM_ONLY(a)9191+#define CCM_SUBINDEX_RAM_ONEOF(a,b) b95929693#endif9797-98949995//---------------------------------------------------------------------------10096// To prevent unused memory in subindex tables we need this macro.···98102// Compilers which does not support a comma after last struct value has to place in a dummy subindex.99103#if ((DEV_SYSTEM & _DEV_COMMA_EXT_) != 0)100104101101- #define EPL_OBD_END_SUBINDEX()102102- #define EPL_OBD_MAX_ARRAY_SUBENTRIES 2105105+#define EPL_OBD_END_SUBINDEX()106106+#define EPL_OBD_MAX_ARRAY_SUBENTRIES 2103107104108#else105109106106- #define EPL_OBD_END_SUBINDEX() {0,0,0,NULL,NULL}107107- #define EPL_OBD_MAX_ARRAY_SUBENTRIES 3110110+#define EPL_OBD_END_SUBINDEX() {0,0,0,NULL,NULL}111111+#define EPL_OBD_MAX_ARRAY_SUBENTRIES 3108112109113#endif110110-111114112115//---------------------------------------------------------------------------113116//---------------------------------------------------------------------------···118123// creation of data in ROM memory119124// -------------------------------------------------------------------------120125#define EPL_OBD_CREATE_ROM_DATA121121- #include "objdict.h"126126+#include "objdict.h"122127#undef EPL_OBD_CREATE_ROM_DATA123123-124128125129// -------------------------------------------------------------------------126130// creation of data in RAM memory127131// -------------------------------------------------------------------------128132129133#define EPL_OBD_CREATE_RAM_DATA130130- #include "objdict.h"134134+#include "objdict.h"131135#undef EPL_OBD_CREATE_RAM_DATA132132-133136134137// -------------------------------------------------------------------------135138// creation of subindex tables in ROM and RAM136139// -------------------------------------------------------------------------137140138141#define EPL_OBD_CREATE_SUBINDEX_TAB139139- #include "objdict.h"142142+#include "objdict.h"140143#undef EPL_OBD_CREATE_SUBINDEX_TAB141141-142144143145// -------------------------------------------------------------------------144146// creation of index tables for generic, manufacturer and device part145147// -------------------------------------------------------------------------146148147149#define EPL_OBD_CREATE_INDEX_TAB148148- #include "objdict.h"150150+#include "objdict.h"149151#undef EPL_OBD_CREATE_INDEX_TAB150150-151152152153//=========================================================================//153154// //···165174//166175// ----------------------------------------------------------------------------167176168168-EPLDLLEXPORT tEplKernel PUBLIC EPL_OBD_INIT_RAM_NAME (tEplObdInitParam MEM* pInitParam_p)177177+EPLDLLEXPORT tEplKernel PUBLIC EPL_OBD_INIT_RAM_NAME(tEplObdInitParam MEM *178178+ pInitParam_p)169179{170180171171-tEplObdInitParam MEM* pInitParam = pInitParam_p;181181+ tEplObdInitParam MEM *pInitParam = pInitParam_p;172182173173- // check if pointer to parameter structure is valid174174- // if not then only copy subindex tables below175175- if (pInitParam != NULL)176176- {177177- // at first delete all parameters (all pointers will be set zu NULL)178178- EPL_MEMSET (pInitParam, 0, sizeof (tEplObdInitParam));183183+ // check if pointer to parameter structure is valid184184+ // if not then only copy subindex tables below185185+ if (pInitParam != NULL) {186186+ // at first delete all parameters (all pointers will be set zu NULL)187187+ EPL_MEMSET(pInitParam, 0, sizeof(tEplObdInitParam));179188180180- #define EPL_OBD_CREATE_INIT_FUNCTION181181- {182182- // inserts code to init pointer to index tables183183- #include "objdict.h"184184- }185185- #undef EPL_OBD_CREATE_INIT_FUNCTION189189+#define EPL_OBD_CREATE_INIT_FUNCTION190190+ {191191+ // inserts code to init pointer to index tables192192+#include "objdict.h"193193+ }194194+#undef EPL_OBD_CREATE_INIT_FUNCTION186195187187- #if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE))188188- {189189- // to begin no user OD is defined190190- pInitParam_p->m_pUserPart = NULL;191191- }192192- #endif193193- }196196+#if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE))197197+ {198198+ // to begin no user OD is defined199199+ pInitParam_p->m_pUserPart = NULL;200200+ }201201+#endif202202+ }203203+#define EPL_OBD_CREATE_INIT_SUBINDEX204204+ {205205+ // inserts code to copy subindex tables206206+#include "objdict.h"207207+ }208208+#undef EPL_OBD_CREATE_INIT_SUBINDEX194209195195- #define EPL_OBD_CREATE_INIT_SUBINDEX196196- {197197- // inserts code to copy subindex tables198198- #include "objdict.h"199199- }200200- #undef EPL_OBD_CREATE_INIT_SUBINDEX201201-202202- return kEplSuccessful;210210+ return kEplSuccessful;203211204212}205205-206213207214#endif // _EPLOBJDEF_H_208215209216// Die letzte Zeile mu� unbedingt eine leere Zeile sein, weil manche Compiler210217// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).211211-
+16-25
drivers/staging/epl/EplPdo.h
···66666767 2006/05/22 d.k.: start of the implementation, version 1.0068686969-7069****************************************************************************/71707271#ifndef _EPL_PDO_H_···8485// NodeId for PRes TPDO8586#define EPL_PDO_PRES_NODE_ID 0x0086878787-8888//---------------------------------------------------------------------------8989// typedef9090//---------------------------------------------------------------------------91919292-typedef struct9393-{9494- void* m_pVar;9595- WORD m_wOffset; // in Bits9696- WORD m_wSize; // in Bits9797- BOOL m_fNumeric; // numeric value -> use AMI functions9292+typedef struct {9393+ void *m_pVar;9494+ WORD m_wOffset; // in Bits9595+ WORD m_wSize; // in Bits9696+ BOOL m_fNumeric; // numeric value -> use AMI functions98979998} tEplPdoMapping;10099101101-typedef struct102102-{103103- unsigned int m_uiSizeOfStruct;104104- unsigned int m_uiPdoId;105105- unsigned int m_uiNodeId;106106- // 0xFF=invalid, RPDO: 0x00=PReq, localNodeId=PRes, remoteNodeId=PRes107107- // TPDO: 0x00=PRes, MN: CnNodeId=PReq100100+typedef struct {101101+ unsigned int m_uiSizeOfStruct;102102+ unsigned int m_uiPdoId;103103+ unsigned int m_uiNodeId;104104+ // 0xFF=invalid, RPDO: 0x00=PReq, localNodeId=PRes, remoteNodeId=PRes105105+ // TPDO: 0x00=PRes, MN: CnNodeId=PReq108106109109- BOOL m_fTxRx;110110- BYTE m_bMappingVersion;111111- unsigned int m_uiMaxMappingEntries; // maximum number of mapping entries, i.e. size of m_aPdoMapping112112- tEplPdoMapping m_aPdoMapping[1];107107+ BOOL m_fTxRx;108108+ BYTE m_bMappingVersion;109109+ unsigned int m_uiMaxMappingEntries; // maximum number of mapping entries, i.e. size of m_aPdoMapping110110+ tEplPdoMapping m_aPdoMapping[1];113111114112} tEplPdoParam;115115-116116-117113118114//---------------------------------------------------------------------------119115// function prototypes120116//---------------------------------------------------------------------------121117122122-123123-#endif // #ifndef _EPL_PDO_H_124124-125125-118118+#endif // #ifndef _EPL_PDO_H_
+69-95
drivers/staging/epl/EplSdo.h
···66666767 2006/06/26 k.t.: start of the implementation68686969-7069****************************************************************************/71707271#include "EplInc.h"···74757576#ifndef _EPLSDO_H_7677#define _EPLSDO_H_7777-78787979//---------------------------------------------------------------------------8080// const defines···116118117119// callback function pointer for Protocol Abstraction Layer to call118120// asynchronuus SDO Sequence Layer119119-typedef tEplKernel (PUBLIC* tEplSequLayerReceiveCb ) (120120- tEplSdoConHdl ConHdl_p,121121- tEplAsySdoSeq* pSdoSeqData_p,122122- unsigned int uiDataSize_p);121121+typedef tEplKernel(PUBLIC * tEplSequLayerReceiveCb) (tEplSdoConHdl ConHdl_p,122122+ tEplAsySdoSeq *123123+ pSdoSeqData_p,124124+ unsigned int uiDataSize_p);123125124126// handle between asynchronuus SDO Sequence Layer and SDO Command layer125127typedef unsigned int tEplSdoSeqConHdl;126128127129// callback function pointer for asynchronuus SDO Sequence Layer to call128130// SDO Command layer for received data129129-typedef tEplKernel (PUBLIC* tEplSdoComReceiveCb) (130130- tEplSdoSeqConHdl SdoSeqConHdl_p,131131- tEplAsySdoCom* pAsySdoCom_p,132132- unsigned int uiDataSize_p);131131+typedef tEplKernel(PUBLIC *132132+ tEplSdoComReceiveCb) (tEplSdoSeqConHdl SdoSeqConHdl_p,133133+ tEplAsySdoCom * pAsySdoCom_p,134134+ unsigned int uiDataSize_p);133135134136// status of connection135135-typedef enum136136-{137137- kAsySdoConStateConnected = 0x00,138138- kAsySdoConStateInitError = 0x01,139139- kAsySdoConStateConClosed = 0x02,140140- kAsySdoConStateAckReceived = 0x03,141141- kAsySdoConStateFrameSended = 0x04,142142- kAsySdoConStateTimeout = 0x05143143-144144-}tEplAsySdoConState;137137+typedef enum {138138+ kAsySdoConStateConnected = 0x00,139139+ kAsySdoConStateInitError = 0x01,140140+ kAsySdoConStateConClosed = 0x02,141141+ kAsySdoConStateAckReceived = 0x03,142142+ kAsySdoConStateFrameSended = 0x04,143143+ kAsySdoConStateTimeout = 0x05144144+} tEplAsySdoConState;145145146146// callback function pointer for asynchronuus SDO Sequence Layer to call147147// SDO Command layer for connection status148148-typedef tEplKernel (PUBLIC* tEplSdoComConCb) (149149- tEplSdoSeqConHdl SdoSeqConHdl_p,150150- tEplAsySdoConState AsySdoConState_p);148148+typedef tEplKernel(PUBLIC * tEplSdoComConCb) (tEplSdoSeqConHdl SdoSeqConHdl_p,149149+ tEplAsySdoConState150150+ AsySdoConState_p);151151152152// handle between SDO Command layer and application153153typedef unsigned int tEplSdoComConHdl;154154155155// status of connection156156-typedef enum157157-{158158- kEplSdoComTransferNotActive = 0x00,159159- kEplSdoComTransferRunning = 0x01,160160- kEplSdoComTransferTxAborted = 0x02,161161- kEplSdoComTransferRxAborted = 0x03,162162- kEplSdoComTransferFinished = 0x04,163163- kEplSdoComTransferLowerLayerAbort = 0x05164164-156156+typedef enum {157157+ kEplSdoComTransferNotActive = 0x00,158158+ kEplSdoComTransferRunning = 0x01,159159+ kEplSdoComTransferTxAborted = 0x02,160160+ kEplSdoComTransferRxAborted = 0x03,161161+ kEplSdoComTransferFinished = 0x04,162162+ kEplSdoComTransferLowerLayerAbort = 0x05165163} tEplSdoComConState;166164167165// SDO Services and Command-Ids from DS 1.0.0 p.152168168-typedef enum169169-{170170- kEplSdoServiceNIL = 0x00,171171- kEplSdoServiceWriteByIndex = 0x01,172172- kEplSdoServiceReadByIndex = 0x02173173-174174- //--------------------------------175175- // the following services are optional and176176- // not supported now166166+typedef enum {167167+ kEplSdoServiceNIL = 0x00,168168+ kEplSdoServiceWriteByIndex = 0x01,169169+ kEplSdoServiceReadByIndex = 0x02170170+ //--------------------------------171171+ // the following services are optional and172172+ // not supported now177173/*178174 kEplSdoServiceWriteAllByIndex = 0x03,179175 kEplSdoServiceReadAllByIndex = 0x04,···188196} tEplSdoServiceType;189197190198// describes if read or write access191191-typedef enum192192-{193193- kEplSdoAccessTypeRead = 0x00,194194- kEplSdoAccessTypeWrite = 0x01195195-199199+typedef enum {200200+ kEplSdoAccessTypeRead = 0x00,201201+ kEplSdoAccessTypeWrite = 0x01196202} tEplSdoAccessType;197203198198-typedef enum199199-{200200- kEplSdoTypeAuto = 0x00,201201- kEplSdoTypeUdp = 0x01,202202- kEplSdoTypeAsnd = 0x02,203203- kEplSdoTypePdo = 0x03204204+typedef enum {205205+ kEplSdoTypeAuto = 0x00,206206+ kEplSdoTypeUdp = 0x01,207207+ kEplSdoTypeAsnd = 0x02,208208+ kEplSdoTypePdo = 0x03209209+} tEplSdoType;204210205205-}tEplSdoType;206206-207207-typedef enum208208-{209209- kEplSdoTransAuto = 0x00,210210- kEplSdoTransExpedited = 0x01,211211- kEplSdoTransSegmented = 0x02212212-213213-211211+typedef enum {212212+ kEplSdoTransAuto = 0x00,213213+ kEplSdoTransExpedited = 0x01,214214+ kEplSdoTransSegmented = 0x02214215} tEplSdoTransType;215216216216-217217// structure to inform application about finish of SDO transfer218218-typedef struct219219-{220220- tEplSdoComConHdl m_SdoComConHdl;221221- tEplSdoComConState m_SdoComConState;222222- DWORD m_dwAbortCode;223223- tEplSdoAccessType m_SdoAccessType;224224- unsigned int m_uiNodeId; // NodeId of the target225225- unsigned int m_uiTargetIndex; // index which was accessed226226- unsigned int m_uiTargetSubIndex; // subindex which was accessed227227- unsigned int m_uiTransferredByte; // number of bytes transferred228228- void* m_pUserArg; // user definable argument pointer218218+typedef struct {219219+ tEplSdoComConHdl m_SdoComConHdl;220220+ tEplSdoComConState m_SdoComConState;221221+ DWORD m_dwAbortCode;222222+ tEplSdoAccessType m_SdoAccessType;223223+ unsigned int m_uiNodeId; // NodeId of the target224224+ unsigned int m_uiTargetIndex; // index which was accessed225225+ unsigned int m_uiTargetSubIndex; // subindex which was accessed226226+ unsigned int m_uiTransferredByte; // number of bytes transferred227227+ void *m_pUserArg; // user definable argument pointer229228230229} tEplSdoComFinished;231230232232-233231// callback function pointer to inform application about connection234234-typedef tEplKernel (PUBLIC* tEplSdoFinishedCb) (235235- tEplSdoComFinished* pSdoComFinished_p);236236-232232+typedef tEplKernel(PUBLIC * tEplSdoFinishedCb) (tEplSdoComFinished *233233+ pSdoComFinished_p);237234238235// structure to init SDO transfer to Read or Write by Index239239-typedef struct240240-{241241- tEplSdoComConHdl m_SdoComConHdl;242242- unsigned int m_uiIndex;243243- unsigned int m_uiSubindex;244244- void* m_pData;245245- unsigned int m_uiDataSize;246246- unsigned int m_uiTimeout; // not used in this version247247- tEplSdoAccessType m_SdoAccessType;248248- tEplSdoFinishedCb m_pfnSdoFinishedCb;249249- void* m_pUserArg; // user definable argument pointer236236+typedef struct {237237+ tEplSdoComConHdl m_SdoComConHdl;238238+ unsigned int m_uiIndex;239239+ unsigned int m_uiSubindex;240240+ void *m_pData;241241+ unsigned int m_uiDataSize;242242+ unsigned int m_uiTimeout; // not used in this version243243+ tEplSdoAccessType m_SdoAccessType;244244+ tEplSdoFinishedCb m_pfnSdoFinishedCb;245245+ void *m_pUserArg; // user definable argument pointer250246251247} tEplSdoComTransParamByIndex;252252-253253-254254-255248256249//---------------------------------------------------------------------------257250// function prototypes258251//---------------------------------------------------------------------------259252260260-261261-#endif // #ifndef _EPLSDO_H_262262-263263-253253+#endif // #ifndef _EPLSDO_H_
···66666767 2006/07/06 k.t.: start of the implementation68686969-7069****************************************************************************/71707271#include "EplInc.h"···7475#ifndef _EPLTIMER_H_7576#define _EPLTIMER_H_76777777-7878//---------------------------------------------------------------------------7979// const defines8080//---------------------------------------------------------------------------8181-82818382//---------------------------------------------------------------------------8483// typedef···8588// type for timer handle8689typedef unsigned long tEplTimerHdl;87908888-typedef struct8989-{9090- tEplEventSink m_EventSink;9191- unsigned long m_ulArg; // d.k.: converted to unsigned long because9292- // it is never accessed as a pointer by the9393- // timer module and the data the9494- // pointer points to is not saved in any way.9595- // It is just a value. The user is responsible9696- // to store the data statically and convert9797- // the pointer between address spaces.9191+typedef struct {9292+ tEplEventSink m_EventSink;9393+ unsigned long m_ulArg; // d.k.: converted to unsigned long because9494+ // it is never accessed as a pointer by the9595+ // timer module and the data the9696+ // pointer points to is not saved in any way.9797+ // It is just a value. The user is responsible9898+ // to store the data statically and convert9999+ // the pointer between address spaces.9810099101} tEplTimerArg;100102101101-typedef struct102102-{103103- tEplTimerHdl m_TimerHdl;104104- unsigned long m_ulArg; // d.k.: converted to unsigned long because105105- // it is never accessed as a pointer by the106106- // timer module and the data the107107- // pointer points to is not saved in any way.108108- // It is just a value.103103+typedef struct {104104+ tEplTimerHdl m_TimerHdl;105105+ unsigned long m_ulArg; // d.k.: converted to unsigned long because106106+ // it is never accessed as a pointer by the107107+ // timer module and the data the108108+ // pointer points to is not saved in any way.109109+ // It is just a value.109110110111} tEplTimerEventArg;111112112112-typedef tEplKernel (PUBLIC * tEplTimerkCallback) (113113- tEplTimerEventArg* pEventArg_p);113113+typedef tEplKernel(PUBLIC * tEplTimerkCallback) (tEplTimerEventArg *114114+ pEventArg_p);114115115116//---------------------------------------------------------------------------116117// function prototypes117118//---------------------------------------------------------------------------118119119119-120120-#endif // #ifndef _EPLTIMER_H_121121-122122-120120+#endif // #ifndef _EPLTIMER_H_
+2-4
drivers/staging/epl/EplVersion.h
···7070#ifndef _EPL_VERSION_H_7171#define _EPL_VERSION_H_72727373-7473// NOTE:7574// All version macros should contain the same version number. But do not use7675// defines instead of the numbers. Because the macro EPL_STRING_VERSION() can not···8485#define DEFINED_OBJ1018_VERSION EPL_OBJ1018_VERSION (1, 3, 0)8586#define DEFINED_STRING_VERSION EPL_STRING_VERSION (1, 3, 0)86878787-8888// -----------------------------------------------------------------------------8989#define EPL_PRODUCT_NAME "EPL V2"9090#define EPL_PRODUCT_VERSION DEFINED_STRING_VERSION9191#define EPL_PRODUCT_MANUFACTURER "SYS TEC electronic GmbH"92929393- #define EPL_PRODUCT_KEY "SO-1083"9494- #define EPL_PRODUCT_DESCRIPTION "openPOWERLINK Protocol Stack Source"9393+#define EPL_PRODUCT_KEY "SO-1083"9494+#define EPL_PRODUCT_DESCRIPTION "openPOWERLINK Protocol Stack Source"95959696#endif // _EPL_VERSION_H_9797
+89-68
drivers/staging/epl/SharedBuff.h
···5757#ifndef _SHAREDBUFF_H_5858#define _SHAREDBUFF_H_59596060-6161-6260//---------------------------------------------------------------------------6361// Type definitions6462//---------------------------------------------------------------------------65636666-typedef enum6767-{6868- kShbOk = 0,6969- kShbNoReadableData = 1,7070- kShbDataTruncated = 2,7171- kShbBufferFull = 3,7272- kShbDataOutsideBufferArea = 4,7373- kShbBufferAlreadyCompleted = 5,7474- kShbMemUsedByOtherProcs = 6,7575- kShbOpenMismatch = 7,7676- kShbInvalidBufferType = 8,7777- kShbInvalidArg = 9,7878- kShbBufferInvalid = 10,7979- kShbOutOfMem = 11,8080- kShbAlreadyReseting = 12,8181- kShbAlreadySignaling = 13,8282- kShbExceedDataSizeLimit = 14,6464+typedef enum {6565+ kShbOk = 0,6666+ kShbNoReadableData = 1,6767+ kShbDataTruncated = 2,6868+ kShbBufferFull = 3,6969+ kShbDataOutsideBufferArea = 4,7070+ kShbBufferAlreadyCompleted = 5,7171+ kShbMemUsedByOtherProcs = 6,7272+ kShbOpenMismatch = 7,7373+ kShbInvalidBufferType = 8,7474+ kShbInvalidArg = 9,7575+ kShbBufferInvalid = 10,7676+ kShbOutOfMem = 11,7777+ kShbAlreadyReseting = 12,7878+ kShbAlreadySignaling = 13,7979+ kShbExceedDataSizeLimit = 14,83808481} tShbError;85828686-8783// 2006/08/24 d.k.: Priority for threads (new data, job signaling)8888-typedef enum8989-{9090- kShbPriorityLow = 0,9191- kShbPriorityNormal = 1,9292- kshbPriorityHigh = 29393-8484+typedef enum {8585+ kShbPriorityLow = 0,8686+ kShbPriorityNormal = 1,8787+ kshbPriorityHigh = 29488} tShbPriority;95899696-9797-typedef struct9898-{9999- unsigned int m_uiFullBlockSize; // real size of allocated block (incl. alignment fill bytes)100100- unsigned long m_ulAvailableSize; // still available size for data101101- unsigned long m_ulWrIndex; // current write index102102- unsigned int m_fBufferCompleted; // TRUE if allocated block is complete filled with data9090+typedef struct {9191+ unsigned int m_uiFullBlockSize; // real size of allocated block (incl. alignment fill bytes)9292+ unsigned long m_ulAvailableSize; // still available size for data9393+ unsigned long m_ulWrIndex; // current write index9494+ unsigned int m_fBufferCompleted; // TRUE if allocated block is complete filled with data1039510496} tShbCirChunk;105979898+typedef void *tShbInstance;10699107107-typedef void* tShbInstance;108108-109109-110110-typedef void (*tShbCirSigHndlrNewData) (tShbInstance pShbInstance_p, unsigned long ulDataBlockSize_p);111111-typedef void (*tShbCirSigHndlrReset) (tShbInstance pShbInstance_p, unsigned int fTimeOut_p);112112-113113-100100+typedef void (*tShbCirSigHndlrNewData) (tShbInstance pShbInstance_p,101101+ unsigned long ulDataBlockSize_p);102102+typedef void (*tShbCirSigHndlrReset) (tShbInstance pShbInstance_p,103103+ unsigned int fTimeOut_p);114104115105//---------------------------------------------------------------------------116106// Prototypes···119129#endif120130*/121131122122-tShbError ShbInit (void);123123-tShbError ShbExit (void);132132+ tShbError ShbInit(void);133133+ tShbError ShbExit(void);124134125135// Circular Shared Buffer126126-tShbError ShbCirAllocBuffer (unsigned long ulBufferSize_p, const char* pszBufferID_p, tShbInstance* ppShbInstance_p, unsigned int* pfShbNewCreated_p);127127-tShbError ShbCirReleaseBuffer (tShbInstance pShbInstance_p);136136+ tShbError ShbCirAllocBuffer(unsigned long ulBufferSize_p,137137+ const char *pszBufferID_p,138138+ tShbInstance * ppShbInstance_p,139139+ unsigned int *pfShbNewCreated_p);140140+ tShbError ShbCirReleaseBuffer(tShbInstance pShbInstance_p);128141129142#if !defined(INLINE_ENABLED)130143131131-tShbError ShbCirResetBuffer (tShbInstance pShbInstance_p, unsigned long ulTimeOut_p, tShbCirSigHndlrReset pfnSignalHandlerReset_p);132132-tShbError ShbCirWriteDataBlock (tShbInstance pShbInstance_p, const void* pSrcDataBlock_p, unsigned long ulDataBlockSize_p);133133-tShbError ShbCirAllocDataBlock (tShbInstance pShbInstance_p, tShbCirChunk* pShbCirChunk_p, unsigned long ulDataBufferSize_p);134134-tShbError ShbCirWriteDataChunk (tShbInstance pShbInstance_p, tShbCirChunk* pShbCirChunk_p, const void* pSrcDataChunk_p, unsigned long ulDataChunkSize_p, unsigned int* pfBufferCompleted_p);135135-tShbError ShbCirReadDataBlock (tShbInstance pShbInstance_p, void* pDstDataBlock_p, unsigned long ulRdBuffSize_p, unsigned long* pulDataBlockSize_p);136136-tShbError ShbCirGetReadDataSize (tShbInstance pShbInstance_p, unsigned long* pulDataBlockSize_p);137137-tShbError ShbCirGetReadBlockCount (tShbInstance pShbInstance_p, unsigned long* pulDataBlockCount_p);138138-tShbError ShbCirSetSignalHandlerNewData (tShbInstance pShbInstance_p, tShbCirSigHndlrNewData pfnShbSignalHandlerNewData_p, tShbPriority ShbPriority_p);144144+ tShbError ShbCirResetBuffer(tShbInstance pShbInstance_p,145145+ unsigned long ulTimeOut_p,146146+ tShbCirSigHndlrReset147147+ pfnSignalHandlerReset_p);148148+ tShbError ShbCirWriteDataBlock(tShbInstance pShbInstance_p,149149+ const void *pSrcDataBlock_p,150150+ unsigned long ulDataBlockSize_p);151151+ tShbError ShbCirAllocDataBlock(tShbInstance pShbInstance_p,152152+ tShbCirChunk * pShbCirChunk_p,153153+ unsigned long ulDataBufferSize_p);154154+ tShbError ShbCirWriteDataChunk(tShbInstance pShbInstance_p,155155+ tShbCirChunk * pShbCirChunk_p,156156+ const void *pSrcDataChunk_p,157157+ unsigned long ulDataChunkSize_p,158158+ unsigned int *pfBufferCompleted_p);159159+ tShbError ShbCirReadDataBlock(tShbInstance pShbInstance_p,160160+ void *pDstDataBlock_p,161161+ unsigned long ulRdBuffSize_p,162162+ unsigned long *pulDataBlockSize_p);163163+ tShbError ShbCirGetReadDataSize(tShbInstance pShbInstance_p,164164+ unsigned long *pulDataBlockSize_p);165165+ tShbError ShbCirGetReadBlockCount(tShbInstance pShbInstance_p,166166+ unsigned long *pulDataBlockCount_p);167167+ tShbError ShbCirSetSignalHandlerNewData(tShbInstance pShbInstance_p,168168+ tShbCirSigHndlrNewData169169+ pfnShbSignalHandlerNewData_p,170170+ tShbPriority ShbPriority_p);139171140172#endif141173142174// Linear Shared Buffer143143-tShbError ShbLinAllocBuffer (unsigned long ulBufferSize_p, const char* pszBufferID_p, tShbInstance* ppShbInstance_p, unsigned int* pfShbNewCreated_p);144144-tShbError ShbLinReleaseBuffer (tShbInstance pShbInstance_p);175175+ tShbError ShbLinAllocBuffer(unsigned long ulBufferSize_p,176176+ const char *pszBufferID_p,177177+ tShbInstance * ppShbInstance_p,178178+ unsigned int *pfShbNewCreated_p);179179+ tShbError ShbLinReleaseBuffer(tShbInstance pShbInstance_p);145180146181#if !defined(INLINE_ENABLED)147182148148-tShbError ShbLinWriteDataBlock (tShbInstance pShbInstance_p, unsigned long ulDstBufferOffs_p, const void* pSrcDataBlock_p, unsigned long ulDataBlockSize_p);149149-tShbError ShbLinReadDataBlock (tShbInstance pShbInstance_p, void* pDstDataBlock_p, unsigned long ulSrcBufferOffs_p, unsigned long ulDataBlockSize_p);183183+ tShbError ShbLinWriteDataBlock(tShbInstance pShbInstance_p,184184+ unsigned long ulDstBufferOffs_p,185185+ const void *pSrcDataBlock_p,186186+ unsigned long ulDataBlockSize_p);187187+ tShbError ShbLinReadDataBlock(tShbInstance pShbInstance_p,188188+ void *pDstDataBlock_p,189189+ unsigned long ulSrcBufferOffs_p,190190+ unsigned long ulDataBlockSize_p);150191151192#endif152193153194#ifndef NDEBUG154154- tShbError ShbCirTraceBuffer (tShbInstance pShbInstance_p);155155- tShbError ShbLinTraceBuffer (tShbInstance pShbInstance_p);156156- tShbError ShbTraceDump (const unsigned char* pabStartAddr_p, unsigned long ulDataSize_p, unsigned long ulAddrOffset_p, const char* pszInfoText_p);195195+ tShbError ShbCirTraceBuffer(tShbInstance pShbInstance_p);196196+ tShbError ShbLinTraceBuffer(tShbInstance pShbInstance_p);197197+ tShbError ShbTraceDump(const unsigned char *pabStartAddr_p,198198+ unsigned long ulDataSize_p,199199+ unsigned long ulAddrOffset_p,200200+ const char *pszInfoText_p);157201#else158158- #define ShbCirTraceBuffer(p0)159159- #define ShbLinTraceBuffer(p0)160160- #define ShbTraceDump(p0, p1, p2, p3)202202+#define ShbCirTraceBuffer(p0)203203+#define ShbLinTraceBuffer(p0)204204+#define ShbTraceDump(p0, p1, p2, p3)161205#endif162206163163-#undef INLINE_ENABLED // disable actual inlining of functions207207+#undef INLINE_ENABLED // disable actual inlining of functions164208#undef INLINE_FUNCTION165165-#define INLINE_FUNCTION // define INLINE_FUNCTION to nothing209209+#define INLINE_FUNCTION // define INLINE_FUNCTION to nothing166210167211#ifdef __cplusplus168212}169213#endif170170-171171-172172-#endif // #ifndef _SHAREDBUFF_H_173173-214214+#endif // #ifndef _SHAREDBUFF_H_
···66666767 2006/08/25 d.k.: start of the implementation68686969-7069****************************************************************************/7171-72707371#ifndef _SOCKETLINUXKERNEL_H_7472#define _SOCKETLINUXKERNEL_H_75737674#include <linux/net.h>7775#include <linux/in.h>7878-79768077//---------------------------------------------------------------------------8178// const defines···8487// typedef8588//---------------------------------------------------------------------------86898787-typedef struct socket* SOCKET;9090+typedef struct socket *SOCKET;88918992//---------------------------------------------------------------------------9093// function prototypes···94979598int closesocket(SOCKET s);96999797-int recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr *from, int * fromlen);100100+int recvfrom(SOCKET s, char *buf, int len, int flags, struct sockaddr *from,101101+ int *fromlen);981029999-int sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr *to, int tolen);103103+int sendto(SOCKET s, const char *buf, int len, int flags,104104+ const struct sockaddr *to, int tolen);100105101106SOCKET socket(int af, int type, int protocol);102107103103-#endif // #ifndef _SOCKETLINUXKERNEL_H_104104-105105-108108+#endif // #ifndef _SOCKETLINUXKERNEL_H_
+37-53
drivers/staging/epl/edrv.h
···8181#define MAX_ETH_DATA_SIZE 15008282#define MIN_ETH_DATA_SIZE 4683838484-#define ETH_HDR_OFFSET 0 // Ethernet header at the top of the frame8585-#define ETH_HDR_SIZE 14 // size of Ethernet header8686-#define MIN_ETH_SIZE (MIN_ETH_DATA_SIZE + ETH_HDR_SIZE) // without CRC8484+#define ETH_HDR_OFFSET 0 // Ethernet header at the top of the frame8585+#define ETH_HDR_SIZE 14 // size of Ethernet header8686+#define MIN_ETH_SIZE (MIN_ETH_DATA_SIZE + ETH_HDR_SIZE) // without CRC87878888-#define ETH_CRC_SIZE 4 // size of Ethernet CRC, i.e. FCS8989-9090-8888+#define ETH_CRC_SIZE 4 // size of Ethernet CRC, i.e. FCS91899290//---------------------------------------------------------------------------9391// types9492//---------------------------------------------------------------------------95939694// position of a buffer in an ethernet-frame9797-typedef enum9898-{9999- kEdrvBufferFirstInFrame = 0x01, // first data buffer in an ethernet frame100100- kEdrvBufferMiddleInFrame = 0x02, // a middle data buffer in an ethernet frame101101- kEdrvBufferLastInFrame = 0x04 // last data buffer in an ethernet frame9595+typedef enum {9696+ kEdrvBufferFirstInFrame = 0x01, // first data buffer in an ethernet frame9797+ kEdrvBufferMiddleInFrame = 0x02, // a middle data buffer in an ethernet frame9898+ kEdrvBufferLastInFrame = 0x04 // last data buffer in an ethernet frame10299} tEdrvBufferInFrame;103100104104-105101// format of a tx-buffer106106-typedef struct _tEdrvTxBuffer107107-{108108- tEplMsgType m_EplMsgType; // IN: type of EPL message, set by calling function109109- unsigned int m_uiTxMsgLen; // IN: length of message to be send (set for each transmit call)110110- // ----------------------111111- unsigned int m_uiBufferNumber; // OUT: number of the buffer, set by ethernetdriver112112- BYTE * m_pbBuffer; // OUT: pointer to the buffer, set by ethernetdriver113113- tEplNetTime m_NetTime; // OUT: Timestamp of end of transmission, set by ethernetdriver114114- // ----------------------115115- unsigned int m_uiMaxBufferLen; // IN/OUT: maximum length of the buffer102102+typedef struct _tEdrvTxBuffer {103103+ tEplMsgType m_EplMsgType; // IN: type of EPL message, set by calling function104104+ unsigned int m_uiTxMsgLen; // IN: length of message to be send (set for each transmit call)105105+ // ----------------------106106+ unsigned int m_uiBufferNumber; // OUT: number of the buffer, set by ethernetdriver107107+ BYTE *m_pbBuffer; // OUT: pointer to the buffer, set by ethernetdriver108108+ tEplNetTime m_NetTime; // OUT: Timestamp of end of transmission, set by ethernetdriver109109+ // ----------------------110110+ unsigned int m_uiMaxBufferLen; // IN/OUT: maximum length of the buffer116111} tEdrvTxBuffer;117112118113// format of a rx-buffer119119-typedef struct _tEdrvRxBuffer120120-{121121- tEdrvBufferInFrame m_BufferInFrame; // OUT position of received buffer in an ethernet-frame122122- unsigned int m_uiRxMsgLen; // OUT: length of received buffer (without CRC)123123- BYTE * m_pbBuffer; // OUT: pointer to the buffer, set by ethernetdriver124124- tEplNetTime m_NetTime; // OUT: Timestamp of end of receiption114114+typedef struct _tEdrvRxBuffer {115115+ tEdrvBufferInFrame m_BufferInFrame; // OUT position of received buffer in an ethernet-frame116116+ unsigned int m_uiRxMsgLen; // OUT: length of received buffer (without CRC)117117+ BYTE *m_pbBuffer; // OUT: pointer to the buffer, set by ethernetdriver118118+ tEplNetTime m_NetTime; // OUT: Timestamp of end of receiption125119126120} tEdrvRxBuffer;127127-128128-129121130122//typedef void (*tEdrvRxHandler) (BYTE bBufferInFrame_p, tBufferDescr * pbBuffer_p);131123//typedef void (*tEdrvRxHandler) (BYTE bBufferInFrame_p, BYTE * pbEthernetData_p, WORD wDataLen_p);132124typedef void (*tEdrvRxHandler) (tEdrvRxBuffer * pRxBuffer_p);133125typedef void (*tEdrvTxHandler) (tEdrvTxBuffer * pTxBuffer_p);134126135135-136127// format of init structure137137-typedef struct138138-{139139- BYTE m_abMyMacAddr[6]; // the own MAC address128128+typedef struct {129129+ BYTE m_abMyMacAddr[6]; // the own MAC address140130141131// BYTE m_bNoOfRxBuffDescr; // number of entries in rx bufferdescriptor table142132// tBufferDescr * m_pRxBuffDescrTable; // rx bufferdescriptor table143133// WORD m_wRxBufferSize; // size of the whole rx buffer144134145145- tEdrvRxHandler m_pfnRxHandler;146146- tEdrvTxHandler m_pfnTxHandler;135135+ tEdrvRxHandler m_pfnRxHandler;136136+ tEdrvTxHandler m_pfnTxHandler;147137148138} tEdrvInitParam;149149-150139151140//---------------------------------------------------------------------------152141// function prototypes153142//---------------------------------------------------------------------------154143144144+tEplKernel EdrvInit(tEdrvInitParam * pEdrvInitParam_p);155145156156-tEplKernel EdrvInit (tEdrvInitParam* pEdrvInitParam_p);146146+tEplKernel EdrvShutdown(void);157147158158-tEplKernel EdrvShutdown (void);159159-160160-tEplKernel EdrvDefineRxMacAddrEntry (BYTE * pbMacAddr_p);161161-tEplKernel EdrvUndefineRxMacAddrEntry (BYTE * pbMacAddr_p);148148+tEplKernel EdrvDefineRxMacAddrEntry(BYTE * pbMacAddr_p);149149+tEplKernel EdrvUndefineRxMacAddrEntry(BYTE * pbMacAddr_p);162150163151//tEplKernel EdrvDefineUnicastEntry (BYTE * pbUCEntry_p);164152//tEplKernel EdrvUndfineUnicastEntry (BYTE * pbUCEntry_p);165153166166-tEplKernel EdrvAllocTxMsgBuffer (tEdrvTxBuffer * pBuffer_p);167167-tEplKernel EdrvReleaseTxMsgBuffer (tEdrvTxBuffer * pBuffer_p);154154+tEplKernel EdrvAllocTxMsgBuffer(tEdrvTxBuffer * pBuffer_p);155155+tEplKernel EdrvReleaseTxMsgBuffer(tEdrvTxBuffer * pBuffer_p);168156169157//tEplKernel EdrvWriteMsg (tBufferDescr * pbBuffer_p);170170-tEplKernel EdrvSendTxMsg (tEdrvTxBuffer * pBuffer_p);171171-tEplKernel EdrvTxMsgReady (tEdrvTxBuffer * pBuffer_p);172172-tEplKernel EdrvTxMsgStart (tEdrvTxBuffer * pBuffer_p);158158+tEplKernel EdrvSendTxMsg(tEdrvTxBuffer * pBuffer_p);159159+tEplKernel EdrvTxMsgReady(tEdrvTxBuffer * pBuffer_p);160160+tEplKernel EdrvTxMsgStart(tEdrvTxBuffer * pBuffer_p);173161174162//tEplKernel EdrvReadMsg (void);175163176164// interrupt handler called by target specific interrupt handler177177-void EdrvInterruptHandler (void);165165+void EdrvInterruptHandler(void);178166179179-180180-181181-#endif // #ifndef _EDRV_H_182182-183183-167167+#endif // #ifndef _EDRV_H_
+847-924
drivers/staging/epl/global.h
···2222#ifndef _GLOBAL_H_2323#define _GLOBAL_H_24242525-2625//---------------------------------------------------------------------------2726// elements of defines for development system2827//---------------------------------------------------------------------------29283029// these defines are necessary to check some of characteristics of the development system3131-#define _DEV_BIGEND_ 0x80000000L // big endian (motorolla format)3232-#define _DEV_ALIGNMENT_4_ 0x00400000L // the CPU needs alignment of 4 bytes3333-#define _DEV_ONLY_INT_MAIN_ 0x00004000L // the compiler needs "int main(int)" instead of "void main(void)"3434-#define _DEV_COMMA_EXT_ 0x00002000L // support of last comma in struct predefinition3535-#define _DEV_64BIT_SUPPORT_ 0x00001000L // support of 64 bit operations3636-#define _DEV_BIT64_ 0x00000400L // count of bits: 64 bit3737-#define _DEV_BIT32_ 0x00000300L // 32 bit3838-#define _DEV_BIT16_ 0x00000200L // 16 bit3939-#define _DEV_BIT8_ 0x00000100L // 8 bit4040-#define _DEV_RVCT_ARM_ 0x0000001CL // RealView ARM4141-#define _DEV_RENESASM32C 0x0000001BL // compiler from: Renesas4242-#define _DEV_GNUC_MIPS2_ 0x0000001AL // GNU for MIPS24343-#define _DEV_MPLAB_C30_ 0x00000019L // MPLAB C30 for Microchip dsPIC33F series4444-#define _DEV_GNUC_TC_ 0x00000018L // GNU for Infineon TriCore4545-#define _DEV_GNUC_X86_ 0x00000017L // GNU for I3864646-#define _DEV_IAR_ARM_ 0x00000016L // ARM IAR C/C++ Compiler4747-#define _DEV_PARADGM_X86 0x00000015L // Paradigm C/C++ for Beck 1x34848-#define _DEV_GNUC_CF_ 0x00000014L // GNU for Coldfire4949-#define _DEV_KEIL_ARM_ 0x00000013L // Keil ARM5050-#define _DEV_MSEVC_ 0x00000012L // Microsoft embedded Visual C/C++5151-#define _DEV_HIGHTEC_GNUC_X86_ 0x00000011L // Hightec elf386 gcc5252-#define _DEV_MSVC_RTX_ 0x00000010L // VC600 + RTX5353-#define _DEV_MSVC_V1_5_ 0x0000000FL // Microsoft Visual C/C++ V1.55454-#define _DEV_GNUC_ARM7_ 0x0000000EL // GNU Compiler gcc for ARM75555-#define _DEV_METROWERKS_CW_ 0x0000000DL // Metrowerks Code Warrior5656-#define _DEV_MITSUBISHIM16C_ 0x0000000CL //compiler from: Mitsubishi5757-#define _DEV_GNUC_C16X_ 0x0000000BL // GNU Compiler gcc166 for Infineon C16x5858-#define _DEV_LINUX_GCC_ 0x0000000AL // Linux GNU Compiler gcc5959-#define _DEV_GNUC_MPC5X5 0x00000009L // GNU for Motorola PPC5x56060-#define _DEV_TASKINGM16C_ 0x00000008L // Tasking for Mitsubishi M16C6161-#define _DEV_FUJITSU_ 0x00000007L // Fujitsu6262-#define _DEV_TASKING8_ 0x00000006L // Tasking 80516363-#define _DEV_TASKING16_ 0x00000005L // Tasking 1666464-#define _DEV_KEIL8_ 0x00000004L // Keil C516565-#define _DEV_KEIL16_ 0x00000003L // Keil C1666666-#define _DEV_BORLANDC_ 0x00000002L // Borland C/C++6767-#define _DEV_MSVC16_ 0x00000001L // Microsoft Visual C/C++6868-#define _DEV_MSVC32_ 0x00000000L // Microsoft Visual C/C++3030+#define _DEV_BIGEND_ 0x80000000L // big endian (motorolla format)3131+#define _DEV_ALIGNMENT_4_ 0x00400000L // the CPU needs alignment of 4 bytes3232+#define _DEV_ONLY_INT_MAIN_ 0x00004000L // the compiler needs "int main(int)" instead of "void main(void)"3333+#define _DEV_COMMA_EXT_ 0x00002000L // support of last comma in struct predefinition3434+#define _DEV_64BIT_SUPPORT_ 0x00001000L // support of 64 bit operations3535+#define _DEV_BIT64_ 0x00000400L // count of bits: 64 bit3636+#define _DEV_BIT32_ 0x00000300L // 32 bit3737+#define _DEV_BIT16_ 0x00000200L // 16 bit3838+#define _DEV_BIT8_ 0x00000100L // 8 bit3939+#define _DEV_RVCT_ARM_ 0x0000001CL // RealView ARM4040+#define _DEV_RENESASM32C 0x0000001BL // compiler from: Renesas4141+#define _DEV_GNUC_MIPS2_ 0x0000001AL // GNU for MIPS24242+#define _DEV_MPLAB_C30_ 0x00000019L // MPLAB C30 for Microchip dsPIC33F series4343+#define _DEV_GNUC_TC_ 0x00000018L // GNU for Infineon TriCore4444+#define _DEV_GNUC_X86_ 0x00000017L // GNU for I3864545+#define _DEV_IAR_ARM_ 0x00000016L // ARM IAR C/C++ Compiler4646+#define _DEV_PARADGM_X86 0x00000015L // Paradigm C/C++ for Beck 1x34747+#define _DEV_GNUC_CF_ 0x00000014L // GNU for Coldfire4848+#define _DEV_KEIL_ARM_ 0x00000013L // Keil ARM4949+#define _DEV_MSEVC_ 0x00000012L // Microsoft embedded Visual C/C++5050+#define _DEV_HIGHTEC_GNUC_X86_ 0x00000011L // Hightec elf386 gcc5151+#define _DEV_MSVC_RTX_ 0x00000010L // VC600 + RTX5252+#define _DEV_MSVC_V1_5_ 0x0000000FL // Microsoft Visual C/C++ V1.55353+#define _DEV_GNUC_ARM7_ 0x0000000EL // GNU Compiler gcc for ARM75454+#define _DEV_METROWERKS_CW_ 0x0000000DL // Metrowerks Code Warrior5555+#define _DEV_MITSUBISHIM16C_ 0x0000000CL //compiler from: Mitsubishi5656+#define _DEV_GNUC_C16X_ 0x0000000BL // GNU Compiler gcc166 for Infineon C16x5757+#define _DEV_LINUX_GCC_ 0x0000000AL // Linux GNU Compiler gcc5858+#define _DEV_GNUC_MPC5X5 0x00000009L // GNU for Motorola PPC5x55959+#define _DEV_TASKINGM16C_ 0x00000008L // Tasking for Mitsubishi M16C6060+#define _DEV_FUJITSU_ 0x00000007L // Fujitsu6161+#define _DEV_TASKING8_ 0x00000006L // Tasking 80516262+#define _DEV_TASKING16_ 0x00000005L // Tasking 1666363+#define _DEV_KEIL8_ 0x00000004L // Keil C516464+#define _DEV_KEIL16_ 0x00000003L // Keil C1666565+#define _DEV_BORLANDC_ 0x00000002L // Borland C/C++6666+#define _DEV_MSVC16_ 0x00000001L // Microsoft Visual C/C++6767+#define _DEV_MSVC32_ 0x00000000L // Microsoft Visual C/C++69687069// these defines can be used to mask previous elements7170#define _DEV_MASK_COMPILER 0x000000FFL7271#define _DEV_MASK_BITCOUNT 0x00000F00L7372#define _DEV_MASK_ADDSUPPORT 0x0000F000L7473#define _DEV_MASK_ALIGNMENT 0x00F00000L7575-76747775//---------------------------------------------------------------------------7876// defines for development system (DEV_SYSTEM) including previous elements···7981#define _DEV_WIN16_ (_DEV_BIT16_ | _DEV_MSVC16_ )8082#define _DEV_WIN32_ (_DEV_BIT32_ | _DEV_MSVC32_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)8183#define _DEV_MSVC_DOS_ (_DEV_BIT32_ | _DEV_MSVC_V1_5_ )8282-#define _DEV_BORLAND_DOS_ (_DEV_BIT32_ | _DEV_BORLANDC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)8383-#define _DEV_KEIL_C51X_ (_DEV_BIT8_ | _DEV_KEIL8_ | _DEV_BIGEND_ | _DEV_COMMA_EXT_) // at least C51 version 7.05 supports comma extension8484-#define _DEV_KEIL_C16X_ (_DEV_BIT16_ | _DEV_KEIL16_ | _DEV_COMMA_EXT_) // at least C166 version 5.03 supports comma extension8484+#define _DEV_BORLAND_DOS_ (_DEV_BIT32_ | _DEV_BORLANDC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)8585+#define _DEV_KEIL_C51X_ (_DEV_BIT8_ | _DEV_KEIL8_ | _DEV_BIGEND_ | _DEV_COMMA_EXT_) // at least C51 version 7.05 supports comma extension8686+#define _DEV_KEIL_C16X_ (_DEV_BIT16_ | _DEV_KEIL16_ | _DEV_COMMA_EXT_) // at least C166 version 5.03 supports comma extension8587#define _DEV_TASKING_C51X_ (_DEV_BIT8_ | _DEV_TASKING8_ | _DEV_BIGEND_)8688#define _DEV_TASKING_C16X_ (_DEV_BIT16_ | _DEV_TASKING16_ )8787-#define _DEV_FUJITSU_F590_ (_DEV_BIT8_ | _DEV_FUJITSU_ | _DEV_COMMA_EXT_) // softune is not able to support 64 bit variables QWORD !!!8989+#define _DEV_FUJITSU_F590_ (_DEV_BIT8_ | _DEV_FUJITSU_ | _DEV_COMMA_EXT_) // softune is not able to support 64 bit variables QWORD !!!8890//f.j.29.04.03 M16C kann effektiv mit Bytes umgehen8991//#define _DEV_TASKING_M16C_ (_DEV_BIT16_ | _DEV_TASKINGM16C_ )9092#define _DEV_TASKING_M16C_ (_DEV_BIT8_ | _DEV_TASKINGM16C_ )9193#define _DEV_MITSUBISHI_M16C_ (_DEV_BIT8_ | _DEV_MITSUBISHIM16C_ )9294#define _DEV_GNU_MPC5X5_ (_DEV_BIT32_ | _DEV_GNUC_MPC5X5| _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9395#define _DEV_LINUX_ (_DEV_BIT32_ | _DEV_LINUX_GCC_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9494-#define _DEV_GNU_C16X_ (_DEV_BIT16_ | _DEV_GNUC_C16X_ ) //| _DEV_COMMA_EXT_)9595-#define _DEV_MCW_MPC5X5_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9696+#define _DEV_GNU_C16X_ (_DEV_BIT16_ | _DEV_GNUC_C16X_ ) //| _DEV_COMMA_EXT_)9797+#define _DEV_MCW_MPC5X5_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9698#define _DEV_GNU_ARM7_ (_DEV_BIT32_ | _DEV_GNUC_ARM7_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)9797-#define _DEV_WIN32_RTX_ (_DEV_BIT32_ | _DEV_MSVC_RTX_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9898-#define _DEV_HIGHTEC_X86_ (_DEV_BIT32_ | _DEV_HIGHTEC_GNUC_X86_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9999-#define _DEV_WIN_CE_ (_DEV_BIT32_ | _DEV_MSEVC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)9999+#define _DEV_WIN32_RTX_ (_DEV_BIT32_ | _DEV_MSVC_RTX_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)100100+#define _DEV_HIGHTEC_X86_ (_DEV_BIT32_ | _DEV_HIGHTEC_GNUC_X86_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)101101+#define _DEV_WIN_CE_ (_DEV_BIT32_ | _DEV_MSEVC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)100102#define _DEV_KEIL_CARM_ (_DEV_BIT32_ | _DEV_KEIL_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)101103#define _DEV_IAR_CARM_ (_DEV_BIT32_ | _DEV_IAR_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)102104#define _DEV_RVCT_CARM_ (_DEV_BIT32_ | _DEV_RVCT_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)103103-#define _DEV_MCW_MCF5XXX_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)105105+#define _DEV_MCW_MCF5XXX_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)104106#define _DEV_GNU_CF5282_ (_DEV_BIT32_ | _DEV_GNUC_CF_ | _DEV_BIGEND_)105107#define _DEV_PAR_BECK1X3_ (_DEV_BIT16_ | _DEV_PARADGM_X86)106108#define _DEV_GNU_CF548X_ (_DEV_BIT32_ | _DEV_GNUC_CF_ | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)107109#define _DEV_GNU_I386_ (_DEV_BIT32_ | _DEV_GNUC_X86_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)108110#define _DEV_GNU_TRICORE_ (_DEV_BIT32_ | _DEV_GNUC_TC_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_ | _DEV_ALIGNMENT_4_)109109-#define _DEV_MPLAB_DSPIC33F_ (_DEV_BIT16_ | _DEV_MPLAB_C30_ ) //| _DEV_COMMA_EXT_)111111+#define _DEV_MPLAB_DSPIC33F_ (_DEV_BIT16_ | _DEV_MPLAB_C30_ ) //| _DEV_COMMA_EXT_)110112#define _DEV_GNU_MIPSEL_ (_DEV_BIT32_ | _DEV_GNUC_MIPS2_ | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)111113112114#define _DEV_RENESAS_M32C_ (_DEV_BIT32_ | _DEV_RENESASM32C)···117119118120#define CHECK_IF_ONLY_INT_MAIN() (DEV_SYSTEM & _DEV_ONLY_INT_MAIN_)119121#define CHECK_MEMORY_ALINMENT() (DEV_SYSTEM & _DEV_MASK_ALIGNMENT)120120-121122122123//---------------------------------------------------------------------------123124// defines for target system (TARGET_SYSTEM)···131134#define _PXROS_ 2132135#define _ECOSPRO_ 3133136134134-135137//---------------------------------------------------------------------------136138// definitions for function inlining137139//---------------------------------------------------------------------------138140139139-#define INLINE_FUNCTION // empty define140140-#undef INLINE_ENABLED // disable actual inlining of functions141141-#undef INLINE_FUNCTION_DEF // disable inlining for all compilers per default141141+#define INLINE_FUNCTION // empty define142142+#undef INLINE_ENABLED // disable actual inlining of functions143143+#undef INLINE_FUNCTION_DEF // disable inlining for all compilers per default142144143145//---------------------------------------------------------------------------144146// definitions for Keil C51···145149146150#ifdef __C51__147151148148- #define TARGET_SYSTEM _NO_OS_149149- #define DEV_SYSTEM _DEV_KEIL_C51X_152152+#define TARGET_SYSTEM _NO_OS_153153+#define DEV_SYSTEM _DEV_KEIL_C51X_150154151151- #pragma DEBUG OBJECTEXTEND152152- #pragma WARNINGLEVEL(2) // maximum warning level155155+#pragma DEBUG OBJECTEXTEND156156+#pragma WARNINGLEVEL(2) // maximum warning level153157154154- #define NEAR idata // variables mapped to internal data storage location155155- #define FAR xdata // variables mapped to external data storage location156156- #define CONST const // variables mapped to ROM (i.e. flash)157157- #define ROM code // code or variables mapped to ROM (i.e. flash)158158- // usage: CONST BYTE ROM foo = 0x00;159159- #define HWACC xdata // hardware access through external memory (i.e. CAN)160160- #define LARGE large // functions set parameters to external data storage location158158+#define NEAR idata // variables mapped to internal data storage location159159+#define FAR xdata // variables mapped to external data storage location160160+#define CONST const // variables mapped to ROM (i.e. flash)161161+#define ROM code // code or variables mapped to ROM (i.e. flash)162162+ // usage: CONST BYTE ROM foo = 0x00;163163+#define HWACC xdata // hardware access through external memory (i.e. CAN)164164+#define LARGE large // functions set parameters to external data storage location161165162166 // These types can be adjusted by users to match application requirements. The goal is to163167 // minimize code memory and maximize speed.164164- #define GENERIC // generic pointer to point to application data165165- // Variables with this attribute can be located in external166166- // or internal data memory.167167- #define MEM xdata // Memory attribute to optimize speed and code of pointer access.168168+#define GENERIC // generic pointer to point to application data169169+ // Variables with this attribute can be located in external170170+ // or internal data memory.171171+#define MEM xdata // Memory attribute to optimize speed and code of pointer access.168172169169- #define REENTRANT reentrant170170- #define PUBLIC173173+#define REENTRANT reentrant174174+#define PUBLIC171175172172- #ifndef NDEBUG173173- #include <stdio.h> // prototype printf() (for TRACE)174174- #define TRACE printf175175- #endif176176-176176+#ifndef NDEBUG177177+#include <stdio.h> // prototype printf() (for TRACE)178178+#define TRACE printf179179+#endif177180178181//---------------------------------------------------------------------------179182// definitions for GNU Compiler for Infineon C16x···180185//---------------------------------------------------------------------------181186#elif defined (__GNUC__) && defined (__C166__)182187183183- #define TARGET_SYSTEM _NO_OS_184184- #define DEV_SYSTEM _DEV_GNU_C16X_188188+#define TARGET_SYSTEM _NO_OS_189189+#define DEV_SYSTEM _DEV_GNU_C16X_185190186191// #define NEAR idata // variables mapped to internal data storage location187187- #define NEAR near // variables mapped to internal data storage location192192+#define NEAR near // variables mapped to internal data storage location188193// #define FAR xhuge // variables mapped to external data storage location189189- #define FAR huge // variables mapped to external data storage location190190- #define CONST const // variables mapped to ROM (i.e. flash)191191- #define ROM // code or variables mapped to ROM (i.e. flash)192192- // usage: CONST BYTE ROM foo = 0x00;194194+#define FAR huge // variables mapped to external data storage location195195+#define CONST const // variables mapped to ROM (i.e. flash)196196+#define ROM // code or variables mapped to ROM (i.e. flash)197197+ // usage: CONST BYTE ROM foo = 0x00;193198// #define HWACC sdata // hardware access through external memory (i.e. CAN)194194- #define HWACC huge // hardware access through external memory (i.e. CAN)195195- #define LARGE // functions set parameters to external data storage location199199+#define HWACC huge // hardware access through external memory (i.e. CAN)200200+#define LARGE // functions set parameters to external data storage location196201197202 // These types can be adjusted by users to match application requirements. The goal is to198203 // minimize code memory and maximize speed.199204// #define GENERIC xhuge // generic pointer to point to application data200200- #define GENERIC huge // generic pointer to point to application data201201- // Variables with this attribute can be located in external202202- // or internal data memory.203203- #define MEM // Memory attribute to optimize speed and code of pointer access.205205+#define GENERIC huge // generic pointer to point to application data206206+ // Variables with this attribute can be located in external207207+ // or internal data memory.208208+#define MEM // Memory attribute to optimize speed and code of pointer access.204209205205- #define REENTRANT206206- #define PUBLIC210210+#define REENTRANT211211+#define PUBLIC207212208208- #ifndef NDEBUG209209- #include <stdio.h> // prototype printf() (for TRACE)210210- #define TRACE printf213213+#ifndef NDEBUG214214+#include <stdio.h> // prototype printf() (for TRACE)215215+#define TRACE printf211216212212- #define ASSERT(p) \217217+#define ASSERT(p) \213218 if (p) \214219 { \215220 ; \···219224 PRINTF0("Assert failed: " #p " (file %s line %d)\n", __FILE__, (int) __LINE__ ); \220225 while (1); \221226 }222222- #else223223- #define ASSERT(p)224224- #endif227227+#else228228+#define ASSERT(p)229229+#endif225230226231//---------------------------------------------------------------------------227232// definitions for Keil C166228233//---------------------------------------------------------------------------229229-#elif defined (__C166__) // 24.01.2005 r.d.: Keil ARM7 needs directive 'defined'234234+#elif defined (__C166__) // 24.01.2005 r.d.: Keil ARM7 needs directive 'defined'230235231231- #define TARGET_SYSTEM _NO_OS_232232- #define DEV_SYSTEM _DEV_KEIL_C16X_236236+#define TARGET_SYSTEM _NO_OS_237237+#define DEV_SYSTEM _DEV_KEIL_C16X_233238234234- #pragma CODE235235- #pragma MOD167236236- #pragma NOINIT237237- #pragma DEBUG238238- #pragma WARNINGLEVEL(3) // maximum warning level239239- #pragma WARNING DISABLE = 47 // warning <unreferenced parameter> = OFF240240- #pragma WARNING DISABLE = 38 // warning <empty translation unit> = OFF239239+#pragma CODE240240+#pragma MOD167241241+#pragma NOINIT242242+#pragma DEBUG243243+#pragma WARNINGLEVEL(3) // maximum warning level244244+#pragma WARNING DISABLE = 47 // warning <unreferenced parameter> = OFF245245+#pragma WARNING DISABLE = 38 // warning <empty translation unit> = OFF241246// #pragma WARNING DISABLE = 102 // warning <different const/volatile qualifiers> = OFF242242- #pragma WARNING DISABLE = 174 // warning <unreferenced 'static' function> = OFF243243- #pragma WARNING DISABLE = 183 // warning <dead assignement eliminated> = OFF247247+#pragma WARNING DISABLE = 174 // warning <unreferenced 'static' function> = OFF248248+#pragma WARNING DISABLE = 183 // warning <dead assignement eliminated> = OFF244249245245- #define NEAR idata // variables mapped to internal data storage location246246- #define FAR xhuge // variables mapped to external data storage location247247- #define CONST const // variables mapped to ROM (i.e. flash)248248- #define ROM // code or variables mapped to ROM (i.e. flash)249249- // usage: CONST BYTE ROM foo = 0x00;250250+#define NEAR idata // variables mapped to internal data storage location251251+#define FAR xhuge // variables mapped to external data storage location252252+#define CONST const // variables mapped to ROM (i.e. flash)253253+#define ROM // code or variables mapped to ROM (i.e. flash)254254+ // usage: CONST BYTE ROM foo = 0x00;250255// #define HWACC sdata // hardware access through external memory (i.e. CAN)251251- #define HWACC huge // hardware access through external memory (i.e. CAN)252252- #define LARGE // functions set parameters to external data storage location256256+#define HWACC huge // hardware access through external memory (i.e. CAN)257257+#define LARGE // functions set parameters to external data storage location253258254259 // These types can be adjusted by users to match application requirements. The goal is to255260 // minimize code memory and maximize speed.256256- #define GENERIC xhuge // generic pointer to point to application data257257- // Variables with this attribute can be located in external258258- // or internal data memory.259259- #define MEM // Memory attribute to optimize speed and code of pointer access.261261+#define GENERIC xhuge // generic pointer to point to application data262262+ // Variables with this attribute can be located in external263263+ // or internal data memory.264264+#define MEM // Memory attribute to optimize speed and code of pointer access.260265261261- #define REENTRANT262262- #define PUBLIC266266+#define REENTRANT267267+#define PUBLIC263268264264- #ifndef NDEBUG265265- #include <stdio.h> // prototype printf() (for TRACE)266266- #define TRACE printf267267- #endif269269+#ifndef NDEBUG270270+#include <stdio.h> // prototype printf() (for TRACE)271271+#define TRACE printf272272+#endif268273269274//---------------------------------------------------------------------------270275// definitions for MPLAB C30 for dsPIC33F series271276//---------------------------------------------------------------------------272277#elif defined (__C30__)273278274274- #define TARGET_SYSTEM _NO_OS_275275- #define DEV_SYSTEM _DEV_MPLAB_DSPIC33F_279279+#define TARGET_SYSTEM _NO_OS_280280+#define DEV_SYSTEM _DEV_MPLAB_DSPIC33F_276281277277- #define NEAR // variables mapped to internal data storage location278278- #define FAR // variables mapped to external data storage location279279- #define CONST const // variables mapped to ROM (i.e. flash)280280- #define ROM // code or variables mapped to ROM (i.e. flash)281281- // usage: CONST BYTE ROM foo = 0x00;282282- #define HWACC // hardware access through external memory (i.e. CAN)283283- #define LARGE // functions set parameters to external data storage location282282+#define NEAR // variables mapped to internal data storage location283283+#define FAR // variables mapped to external data storage location284284+#define CONST const // variables mapped to ROM (i.e. flash)285285+#define ROM // code or variables mapped to ROM (i.e. flash)286286+ // usage: CONST BYTE ROM foo = 0x00;287287+#define HWACC // hardware access through external memory (i.e. CAN)288288+#define LARGE // functions set parameters to external data storage location284289285290 // These types can be adjusted by users to match application requirements. The goal is to286291 // minimize code memory and maximize speed.287287- #define GENERIC // generic pointer to point to application data288288- // Variables with this attribute can be located in external289289- // or internal data memory.290290- #define MEM // Memory attribute to optimize speed and code of pointer access.292292+#define GENERIC // generic pointer to point to application data293293+ // Variables with this attribute can be located in external294294+ // or internal data memory.295295+#define MEM // Memory attribute to optimize speed and code of pointer access.291296292292- #define REENTRANT293293- #define PUBLIC297297+#define REENTRANT298298+#define PUBLIC294299295300// #ifndef QWORD296301// #define QWORD long long297302// #endif298303299299- #ifndef NDEBUG300300- #include <stdio.h> // prototype printf() (for TRACE)301301- #define TRACE printf302302- #endif304304+#ifndef NDEBUG305305+#include <stdio.h> // prototype printf() (for TRACE)306306+#define TRACE printf307307+#endif303308304309//---------------------------------------------------------------------------305310// definitions for Keil ARM306311//---------------------------------------------------------------------------307312#elif defined (__CA__)308313309309- #define TARGET_SYSTEM _NO_OS_310310- #define DEV_SYSTEM _DEV_KEIL_CARM_314314+#define TARGET_SYSTEM _NO_OS_315315+#define DEV_SYSTEM _DEV_KEIL_CARM_311316312312- #define NEAR // variables mapped to internal data storage location313313- #define FAR // variables mapped to external data storage location314314- #define CONST const // variables mapped to ROM (i.e. flash)315315- #define ROM // code or variables mapped to ROM (i.e. flash)316316- // usage: CONST BYTE ROM foo = 0x00;317317- #define HWACC // hardware access through external memory (i.e. CAN)318318- #define LARGE // functions set parameters to external data storage location317317+#define NEAR // variables mapped to internal data storage location318318+#define FAR // variables mapped to external data storage location319319+#define CONST const // variables mapped to ROM (i.e. flash)320320+#define ROM // code or variables mapped to ROM (i.e. flash)321321+ // usage: CONST BYTE ROM foo = 0x00;322322+#define HWACC // hardware access through external memory (i.e. CAN)323323+#define LARGE // functions set parameters to external data storage location319324320325 // These types can be adjusted by users to match application requirements. The goal is to321326 // minimize code memory and maximize speed.322322- #define GENERIC // generic pointer to point to application data323323- // Variables with this attribute can be located in external324324- // or internal data memory.325325- #define MEM // Memory attribute to optimize speed and code of pointer access.327327+#define GENERIC // generic pointer to point to application data328328+ // Variables with this attribute can be located in external329329+ // or internal data memory.330330+#define MEM // Memory attribute to optimize speed and code of pointer access.326331327327- #define REENTRANT328328- #define PUBLIC332332+#define REENTRANT333333+#define PUBLIC329334330330- #ifndef QWORD331331- #define QWORD long long332332- #endif335335+#ifndef QWORD336336+#define QWORD long long337337+#endif333338334334- #ifndef NDEBUG335335- #include <stdio.h> // prototype printf() (for TRACE)336336- #define TRACE printf337337- #endif339339+#ifndef NDEBUG340340+#include <stdio.h> // prototype printf() (for TRACE)341341+#define TRACE printf342342+#endif338343339344//---------------------------------------------------------------------------340345// definitions for RealView ARM compilation tools (provided by recent Keil Microcontroller Development Kits)341346//---------------------------------------------------------------------------342347#elif defined (__ARMCC_VERSION)343348344344- #define TARGET_SYSTEM _NO_OS_345345- #define DEV_SYSTEM _DEV_RVCT_CARM_349349+#define TARGET_SYSTEM _NO_OS_350350+#define DEV_SYSTEM _DEV_RVCT_CARM_346351347347- #define NEAR // variables mapped to internal data storage location348348- #define FAR // variables mapped to external data storage location349349- #define CONST const // variables mapped to ROM (i.e. flash)350350- #define ROM // code or variables mapped to ROM (i.e. flash)351351- // usage: CONST BYTE ROM foo = 0x00;352352- #define HWACC // hardware access through external memory (i.e. CAN)353353- #define LARGE // functions set parameters to external data storage location352352+#define NEAR // variables mapped to internal data storage location353353+#define FAR // variables mapped to external data storage location354354+#define CONST const // variables mapped to ROM (i.e. flash)355355+#define ROM // code or variables mapped to ROM (i.e. flash)356356+ // usage: CONST BYTE ROM foo = 0x00;357357+#define HWACC // hardware access through external memory (i.e. CAN)358358+#define LARGE // functions set parameters to external data storage location354359355360 // These types can be adjusted by users to match application requirements. The goal is to356361 // minimize code memory and maximize speed.357357- #define GENERIC // generic pointer to point to application data358358- // Variables with this attribute can be located in external359359- // or internal data memory.360360- #define MEM // Memory attribute to optimize speed and code of pointer access.362362+#define GENERIC // generic pointer to point to application data363363+ // Variables with this attribute can be located in external364364+ // or internal data memory.365365+#define MEM // Memory attribute to optimize speed and code of pointer access.361366362362- #define REENTRANT363363- #define PUBLIC367367+#define REENTRANT368368+#define PUBLIC364369365365- #ifndef QWORD366366- #define QWORD long long367367- #endif370370+#ifndef QWORD371371+#define QWORD long long372372+#endif368373369369- #ifndef NDEBUG370370- #define ASSERT(expr) if (!(expr)) {\374374+#ifndef NDEBUG375375+#define ASSERT(expr) if (!(expr)) {\371376 TRACE0 ("Assertion failed: " #expr );\372377 while (1);}373373- #else374374- #define ASSERT(expr)375375- #endif378378+#else379379+#define ASSERT(expr)380380+#endif376381377377- #ifndef NDEBUG378378- #include <stdio.h> // prototype printf() (for TRACE)379379- #define TRACE printf380380- #endif382382+#ifndef NDEBUG383383+#include <stdio.h> // prototype printf() (for TRACE)384384+#define TRACE printf385385+#endif381386382387//---------------------------------------------------------------------------383388// definitions for ARM IAR C Compiler384389//---------------------------------------------------------------------------385390#elif defined (__ICCARM__)386391387387- #define TARGET_SYSTEM _NO_OS_388388- #define DEV_SYSTEM _DEV_IAR_CARM_392392+#define TARGET_SYSTEM _NO_OS_393393+#define DEV_SYSTEM _DEV_IAR_CARM_389394390390- #define NEAR // variables mapped to internal data storage location391391- #define FAR // variables mapped to external data storage location392392- #define CONST const // variables mapped to ROM (i.e. flash)393393- #define ROM // code or variables mapped to ROM (i.e. flash)394394- // usage: CONST BYTE ROM foo = 0x00;395395- #define HWACC // hardware access through external memory (i.e. CAN)396396- #define LARGE // functions set parameters to external data storage location395395+#define NEAR // variables mapped to internal data storage location396396+#define FAR // variables mapped to external data storage location397397+#define CONST const // variables mapped to ROM (i.e. flash)398398+#define ROM // code or variables mapped to ROM (i.e. flash)399399+ // usage: CONST BYTE ROM foo = 0x00;400400+#define HWACC // hardware access through external memory (i.e. CAN)401401+#define LARGE // functions set parameters to external data storage location397402398403 // These types can be adjusted by users to match application requirements. The goal is to399404 // minimize code memory and maximize speed.400400- #define GENERIC // generic pointer to point to application data401401- // Variables with this attribute can be located in external402402- // or internal data memory.403403- #define MEM // Memory attribute to optimize speed and code of pointer access.405405+#define GENERIC // generic pointer to point to application data406406+ // Variables with this attribute can be located in external407407+ // or internal data memory.408408+#define MEM // Memory attribute to optimize speed and code of pointer access.404409405405- #define REENTRANT406406- #define PUBLIC410410+#define REENTRANT411411+#define PUBLIC407412408408- #ifndef QWORD409409- #define QWORD long long410410- #endif413413+#ifndef QWORD414414+#define QWORD long long415415+#endif411416412417 // Workaround:413418 // If we use IAR and want to debug but don't want to use C-Spy Debugger414419 // assert() doesn't work in debug mode because it needs support for FILE descriptors415420 // (_DLIB_FILE_DESCRIPTOR == 1).416416- #ifndef NDEBUG417417- #define ASSERT(expr) if (!(expr)) {\421421+#ifndef NDEBUG422422+#define ASSERT(expr) if (!(expr)) {\418423 TRACE0 ("Assertion failed: " #expr );\419424 while (1);}420420- #else421421- #define ASSERT(expr)422422- #endif425425+#else426426+#define ASSERT(expr)427427+#endif423428424424- #ifndef NDEBUG425425- #include <stdio.h> // prototype printf() (for TRACE)426426- #define TRACE printf429429+#ifndef NDEBUG430430+#include <stdio.h> // prototype printf() (for TRACE)431431+#define TRACE printf427432// #define TRACE PRINTF4428428- #endif433433+#endif429434430435//---------------------------------------------------------------------------431436// definitions for Tasking 8051···433438434439#elif defined (_CC51)435440436436- #include <cc51.h>441441+#include <cc51.h>437442438438- #define TARGET_SYSTEM _NO_OS_439439- #define DEV_SYSTEM _DEV_TASKING_C51X_443443+#define TARGET_SYSTEM _NO_OS_444444+#define DEV_SYSTEM _DEV_TASKING_C51X_440445441441- #define NEAR _data // variables mapped to internal data storage location442442- #define FAR _xdat // variables mapped to external data storage location443443- #define CONST const // variables mapped to ROM (i.e. flash)444444- #define ROM // code or variables mapped to ROM (i.e. flash)445445- // usage: CONST BYTE ROM foo = 0x00;446446- #define HWACC _xdat // hardware access through external memory (i.e. CAN)447447- #define LARGE // functions set parameters to external data storage location446446+#define NEAR _data // variables mapped to internal data storage location447447+#define FAR _xdat // variables mapped to external data storage location448448+#define CONST const // variables mapped to ROM (i.e. flash)449449+#define ROM // code or variables mapped to ROM (i.e. flash)450450+ // usage: CONST BYTE ROM foo = 0x00;451451+#define HWACC _xdat // hardware access through external memory (i.e. CAN)452452+#define LARGE // functions set parameters to external data storage location448453449454 // These types can be adjusted by users to match application requirements. The goal is to450455 // minimize code memory and maximize speed.451451- #define GENERIC // generic pointer to point to application data452452- // Variables with this attribute can be located in external453453- // or internal data memory.454454- #define MEM _xdat // Memory attribute to optimize speed and code of pointer access.456456+#define GENERIC // generic pointer to point to application data457457+ // Variables with this attribute can be located in external458458+ // or internal data memory.459459+#define MEM _xdat // Memory attribute to optimize speed and code of pointer access.455460456456- #define REENTRANT _reentrant457457- #define PUBLIC461461+#define REENTRANT _reentrant462462+#define PUBLIC458463459459- #ifndef NDEBUG460460- #include <stdio.h> // prototype printf() (for TRACE)461461- #define TRACE printf462462- #endif463463-464464+#ifndef NDEBUG465465+#include <stdio.h> // prototype printf() (for TRACE)466466+#define TRACE printf467467+#endif464468465469//---------------------------------------------------------------------------466470// definitions for Tasking C167CR and C164CI···467473468474#elif defined (_C166)469475470470- #define TARGET_SYSTEM _NO_OS_471471- #define DEV_SYSTEM _DEV_TASKING_C16X_476476+#define TARGET_SYSTEM _NO_OS_477477+#define DEV_SYSTEM _DEV_TASKING_C16X_472478473473- #define NEAR near // variables mapped to internal data storage location474474- #define FAR far // variables mapped to external data storage location475475- #define CONST const // variables mapped to ROM (i.e. flash)476476- #define ROM // code or variables mapped to ROM (i.e. flash)477477- // usage: CONST BYTE ROM foo = 0x00;478478- #define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)479479- #define LARGE // functions set parameters to external data storage location479479+#define NEAR near // variables mapped to internal data storage location480480+#define FAR far // variables mapped to external data storage location481481+#define CONST const // variables mapped to ROM (i.e. flash)482482+#define ROM // code or variables mapped to ROM (i.e. flash)483483+ // usage: CONST BYTE ROM foo = 0x00;484484+#define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)485485+#define LARGE // functions set parameters to external data storage location480486481487 // These types can be adjusted by users to match application requirements. The goal is to482488 // minimize code memory and maximize speed.483483- #define GENERIC // generic pointer to point to application data484484- // Variables with this attribute can be located in external485485- // or internal data memory.486486- #define MEM // Memory attribute to optimize speed and code of pointer access.489489+#define GENERIC // generic pointer to point to application data490490+ // Variables with this attribute can be located in external491491+ // or internal data memory.492492+#define MEM // Memory attribute to optimize speed and code of pointer access.487493488488- #define REENTRANT489489- #define PUBLIC494494+#define REENTRANT495495+#define PUBLIC490496491497 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL492498 // without checking if it is already included. So an error occurs while compiling.493499 // (r.d.)494494- #include <stdio.h> // prototype printf() (for TRACE)495495- #ifndef NDEBUG496496- #define TRACE printf497497- #endif498498-500500+#include <stdio.h> // prototype printf() (for TRACE)501501+#ifndef NDEBUG502502+#define TRACE printf503503+#endif499504500505//---------------------------------------------------------------------------501506// definitions for FUJITSU FFMC-16LX MB90590···503510//#elif (defined (F590) || defined (F543) || defined (F598) || defined (F495) || defined (F350))504511#elif defined(__COMPILER_FCC907__)505512506506- #define TARGET_SYSTEM _NO_OS_507507- #define DEV_SYSTEM _DEV_FUJITSU_F590_513513+#define TARGET_SYSTEM _NO_OS_514514+#define DEV_SYSTEM _DEV_FUJITSU_F590_508515509509- #define NEAR /* to be defined */ // variables mapped to internal data storage location510510- #define FAR /* to be defined */ // variables mapped to external data storage location511511- #define CONST const // variables mapped to ROM (i.e. flash)512512- #define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)513513- // usage: CONST BYTE ROM foo = 0x00;514514- #define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)515515- #define LARGE // functions set parameters to external data storage location516516+#define NEAR /* to be defined */ // variables mapped to internal data storage location517517+#define FAR /* to be defined */ // variables mapped to external data storage location518518+#define CONST const // variables mapped to ROM (i.e. flash)519519+#define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)520520+ // usage: CONST BYTE ROM foo = 0x00;521521+#define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)522522+#define LARGE // functions set parameters to external data storage location516523517524 // These types can be adjusted by users to match application requirements. The goal is to518525 // minimize code memory and maximize speed.519519- #define GENERIC // generic pointer to point to application data520520- // Variables with this attribute can be located in external521521- // or internal data memory.522522- #define MEM // Memory attribute to optimize speed and code of pointer access.526526+#define GENERIC // generic pointer to point to application data527527+ // Variables with this attribute can be located in external528528+ // or internal data memory.529529+#define MEM // Memory attribute to optimize speed and code of pointer access.523530524531 // softune is not able to support 64 bit variables QWORD !!!525532526526- #define REENTRANT527527- #define PUBLIC533533+#define REENTRANT534534+#define PUBLIC528535529529- #ifndef NDEBUG530530- #include <stdio.h> // prototype printf() (for TRACE)531531- #define TRACE printf532532- #endif533533-536536+#ifndef NDEBUG537537+#include <stdio.h> // prototype printf() (for TRACE)538538+#define TRACE printf539539+#endif534540535541//---------------------------------------------------------------------------536542// definitions for Mitsubishi M16C family for TASKING Compiler CM16···537545538546#elif defined (_CM16C)539547540540- #define TARGET_SYSTEM _NO_OS_541541- #define DEV_SYSTEM _DEV_TASKING_M16C_548548+#define TARGET_SYSTEM _NO_OS_549549+#define DEV_SYSTEM _DEV_TASKING_M16C_542550543543- #define NEAR _near // variables mapped to internal data storage location544544- #define FAR _far // variables mapped to external data storage location545545- #define CONST _farrom // variables mapped to ROM (i.e. flash)546546- #define ROM // code or variables mapped to ROM (i.e. flash)547547- // usage: CONST BYTE ROM foo = 0x00;548548- #define HWACC _near // hardware access through external memory (i.e. CAN)549549- #define LARGE // functions set parameters to external data storage location551551+#define NEAR _near // variables mapped to internal data storage location552552+#define FAR _far // variables mapped to external data storage location553553+#define CONST _farrom // variables mapped to ROM (i.e. flash)554554+#define ROM // code or variables mapped to ROM (i.e. flash)555555+ // usage: CONST BYTE ROM foo = 0x00;556556+#define HWACC _near // hardware access through external memory (i.e. CAN)557557+#define LARGE // functions set parameters to external data storage location550558551559 // These types can be adjusted by users to match application requirements. The goal is to552560 // minimize code memory and maximize speed.553553- #define GENERIC _far // generic pointer to point to application data554554- // Variables with this attribute can be located in external555555- // or internal data memory.556556- // do you use memory model SMALL, than you have to set _far557557- #define MEM // Memory attribute to optimize speed and code of pointer access.561561+#define GENERIC _far // generic pointer to point to application data562562+ // Variables with this attribute can be located in external563563+ // or internal data memory.564564+ // do you use memory model SMALL, than you have to set _far565565+#define MEM // Memory attribute to optimize speed and code of pointer access.558566559559- #define REENTRANT560560- #define PUBLIC567567+#define REENTRANT568568+#define PUBLIC561569562570 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL563571 // without checking if it is already included. So an error occurs while compiling.564572 // (r.d.)565565- #include <stdio.h> // prototype printf() (for TRACE)566566- #ifndef NDEBUG567567- #define TRACE printf568568- #endif569569-573573+#include <stdio.h> // prototype printf() (for TRACE)574574+#ifndef NDEBUG575575+#define TRACE printf576576+#endif570577571578//---------------------------------------------------------------------------572579// definitions for Mitsubishi M16C family for Mitsubishi Compiler NC30···573582// name NC30, andere Form will der Compiler nicht !!574583#elif defined (NC30)575584576576- #define TARGET_SYSTEM _NO_OS_577577- #define DEV_SYSTEM _DEV_MITSUBISHI_M16C_585585+#define TARGET_SYSTEM _NO_OS_586586+#define DEV_SYSTEM _DEV_MITSUBISHI_M16C_578587579579- #define NEAR near // variables mapped to internal data storage location580580- #define FAR far // variables mapped to external data storage location581581- #define CONST const // variables mapped to ROM (i.e. flash)582582- #define ROM // code or variables mapped to ROM (i.e. flash)583583- // usage: CONST BYTE ROM foo = 0x00;584584- #define HWACC near // hardware access through external memory (i.e. CAN)585585- #define LARGE // functions set parameters to external data storage location588588+#define NEAR near // variables mapped to internal data storage location589589+#define FAR far // variables mapped to external data storage location590590+#define CONST const // variables mapped to ROM (i.e. flash)591591+#define ROM // code or variables mapped to ROM (i.e. flash)592592+ // usage: CONST BYTE ROM foo = 0x00;593593+#define HWACC near // hardware access through external memory (i.e. CAN)594594+#define LARGE // functions set parameters to external data storage location586595587596 // These types can be adjusted by users to match application requirements. The goal is to588597 // minimize code memory and maximize speed.589589- #define GENERIC far // generic pointer to point to application data590590- // Variables with this attribute can be located in external591591- // or internal data memory.592592- #define MEM // Memory attribute to optimize speed and code of pointer access.598598+#define GENERIC far // generic pointer to point to application data599599+ // Variables with this attribute can be located in external600600+ // or internal data memory.601601+#define MEM // Memory attribute to optimize speed and code of pointer access.593602594594- #define REENTRANT595595- #define PUBLIC603603+#define REENTRANT604604+#define PUBLIC596605597597- #ifndef NDEBUG598598- #include <stdio.h> // prototype printf() (for TRACE)599599- #define TRACE printf600600- #endif606606+#ifndef NDEBUG607607+#include <stdio.h> // prototype printf() (for TRACE)608608+#define TRACE printf609609+#endif601610602611//---------------------------------------------------------------------------603612// definitions for Renesas M32C family for Renesas Compiler604613//---------------------------------------------------------------------------605614#elif defined (NC308)606615607607- #define TARGET_SYSTEM _NO_OS_608608- #define DEV_SYSTEM _DEV_RENESAS_M32C_616616+#define TARGET_SYSTEM _NO_OS_617617+#define DEV_SYSTEM _DEV_RENESAS_M32C_609618610610- #define NEAR near // variables mapped to internal data storage location611611- #define FAR far // variables mapped to external data storage location612612- #define CONST const // variables mapped to ROM (i.e. flash)613613- #define ROM // code or variables mapped to ROM (i.e. flash)614614- #define HWACC // hardware access through external memory (i.e. CAN)615615- #define LARGE // functions set parameters to external data storage location619619+#define NEAR near // variables mapped to internal data storage location620620+#define FAR far // variables mapped to external data storage location621621+#define CONST const // variables mapped to ROM (i.e. flash)622622+#define ROM // code or variables mapped to ROM (i.e. flash)623623+#define HWACC // hardware access through external memory (i.e. CAN)624624+#define LARGE // functions set parameters to external data storage location616625617626 // These types can be adjusted by users to match application requirements. The goal is to618627 // minimize code memory and maximize speed.619619- #define GENERIC // generic pointer to point to application data620620- // Variables with this attribute can be located in external621621- // or internal data memory.622622- #define MEM far // Memory attribute to optimize speed and code of pointer access.628628+#define GENERIC // generic pointer to point to application data629629+ // Variables with this attribute can be located in external630630+ // or internal data memory.631631+#define MEM far // Memory attribute to optimize speed and code of pointer access.623632624624- #define REENTRANT625625- #define PUBLIC633633+#define REENTRANT634634+#define PUBLIC626635627627- #ifndef NDEBUG628628- #include <stdio.h> // prototype printf() (for TRACE)629629- #define TRACE printf630630- #endif636636+#ifndef NDEBUG637637+#include <stdio.h> // prototype printf() (for TRACE)638638+#define TRACE printf639639+#endif631640632641// #error ("RENESAS o.k.")633642···637646638647#elif defined(__GNUC__) && defined(__arm__) && !defined(__LINUX_ARM_ARCH__)639648640640- #define TARGET_SYSTEM _NO_OS_641641- #define DEV_SYSTEM _DEV_GNU_ARM7_649649+#define TARGET_SYSTEM _NO_OS_650650+#define DEV_SYSTEM _DEV_GNU_ARM7_642651643643- #define NEAR // variables mapped to internal data storage location644644- #define FAR // variables mapped to external data storage location645645- #define CONST const // variables mapped to ROM (i.e. flash)646646- #define ROM // code or variables mapped to ROM (i.e. flash)647647- // usage: CONST BYTE ROM foo = 0x00;648648- #define HWACC // hardware access through external memory (i.e. CAN)649649- #define LARGE // functions set parameters to external data storage location652652+#define NEAR // variables mapped to internal data storage location653653+#define FAR // variables mapped to external data storage location654654+#define CONST const // variables mapped to ROM (i.e. flash)655655+#define ROM // code or variables mapped to ROM (i.e. flash)656656+ // usage: CONST BYTE ROM foo = 0x00;657657+#define HWACC // hardware access through external memory (i.e. CAN)658658+#define LARGE // functions set parameters to external data storage location650659651660 // These types can be adjusted by users to match application requirements. The goal is to652661 // minimize code memory and maximize speed.653653- #define GENERIC // generic pointer to point to application data654654- // Variables with this attribute can be located in external655655- // or internal data memory.656656- #define MEM // Memory attribute to optimize speed and code of pointer access.657657- #define HWACC // hardware access through external memory (i.e. CAN)662662+#define GENERIC // generic pointer to point to application data663663+ // Variables with this attribute can be located in external664664+ // or internal data memory.665665+#define MEM // Memory attribute to optimize speed and code of pointer access.666666+#define HWACC // hardware access through external memory (i.e. CAN)658667659659- #define REENTRANT660660- #define PUBLIC668668+#define REENTRANT669669+#define PUBLIC661670662662- #ifndef QWORD663663- #define QWORD long long // i.A. durch Herr Kuschel664664- #endif671671+#ifndef QWORD672672+#define QWORD long long // i.A. durch Herr Kuschel673673+#endif665674666666- #ifndef NDEBUG667667- #include <stdio.h> // prototype printf() (for TRACE)668668- #define TRACE printf669669- #endif670670-675675+#ifndef NDEBUG676676+#include <stdio.h> // prototype printf() (for TRACE)677677+#define TRACE printf678678+#endif671679672680//---------------------------------------------------------------------------673681// definitions for Motorola PowerPC family 5x5 (555/565)···675685676686#elif defined (__GNUC__)677687678678- #if defined (LINUX) || defined (linux) || defined (__linux__)679679- #define LINUX_SYSTEM // define 'LINUX_SYSTEM' uniform for all Linux based systems680680- // r.d.: We will need an other solution here! There are two sections here which do check the preproc-definitions:681681- // LINUX and __linux__ . The first one was Linux for PC, the second one is this section for embedded Linux (MCF5xxx).682682- // But Linux for PC does not need the definitions for embedded Linux.683683- #endif688688+#if defined (LINUX) || defined (linux) || defined (__linux__)689689+#define LINUX_SYSTEM // define 'LINUX_SYSTEM' uniform for all Linux based systems690690+ // r.d.: We will need an other solution here! There are two sections here which do check the preproc-definitions:691691+ // LINUX and __linux__ . The first one was Linux for PC, the second one is this section for embedded Linux (MCF5xxx).692692+ // But Linux for PC does not need the definitions for embedded Linux.693693+#endif684694685695 // GNU C compiler supports function inlining686686- #define INLINE_FUNCTION_DEF extern inline696696+#define INLINE_FUNCTION_DEF extern inline687697688698 // to actually enable inlining just include the following three lines689699 // #undef INLINE_FUNCTION690700 // #define INLINE_FUNCTION INLINE_FUNCTION_DEF691701 // #define INLINE_ENABLED TRUE692702693693- #ifdef PXROS694694- #define TARGET_SYSTEM _PXROS_695695- #ifdef __i386__696696- #undef LINUX // this define seems to be set from compiler697697- #define DEV_SYSTEM _DEV_HIGHTEC_X86_698698- #elif defined (__tricore__)699699- #define DEV_SYSTEM _DEV_GNU_TRICORE_700700- #else // MPC5x5701701- #define DEV_SYSTEM _DEV_GNU_MPC5X5_702702- #endif703703+#ifdef PXROS704704+#define TARGET_SYSTEM _PXROS_705705+#ifdef __i386__706706+#undef LINUX // this define seems to be set from compiler707707+#define DEV_SYSTEM _DEV_HIGHTEC_X86_708708+#elif defined (__tricore__)709709+#define DEV_SYSTEM _DEV_GNU_TRICORE_710710+#else // MPC5x5711711+#define DEV_SYSTEM _DEV_GNU_MPC5X5_712712+#endif703713704704- #elif defined (LINUX) || defined (__linux__)705705- #define TARGET_SYSTEM _LINUX_ // Linux definition706706- #define DEV_SYSTEM _DEV_LINUX_714714+#elif defined (LINUX) || defined (__linux__)715715+#define TARGET_SYSTEM _LINUX_ // Linux definition716716+#define DEV_SYSTEM _DEV_LINUX_707717708708- #elif defined (GNU_CF5282)709709- #define TARGET_SYSTEM _NO_OS_710710- #define DEV_SYSTEM _DEV_GNU_CF5282_718718+#elif defined (GNU_CF5282)719719+#define TARGET_SYSTEM _NO_OS_720720+#define DEV_SYSTEM _DEV_GNU_CF5282_711721712712- #elif defined (ECOSPRO_I386_PEAK_PCI)713713- #define TARGET_SYSTEM _ECOSPRO_714714- #define DEV_SYSTEM _DEV_GNU_I386_722722+#elif defined (ECOSPRO_I386_PEAK_PCI)723723+#define TARGET_SYSTEM _ECOSPRO_724724+#define DEV_SYSTEM _DEV_GNU_I386_715725716716- #elif defined (GNU_CF548X)717717- #define TARGET_SYSTEM _NO_OS_718718- #define DEV_SYSTEM _DEV_GNU_CF548X_719719- #else720720- #error 'ERROR: DEV_SYSTEM not found!'721721- #endif726726+#elif defined (GNU_CF548X)727727+#define TARGET_SYSTEM _NO_OS_728728+#define DEV_SYSTEM _DEV_GNU_CF548X_729729+#else730730+#error 'ERROR: DEV_SYSTEM not found!'731731+#endif722732733733+#ifndef QWORD734734+#define QWORD long long int735735+#endif723736724724- #ifndef QWORD725725- #define QWORD long long int726726- #endif737737+#if (TARGET_SYSTEM == _PXROS_)727738728728- #if (TARGET_SYSTEM == _PXROS_)739739+#ifndef __KERNEL__740740+#include <string.h>741741+#endif729742730730- #ifndef __KERNEL__731731- #include <string.h>732732- #endif743743+#define NEAR // variables mapped to internal data storage location744744+#define FAR // variables mapped to external data storage location745745+#define CONST const // variables mapped to ROM (i.e. flash)746746+#define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)747747+ // usage: CONST BYTE ROM foo = 0x00;748748+#define LARGE // functions set parameters to external data storage location733749750750+ // These types can be adjusted by users to match application requirements. The goal is to751751+ // minimize code memory and maximize speed.752752+#define GENERIC // generic pointer to point to application data753753+ // Variables with this attribute can be located in external754754+ // or internal data memory.755755+#define MEM // Memory attribute to optimize speed and code of pointer access.734756735735- #define NEAR // variables mapped to internal data storage location736736- #define FAR // variables mapped to external data storage location737737- #define CONST const // variables mapped to ROM (i.e. flash)738738- #define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)739739- // usage: CONST BYTE ROM foo = 0x00;740740- #define LARGE // functions set parameters to external data storage location757757+#define HWACC // hardware access through external memory (i.e. CAN)741758742742- // These types can be adjusted by users to match application requirements. The goal is to743743- // minimize code memory and maximize speed.744744- #define GENERIC // generic pointer to point to application data745745- // Variables with this attribute can be located in external746746- // or internal data memory.747747- #define MEM // Memory attribute to optimize speed and code of pointer access.759759+#define REENTRANT760760+#define PUBLIC748761749749- #define HWACC // hardware access through external memory (i.e. CAN)762762+#ifndef QWORD763763+#define QWORD long long int764764+#endif750765751751- #define REENTRANT752752- #define PUBLIC766766+#ifndef NDEBUG767767+#include <stdio.h> // prototype printf() (for TRACE)768768+#define TRACE printf769769+#endif753770754754- #ifndef QWORD755755- #define QWORD long long int756756- #endif757757-758758- #ifndef NDEBUG759759- #include <stdio.h> // prototype printf() (for TRACE)760760- #define TRACE printf761761- #endif762762-763763- #endif771771+#endif764772765773 // ------------------ GNUC for I386 ---------------------------------------------766774767767- #if (TARGET_SYSTEM == _LINUX_) || (TARGET_SYSTEM == _ECOSPRO_)775775+#if (TARGET_SYSTEM == _LINUX_) || (TARGET_SYSTEM == _ECOSPRO_)768776769769- #ifndef __KERNEL__770770- #include <string.h>771771- #endif777777+#ifndef __KERNEL__778778+#include <string.h>779779+#endif772780773773- #define ROM // code or variables mapped to ROM (i.e. flash)774774- // usage: CONST BYTE ROM foo = 0x00;775775- #define HWACC // hardware access through external memory (i.e. CAN)781781+#define ROM // code or variables mapped to ROM (i.e. flash)782782+ // usage: CONST BYTE ROM foo = 0x00;783783+#define HWACC // hardware access through external memory (i.e. CAN)776784777777- // These types can be adjusted by users to match application requirements. The goal is to778778- // minimize code memory and maximize speed.779779- #define GENERIC // generic pointer to point to application data780780- // Variables with this attribute can be located in external781781- // or internal data memory.782782- #define MEM // Memory attribute to optimize speed and code of pointer access.785785+ // These types can be adjusted by users to match application requirements. The goal is to786786+ // minimize code memory and maximize speed.787787+#define GENERIC // generic pointer to point to application data788788+ // Variables with this attribute can be located in external789789+ // or internal data memory.790790+#define MEM // Memory attribute to optimize speed and code of pointer access.783791784784- #ifndef NEAR785785- #define NEAR // variables mapped to internal data storage location786786- #endif792792+#ifndef NEAR793793+#define NEAR // variables mapped to internal data storage location794794+#endif787795788788- #ifndef FAR789789- #define FAR // variables mapped to external data storage location790790- #endif796796+#ifndef FAR797797+#define FAR // variables mapped to external data storage location798798+#endif791799792792- #ifndef CONST793793- #define CONST const // variables mapped to ROM (i.e. flash)794794- #endif800800+#ifndef CONST801801+#define CONST const // variables mapped to ROM (i.e. flash)802802+#endif795803796796- #define LARGE804804+#define LARGE797805798798- #define REENTRANT799799- #define PUBLIC806806+#define REENTRANT807807+#define PUBLIC800808801801- #ifndef NDEBUG802802- #ifndef __KERNEL__803803- #include <stdio.h> // prototype printf() (for TRACE)804804- #define TRACE printf805805- #else806806- #define TRACE printk807807- #endif808808- #endif809809- #endif809809+#ifndef NDEBUG810810+#ifndef __KERNEL__811811+#include <stdio.h> // prototype printf() (for TRACE)812812+#define TRACE printf813813+#else814814+#define TRACE printk815815+#endif816816+#endif817817+#endif810818811819 // ------------------ GNU without OS ---------------------------------------------812820813813- #if (TARGET_SYSTEM == _NO_OS_)821821+#if (TARGET_SYSTEM == _NO_OS_)814822815815- #define ROM // code or variables mapped to ROM (i.e. flash)816816- // usage: CONST BYTE ROM foo = 0x00;817817- #define HWACC // hardware access through external memory (i.e. CAN)823823+#define ROM // code or variables mapped to ROM (i.e. flash)824824+ // usage: CONST BYTE ROM foo = 0x00;825825+#define HWACC // hardware access through external memory (i.e. CAN)818826819819- // These types can be adjusted by users to match application requirements. The goal is to820820- // minimize code memory and maximize speed.821821- #define GENERIC // generic pointer to point to application data822822- // Variables with this attribute can be located in external823823- // or internal data memory.824824- #define MEM // Memory attribute to optimize speed and code of pointer access.827827+ // These types can be adjusted by users to match application requirements. The goal is to828828+ // minimize code memory and maximize speed.829829+#define GENERIC // generic pointer to point to application data830830+ // Variables with this attribute can be located in external831831+ // or internal data memory.832832+#define MEM // Memory attribute to optimize speed and code of pointer access.825833826826- #ifndef NEAR827827- #define NEAR // variables mapped to internal data storage location828828- #endif834834+#ifndef NEAR835835+#define NEAR // variables mapped to internal data storage location836836+#endif829837830830- #ifndef FAR831831- #define FAR // variables mapped to external data storage location832832- #endif838838+#ifndef FAR839839+#define FAR // variables mapped to external data storage location840840+#endif833841834834- #ifndef CONST835835- #define CONST const // variables mapped to ROM (i.e. flash)836836- #endif842842+#ifndef CONST843843+#define CONST const // variables mapped to ROM (i.e. flash)844844+#endif837845838838- #define LARGE846846+#define LARGE839847840840- #define REENTRANT841841- #define PUBLIC848848+#define REENTRANT849849+#define PUBLIC842850843843- #ifndef NDEBUG851851+#ifndef NDEBUG844852// #include "xuartdrv.h"845853// #include <stdio.h> // prototype printf() (for TRACE)846846- #define TRACE printf854854+#define TRACE printf847855// #define TRACE mprintf848856// #ifndef TRACE849857// #define TRACE trace850858// void trace (char *fmt, ...);851859// #endif852852- #endif860860+#endif853861854854- #endif862862+#endif855863856864//---------------------------------------------------------------------------857865// definitions for MPC565858866//---------------------------------------------------------------------------859867#elif __MWERKS__860868861861-862869#ifdef __MC68K__863870864864- #define TARGET_SYSTEM = _MCF548X_865865- #define DEV_SYSTEM _DEV_MCW_MCF5XXX_871871+#define TARGET_SYSTEM = _MCF548X_872872+#define DEV_SYSTEM _DEV_MCW_MCF5XXX_866873867874#else868868- #define TARGET_SYSTEM = _MPC565_869869- #define DEV_SYSTEM _DEV_MCW_MPC5X5_875875+#define TARGET_SYSTEM = _MPC565_876876+#define DEV_SYSTEM _DEV_MCW_MPC5X5_870877#endif871878872872- #define NEAR // variables mapped to internal data storage location873873- #define FAR // variables mapped to external data storage location874874- #define CONST const // variables mapped to ROM (i.e. flash)875875- #define ROM // code or variables mapped to ROM (i.e. flash)876876- // usage: CONST BYTE ROM foo = 0x00;877877- #define LARGE // functions set parameters to external data storage location879879+#define NEAR // variables mapped to internal data storage location880880+#define FAR // variables mapped to external data storage location881881+#define CONST const // variables mapped to ROM (i.e. flash)882882+#define ROM // code or variables mapped to ROM (i.e. flash)883883+ // usage: CONST BYTE ROM foo = 0x00;884884+#define LARGE // functions set parameters to external data storage location878885879886 // These types can be adjusted by users to match application requirements. The goal is to880887 // minimize code memory and maximize speed.881881- #define GENERIC // generic pointer to point to application data882882- // Variables with this attribute can be located in external883883- // or internal data memory.884884- #define MEM // Memory attribute to optimize speed and code of pointer access.888888+#define GENERIC // generic pointer to point to application data889889+ // Variables with this attribute can be located in external890890+ // or internal data memory.891891+#define MEM // Memory attribute to optimize speed and code of pointer access.885892886886- #define HWACC // hardware access through external memory (i.e. CAN)893893+#define HWACC // hardware access through external memory (i.e. CAN)887894888888- #define REENTRANT889889- #define PUBLIC895895+#define REENTRANT896896+#define PUBLIC890897891891- #ifndef NDEBUG892892- #include <stdio.h> // prototype printf() (for TRACE)893893- #define TRACE printf894894- #endif898898+#ifndef NDEBUG899899+#include <stdio.h> // prototype printf() (for TRACE)900900+#define TRACE printf901901+#endif895902896903//---------------------------------------------------------------------------897904// definitions for BECK 1x3898905//---------------------------------------------------------------------------899906#elif defined (__BORLANDC__) && defined (__PARADIGM__)900907908908+#define TARGET_SYSTEM _NO_OS_909909+#define DEV_SYSTEM _DEV_PAR_BECK1X3_901910902902- #define TARGET_SYSTEM _NO_OS_903903- #define DEV_SYSTEM _DEV_PAR_BECK1X3_904904-905905-906906-907907- #define ROM // code or variables mapped to ROM (i.e. flash)908908- // usage: CONST BYTE ROM foo = 0x00;909909- #define HWACC // hardware access through external memory (i.e. CAN)911911+#define ROM // code or variables mapped to ROM (i.e. flash)912912+ // usage: CONST BYTE ROM foo = 0x00;913913+#define HWACC // hardware access through external memory (i.e. CAN)910914911915 // These types can be adjusted by users to match application requirements. The goal is to912916 // minimize code memory and maximize speed.913913- #define GENERIC // generic pointer to point to application data914914- // Variables with this attribute can be located in external915915- // or internal data memory.916916- #define MEM // Memory attribute to optimize speed and code of pointer access.917917- #define NEAR __near // variables mapped to internal data storage location918918- #define FAR __far // variables mapped to external data storage location919919- #define CONST const // variables mapped to ROM (i.e. flash)920920- #define LARGE917917+#define GENERIC // generic pointer to point to application data918918+ // Variables with this attribute can be located in external919919+ // or internal data memory.920920+#define MEM // Memory attribute to optimize speed and code of pointer access.921921+#define NEAR __near // variables mapped to internal data storage location922922+#define FAR __far // variables mapped to external data storage location923923+#define CONST const // variables mapped to ROM (i.e. flash)924924+#define LARGE921925922922- #define REENTRANT923923- #define PUBLIC926926+#define REENTRANT927927+#define PUBLIC924928925925- #ifndef NDEBUG926926- #ifndef TRACE927927- #include <stdio.h>928928- #define TRACE printf929929- #endif930930- #endif931931-932932-929929+#ifndef NDEBUG930930+#ifndef TRACE931931+#include <stdio.h>932932+#define TRACE printf933933+#endif934934+#endif933935934936//---------------------------------------------------------------------------935937// definitions for PC···931949932950 // ------------------ definition target system --------------------------933951934934- #ifdef _WIN32935935- #define TARGET_SYSTEM _WIN32_ // WIN32 definition936936- #define DEV_SYSTEM _DEV_WIN32_937937- #else938938- #define TARGET_SYSTEM _DOS_939939- #define DEV_SYSTEM _DEV_BORLAND_DOS_940940- #endif941941-952952+#ifdef _WIN32953953+#define TARGET_SYSTEM _WIN32_ // WIN32 definition954954+#define DEV_SYSTEM _DEV_WIN32_955955+#else956956+#define TARGET_SYSTEM _DOS_957957+#define DEV_SYSTEM _DEV_BORLAND_DOS_958958+#endif942959943960 // ------------------ WIN32 ---------------------------------------------944961945945- #if (TARGET_SYSTEM == _WIN32_)962962+#if (TARGET_SYSTEM == _WIN32_)946963947947- #define ROM // code or variables mapped to ROM (i.e. flash)948948- // usage: CONST BYTE ROM foo = 0x00;949949- #define HWACC // hardware access through external memory (i.e. CAN)964964+#define ROM // code or variables mapped to ROM (i.e. flash)965965+ // usage: CONST BYTE ROM foo = 0x00;966966+#define HWACC // hardware access through external memory (i.e. CAN)950967951951- // These types can be adjusted by users to match application requirements. The goal is to952952- // minimize code memory and maximize speed.953953- #define GENERIC // generic pointer to point to application data954954- // Variables with this attribute can be located in external955955- // or internal data memory.956956- #define MEM // Memory attribute to optimize speed and code of pointer access.968968+ // These types can be adjusted by users to match application requirements. The goal is to969969+ // minimize code memory and maximize speed.970970+#define GENERIC // generic pointer to point to application data971971+ // Variables with this attribute can be located in external972972+ // or internal data memory.973973+#define MEM // Memory attribute to optimize speed and code of pointer access.957974958958- #ifndef NEAR959959- #define NEAR // variables mapped to internal data storage location960960- #endif975975+#ifndef NEAR976976+#define NEAR // variables mapped to internal data storage location977977+#endif961978962962- #ifndef FAR963963- #define FAR // variables mapped to external data storage location964964- #endif979979+#ifndef FAR980980+#define FAR // variables mapped to external data storage location981981+#endif965982966966- #ifndef CONST967967- #define CONST const // variables mapped to ROM (i.e. flash)968968- #endif983983+#ifndef CONST984984+#define CONST const // variables mapped to ROM (i.e. flash)985985+#endif969986970970- #define LARGE987987+#define LARGE971988972972- #define REENTRANT973973- #define PUBLIC __stdcall989989+#define REENTRANT990990+#define PUBLIC __stdcall974991975975- #ifndef NDEBUG976976- #ifndef TRACE977977- #include <stdio.h>978978- #define TRACE printf979979- #endif980980- #endif992992+#ifndef NDEBUG993993+#ifndef TRACE994994+#include <stdio.h>995995+#define TRACE printf996996+#endif997997+#endif981998982982- #elif (TARGET_SYSTEM == _DOS_)999999+#elif (TARGET_SYSTEM == _DOS_)9831000984984- #define ROM // code or variables mapped to ROM (i.e. flash)985985- // usage: CONST BYTE ROM foo = 0x00;986986- #define HWACC // hardware access through external memory (i.e. CAN)10011001+#define ROM // code or variables mapped to ROM (i.e. flash)10021002+ // usage: CONST BYTE ROM foo = 0x00;10031003+#define HWACC // hardware access through external memory (i.e. CAN)9871004988988- // These types can be adjusted by users to match application requirements. The goal is to989989- // minimize code memory and maximize speed.990990- #define GENERIC // generic pointer to point to application data991991- // Variables with this attribute can be located in external992992- // or internal data memory.993993- #define MEM // Memory attribute to optimize speed and code of pointer access.994994- #define NEAR near // variables mapped to internal data storage location995995- #define FAR far // variables mapped to external data storage location996996- #define CONST const // variables mapped to ROM (i.e. flash)997997- #define LARGE10051005+ // These types can be adjusted by users to match application requirements. The goal is to10061006+ // minimize code memory and maximize speed.10071007+#define GENERIC // generic pointer to point to application data10081008+ // Variables with this attribute can be located in external10091009+ // or internal data memory.10101010+#define MEM // Memory attribute to optimize speed and code of pointer access.10111011+#define NEAR near // variables mapped to internal data storage location10121012+#define FAR far // variables mapped to external data storage location10131013+#define CONST const // variables mapped to ROM (i.e. flash)10141014+#define LARGE9981015999999- #define REENTRANT10001000- #define PUBLIC10161016+#define REENTRANT10171017+#define PUBLIC1001101810021002- #ifndef NDEBUG10031003- #ifndef TRACE10041004- #include <stdio.h>10051005- #define TRACE printf10061006- #endif10071007- #endif10191019+#ifndef NDEBUG10201020+#ifndef TRACE10211021+#include <stdio.h>10221022+#define TRACE printf10231023+#endif10241024+#endif1008102510091009- #endif10261026+#endif1010102710111011-#elif (_MSC_VER == 800) // PC MS Visual C/C++ for DOS applications10281028+#elif (_MSC_VER == 800) // PC MS Visual C/C++ for DOS applications1012102910131013- #define TARGET_SYSTEM _DOS_10141014- #define DEV_SYSTEM _DEV_MSVC_DOS_10301030+#define TARGET_SYSTEM _DOS_10311031+#define DEV_SYSTEM _DEV_MSVC_DOS_1015103210161016- #define ROM // code or variables mapped to ROM (i.e. flash)10171017- // usage: CONST BYTE ROM foo = 0x00;10181018- #define HWACC near // hardware access through external memory (i.e. CAN)10331033+#define ROM // code or variables mapped to ROM (i.e. flash)10341034+ // usage: CONST BYTE ROM foo = 0x00;10351035+#define HWACC near // hardware access through external memory (i.e. CAN)1019103610201037 // These types can be adjusted by users to match application requirements. The goal is to10211038 // minimize code memory and maximize speed.10221022- #define GENERIC // generic pointer to point to application data10231023- // Variables with this attribute can be located in external10241024- // or internal data memory.10251025- #define MEM // Memory attribute to optimize speed and code of pointer access.10261026- #define NEAR near // variables mapped to internal data storage location10271027- #define FAR far // variables mapped to external data storage location10281028- #define CONST const // variables mapped to ROM (i.e. flash)10291029- #define LARGE10391039+#define GENERIC // generic pointer to point to application data10401040+ // Variables with this attribute can be located in external10411041+ // or internal data memory.10421042+#define MEM // Memory attribute to optimize speed and code of pointer access.10431043+#define NEAR near // variables mapped to internal data storage location10441044+#define FAR far // variables mapped to external data storage location10451045+#define CONST const // variables mapped to ROM (i.e. flash)10461046+#define LARGE1030104710311031- #define REENTRANT10321032- #define PUBLIC10481048+#define REENTRANT10491049+#define PUBLIC1033105010341034- #ifndef NDEBUG10351035- #ifndef TRACE10361036- #include <stdio.h>10371037- #define TRACE printf10381038- #endif10391039- #endif10401040-10511051+#ifndef NDEBUG10521052+#ifndef TRACE10531053+#include <stdio.h>10541054+#define TRACE printf10551055+#endif10561056+#endif1041105710421058//---------------------------------------------------------------------------10431059// definitions for RTX under WIN32···10431063#elif (defined (UNDER_RTSS) && defined (WIN32))1044106410451065 // ------------------ definition target system --------------------------10461046- #define TARGET_SYSTEM _WIN32_RTX_10471047- #define DEV_SYSTEM _DEV_WIN32_RTX_10661066+#define TARGET_SYSTEM _WIN32_RTX_10671067+#define DEV_SYSTEM _DEV_WIN32_RTX_1048106810491049- #define ROM // code or variables mapped to ROM (i.e. flash)10501050- // usage: CONST BYTE ROM foo = 0x00;10511051- #define HWACC // hardware access through external memory (i.e. CAN)10691069+#define ROM // code or variables mapped to ROM (i.e. flash)10701070+ // usage: CONST BYTE ROM foo = 0x00;10711071+#define HWACC // hardware access through external memory (i.e. CAN)1052107210531073 // These types can be adjusted by users to match application requirements. The goal is to10541074 // minimize code memory and maximize speed.10551055- #define GENERIC // generic pointer to point to application data10561056- // Variables with this attribute can be located in external10571057- // or internal data memory.10581058- #define MEM // Memory attribute to optimize speed and code of pointer access.10751075+#define GENERIC // generic pointer to point to application data10761076+ // Variables with this attribute can be located in external10771077+ // or internal data memory.10781078+#define MEM // Memory attribute to optimize speed and code of pointer access.1059107910601060- #ifndef NEAR10611061- #define NEAR // variables mapped to internal data storage location10621062- #endif10801080+#ifndef NEAR10811081+#define NEAR // variables mapped to internal data storage location10821082+#endif1063108310641064- #ifndef FAR10651065- #define FAR // variables mapped to external data storage location10661066- #endif10841084+#ifndef FAR10851085+#define FAR // variables mapped to external data storage location10861086+#endif1067108710681068- #ifndef CONST10691069- #define CONST const // variables mapped to ROM (i.e. flash)10701070- #endif10881088+#ifndef CONST10891089+#define CONST const // variables mapped to ROM (i.e. flash)10901090+#endif1071109110721072- #define LARGE10921092+#define LARGE1073109310741074- #define REENTRANT10751075- #define PUBLIC __stdcall10941094+#define REENTRANT10951095+#define PUBLIC __stdcall1076109610771077- #ifndef NDEBUG10781078- #ifndef TRACE10791079- #define TRACE RtPrintf10801080- #endif10811081- #endif10971097+#ifndef NDEBUG10981098+#ifndef TRACE10991099+#define TRACE RtPrintf11001100+#endif11011101+#endif1082110210831103//---------------------------------------------------------------------------10841104// definitions for WinCE···10861106#elif defined (_WIN32_WCE)1087110710881108 // ------------------ definition target system --------------------------10891089- #define TARGET_SYSTEM _WINCE_10901090- #define DEV_SYSTEM _DEV_WIN_CE_11091109+#define TARGET_SYSTEM _WINCE_11101110+#define DEV_SYSTEM _DEV_WIN_CE_1091111110921092- #define ROM // code or variables mapped to ROM (i.e. flash)10931093- // usage: CONST BYTE ROM foo = 0x00;10941094- #define HWACC // hardware access through external memory (i.e. CAN)11121112+#define ROM // code or variables mapped to ROM (i.e. flash)11131113+ // usage: CONST BYTE ROM foo = 0x00;11141114+#define HWACC // hardware access through external memory (i.e. CAN)1095111510961116 // These types can be adjusted by users to match application requirements. The goal is to10971117 // minimize code memory and maximize speed.10981098- #define GENERIC // generic pointer to point to application data10991099- // Variables with this attribute can be located in external11001100- // or internal data memory.11011101- #define MEM // Memory attribute to optimize speed and code of pointer access.11181118+#define GENERIC // generic pointer to point to application data11191119+ // Variables with this attribute can be located in external11201120+ // or internal data memory.11211121+#define MEM // Memory attribute to optimize speed and code of pointer access.1102112211031103- #ifndef NEAR11041104- #define NEAR // variables mapped to internal data storage location11051105- #endif11231123+#ifndef NEAR11241124+#define NEAR // variables mapped to internal data storage location11251125+#endif1106112611071107- #ifndef FAR11081108- #define FAR // variables mapped to external data storage location11091109- #endif11271127+#ifndef FAR11281128+#define FAR // variables mapped to external data storage location11291129+#endif1110113011111111- #ifndef CONST11121112- #define CONST const // variables mapped to ROM (i.e. flash)11131113- #endif11311131+#ifndef CONST11321132+#define CONST const // variables mapped to ROM (i.e. flash)11331133+#endif1114113411151115- #define LARGE11351135+#define LARGE1116113611171117- #ifndef QWORD11371137+#ifndef QWORD11181138 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)11191119- #define QWORD __int6411201120- #endif11391139+#define QWORD __int6411401140+#endif1121114111221122- #define REENTRANT11231123- #define PUBLIC __cdecl11421142+#define REENTRANT11431143+#define PUBLIC __cdecl1124114411251125- #ifdef ASSERTMSG11261126- #undef ASSERTMSG11271127- #endif11451145+#ifdef ASSERTMSG11461146+#undef ASSERTMSG11471147+#endif1128114811291129- #ifndef NDEBUG11301130- #ifndef TRACE11311131- #define TRACE printf11491149+#ifndef NDEBUG11501150+#ifndef TRACE11511151+#define TRACE printf11321152// void trace (char *fmt, ...);11331133- #endif11341134- #endif11531153+#endif11541154+#endif1135115511361136-#else // ===> PC MS Visual C/C++11561156+#else // ===> PC MS Visual C/C++1137115711381158 // ------------------ definition target system --------------------------1139115911401140- #ifdef _WIN3211411141- #define TARGET_SYSTEM _WIN32_ // WIN32 definition11421142- #define DEV_SYSTEM _DEV_WIN32_11431143- #else11441144- #define TARGET_SYSTEM _WIN16_ // WIN16 definition11451145- #define DEV_SYSTEM _DEV_WIN16_11461146- #endif11471147-11601160+#ifdef _WIN3211611161+#define TARGET_SYSTEM _WIN32_ // WIN32 definition11621162+#define DEV_SYSTEM _DEV_WIN32_11631163+#else11641164+#define TARGET_SYSTEM _WIN16_ // WIN16 definition11651165+#define DEV_SYSTEM _DEV_WIN16_11661166+#endif1148116711491168 // ------------------ WIN16 ---------------------------------------------1150116911511151- #if (TARGET_SYSTEM == _WIN16_)11701170+#if (TARGET_SYSTEM == _WIN16_)1152117111531153- #define ROM // code or variables mapped to ROM (i.e. flash)11541154- // usage: CONST BYTE ROM foo = 0x00;11551155- #define HWACC // hardware access through external memory (i.e. CAN)11721172+#define ROM // code or variables mapped to ROM (i.e. flash)11731173+ // usage: CONST BYTE ROM foo = 0x00;11741174+#define HWACC // hardware access through external memory (i.e. CAN)1156117511571157- // These types can be adjusted by users to match application requirements. The goal is to11581158- // minimize code memory and maximize speed.11591159- #define GENERIC // generic pointer to point to application data11601160- // Variables with this attribute can be located in external11611161- // or internal data memory.11621162- #define MEM // Memory attribute to optimize speed and code of pointer access.11761176+ // These types can be adjusted by users to match application requirements. The goal is to11771177+ // minimize code memory and maximize speed.11781178+#define GENERIC // generic pointer to point to application data11791179+ // Variables with this attribute can be located in external11801180+ // or internal data memory.11811181+#define MEM // Memory attribute to optimize speed and code of pointer access.1163118211641164- #ifndef NEAR11651165- #define NEAR // variables mapped to internal data storage location11661166- #endif11831183+#ifndef NEAR11841184+#define NEAR // variables mapped to internal data storage location11851185+#endif1167118611681168- #ifndef FAR11691169- #define FAR far // variables mapped to external data storage location11701170- #endif11871187+#ifndef FAR11881188+#define FAR far // variables mapped to external data storage location11891189+#endif1171119011721172- #ifndef CONST11731173- #define CONST const // variables mapped to ROM (i.e. flash)11741174- #endif11911191+#ifndef CONST11921192+#define CONST const // variables mapped to ROM (i.e. flash)11931193+#endif1175119411761176- #define LARGE11951195+#define LARGE1177119611781178- #define REENTRANT11791179- #define PUBLIC _far _pascal _export11971197+#define REENTRANT11981198+#define PUBLIC _far _pascal _export1180119911811181- #ifndef NDEBUG11821182- #ifndef TRACE11831183- #define TRACE trace11841184- #ifdef __cplusplus11851185- extern "C"11861186- {11871187- #endif11881188- void trace (const char *fmt, ...);11891189- #ifdef __cplusplus11901190- }11911191- #endif11921192- #endif11931193- #endif11941194-11951195- #endif11961196-11971197-12001200+#ifndef NDEBUG12011201+#ifndef TRACE12021202+#define TRACE trace12031203+#ifdef __cplusplus12041204+extern "C" {12051205+#endif12061206+ void trace(const char *fmt, ...);12071207+#ifdef __cplusplus12081208+}12091209+#endif12101210+#endif12111211+#endif12121212+#endif11981213 // ------------------ WIN32 ---------------------------------------------11991199-12001200- #if (TARGET_SYSTEM == _WIN32_)12011201-12021202- #define ROM // code or variables mapped to ROM (i.e. flash)12031203- // usage: CONST BYTE ROM foo = 0x00;12041204- #define HWACC // hardware access through external memory (i.e. CAN)12051205-12061206- // These types can be adjusted by users to match application requirements. The goal is to12071207- // minimize code memory and maximize speed.12081208- #define GENERIC // generic pointer to point to application data12091209- // Variables with this attribute can be located in external12101210- // or internal data memory.12111211- #define MEM // Memory attribute to optimize speed and code of pointer access.12121212-12131213- #ifndef NEAR12141214- #define NEAR // variables mapped to internal data storage location12151215- #endif12161216-12171217- #ifndef FAR12181218- #define FAR // variables mapped to external data storage location12191219- #endif12201220-12211221- #ifndef CONST12221222- #define CONST const // variables mapped to ROM (i.e. flash)12231223- #endif12241224-12251225- #define LARGE12261226-12271227- #define REENTRANT12281228- #define PUBLIC __stdcall12291229-12301230- #ifndef QWORD12311231- //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)12321232- #define QWORD __int6412331233- #endif12341234-12351235- #ifndef NDEBUG12361236- #ifndef TRACE12371237- #define TRACE trace12381238- #ifdef __cplusplus12391239- extern "C"12401240- {12411241- #endif12421242- void trace (const char *fmt, ...);12431243- #ifdef __cplusplus12441244- }12451245- #endif12461246- #endif12471247- #endif12481248-12491249- // MS Visual C++ compiler supports function inlining12501250- #define INLINE_FUNCTION_DEF __forceinline12511251-12521252- // to actually enable inlining just include the following two lines12531253- // #define INLINE_FUNCTION INLINE_FUNCTION_DEF12541254- // #define INLINE_ENABLED TRUE12551255-12561256- #endif12571257-12581258-#endif // ===> PC12591259-12601260-12611261-//---------------------------------------------------------------------------12621262-// definitions of basic types12631263-//---------------------------------------------------------------------------12641264-12651265-#ifndef _WINDEF_ // defined in WINDEF.H, included by <windows.h>12661266-12141214+#if (TARGET_SYSTEM == _WIN32_)12151215+#define ROM // code or variables mapped to ROM (i.e. flash)12161216+ // usage: CONST BYTE ROM foo = 0x00;12171217+#define HWACC // hardware access through external memory (i.e. CAN)12181218+ // These types can be adjusted by users to match application requirements. The goal is to// minimize code memory and maximize speed.12191219+#define GENERIC // generic pointer to point to application data12201220+ // Variables with this attribute can be located in external// or internal data memory.12211221+#define MEM // Memory attribute to optimize speed and code of pointer access.12221222+#ifndef NEAR12231223+#define NEAR // variables mapped to internal data storage location12241224+#endif12251225+#ifndef FAR12261226+#define FAR // variables mapped to external data storage location12271227+#endif12281228+#ifndef CONST12291229+#define CONST const // variables mapped to ROM (i.e. flash)12301230+#endif12311231+#define LARGE12321232+#define REENTRANT12331233+#define PUBLIC __stdcall12341234+#ifndef QWORD12351235+ //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)12361236+#define QWORD __int6412371237+#endif12381238+#ifndef NDEBUG12391239+#ifndef TRACE12401240+#define TRACE trace12411241+#ifdef __cplusplus12421242+extern "C" {12431243+#endif12441244+ void trace(const char *fmt, ...);12451245+#ifdef __cplusplus12461246+}12471247+#endif12481248+#endif12491249+#endif12501250+ // MS Visual C++ compiler supports function inlining12511251+#define INLINE_FUNCTION_DEF __forceinline12521252+ // to actually enable inlining just include the following two lines// #define INLINE_FUNCTION INLINE_FUNCTION_DEF// #define INLINE_ENABLED TRUE12531253+#endif12541254+#endif // ===> PC12551255+//---------------------------------------------------------------------------// definitions of basic types//---------------------------------------------------------------------------12561256+#ifndef _WINDEF_ // defined in WINDEF.H, included by <windows.h>12671257 // --- arithmetic types ---12681268- #ifndef SHORT12691269- #define SHORT short int12701270- #endif12711271-12721272- #ifndef USHORT12731273- #define USHORT unsigned short int12741274- #endif12751275-12761276- #ifndef INT12771277- #define INT int12781278- #endif12791279-12801280- #ifndef UINT12811281- #define UINT unsigned int12821282- #endif12831283-12841284- #ifndef LONG12851285- #define LONG long int12861286- #endif12871287-12881288- #ifndef ULONG12891289- #define ULONG unsigned long int12901290- #endif12911291-12921292-12581258+#ifndef SHORT12591259+#define SHORT short int12601260+#endif12611261+#ifndef USHORT12621262+#define USHORT unsigned short int12631263+#endif12641264+#ifndef INT12651265+#define INT int12661266+#endif12671267+#ifndef UINT12681268+#define UINT unsigned int12691269+#endif12701270+#ifndef LONG12711271+#define LONG long int12721272+#endif12731273+#ifndef ULONG12741274+#define ULONG unsigned long int12751275+#endif12931276 // --- logic types ---12941294- #ifndef BYTE12951295- #define BYTE unsigned char12961296- #endif12971297-12981298- #ifndef WORD12991299- #define WORD unsigned short int13001300- #endif13011301-13021302- #ifndef DWORD13031303- #define DWORD unsigned long int13041304- #endif13051305-13061306- #ifndef BOOL13071307- #define BOOL unsigned char13081308- #endif13091309-13101310-12771277+#ifndef BYTE12781278+#define BYTE unsigned char12791279+#endif12801280+#ifndef WORD12811281+#define WORD unsigned short int12821282+#endif12831283+#ifndef DWORD12841284+#define DWORD unsigned long int12851285+#endif12861286+#ifndef BOOL12871287+#define BOOL unsigned char12881288+#endif13111289 // --- alias types ---13121312- #ifndef TRUE13131313- #define TRUE 0xFF13141314- #endif13151315-13161316- #ifndef FALSE13171317- #define FALSE 0x0013181318- #endif13191319-13201320- #ifndef NULL13211321- #define NULL ((void *) 0)13221322- #endif13231323-12901290+#ifndef TRUE12911291+#define TRUE 0xFF13241292#endif13251325-13261326-12931293+#ifndef FALSE12941294+#define FALSE 0x0012951295+#endif12961296+#ifndef NULL12971297+#define NULL ((void *) 0)12981298+#endif12991299+#endif13271300#ifndef _TIME_OF_DAY_DEFINED_13011301+typedef struct {13021302+ unsigned long int m_dwMs;13031303+ unsigned short int m_wDays;1328130413291329- typedef struct13301330- {13311331- unsigned long int m_dwMs;13321332- unsigned short int m_wDays;13051305+} tTimeOfDay;1333130613341334- } tTimeOfDay;13351335-13361336- #define _TIME_OF_DAY_DEFINED_13071307+#define _TIME_OF_DAY_DEFINED_1337130813381309#endif13391339-1340131013411311//---------------------------------------------------------------------------13421312// Definition von TRACE···1294136412951365#ifndef NDEBUG1296136612971297- #ifndef TRACE012981298- #define TRACE0(p0) TRACE(p0)12991299- #endif13671367+#ifndef TRACE013681368+#define TRACE0(p0) TRACE(p0)13691369+#endif1300137013011301- #ifndef TRACE113021302- #define TRACE1(p0, p1) TRACE(p0, p1)13031303- #endif13711371+#ifndef TRACE113721372+#define TRACE1(p0, p1) TRACE(p0, p1)13731373+#endif1304137413051305- #ifndef TRACE213061306- #define TRACE2(p0, p1, p2) TRACE(p0, p1, p2)13071307- #endif13751375+#ifndef TRACE213761376+#define TRACE2(p0, p1, p2) TRACE(p0, p1, p2)13771377+#endif1308137813091309- #ifndef TRACE313101310- #define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3)13111311- #endif13791379+#ifndef TRACE313801380+#define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3)13811381+#endif1312138213131313- #ifndef TRACE413141314- #define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4)13151315- #endif13831383+#ifndef TRACE413841384+#define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4)13851385+#endif1316138613171317- #ifndef TRACE513181318- #define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5)13191319- #endif13871387+#ifndef TRACE513881388+#define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5)13891389+#endif1320139013211321- #ifndef TRACE613221322- #define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6)13231323- #endif13911391+#ifndef TRACE613921392+#define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6)13931393+#endif1324139413251395#else1326139613271327- #ifndef TRACE013281328- #define TRACE0(p0)13291329- #endif13301330-13311331- #ifndef TRACE113321332- #define TRACE1(p0, p1)13331333- #endif13341334-13351335- #ifndef TRACE213361336- #define TRACE2(p0, p1, p2)13371337- #endif13381338-13391339- #ifndef TRACE313401340- #define TRACE3(p0, p1, p2, p3)13411341- #endif13421342-13431343- #ifndef TRACE413441344- #define TRACE4(p0, p1, p2, p3, p4)13451345- #endif13461346-13471347- #ifndef TRACE513481348- #define TRACE5(p0, p1, p2, p3, p4, p5)13491349- #endif13501350-13511351- #ifndef TRACE613521352- #define TRACE6(p0, p1, p2, p3, p4, p5, p6)13531353- #endif13541354-13971397+#ifndef TRACE013981398+#define TRACE0(p0)13551399#endif1356140014011401+#ifndef TRACE114021402+#define TRACE1(p0, p1)14031403+#endif1357140414051405+#ifndef TRACE214061406+#define TRACE2(p0, p1, p2)14071407+#endif14081408+14091409+#ifndef TRACE314101410+#define TRACE3(p0, p1, p2, p3)14111411+#endif14121412+14131413+#ifndef TRACE414141414+#define TRACE4(p0, p1, p2, p3, p4)14151415+#endif14161416+14171417+#ifndef TRACE514181418+#define TRACE5(p0, p1, p2, p3, p4, p5)14191419+#endif14201420+14211421+#ifndef TRACE614221422+#define TRACE6(p0, p1, p2, p3, p4, p5, p6)14231423+#endif14241424+14251425+#endif1358142613591427//---------------------------------------------------------------------------13601428// definition of ASSERT13611429//---------------------------------------------------------------------------1362143013631431#ifndef ASSERT13641364- #if !defined (__linux__) && !defined (__KERNEL__)13651365- #include <assert.h>13661366- #ifndef ASSERT13671367- #define ASSERT(p) assert(p)13681368- #endif13691369- #else13701370- #define ASSERT(p)13711371- #endif14321432+#if !defined (__linux__) && !defined (__KERNEL__)14331433+#include <assert.h>14341434+#ifndef ASSERT14351435+#define ASSERT(p) assert(p)13721436#endif13731373-14371437+#else14381438+#define ASSERT(p)14391439+#endif14401440+#endif1374144113751442//---------------------------------------------------------------------------13761443// SYS TEC extensions···13771450// but a string, which exactly names the mistake.13781451#ifndef NDEBUG1379145213801380- #define ASSERTMSG(expr,string) if (!(expr)) {\14531453+#define ASSERTMSG(expr,string) if (!(expr)) {\13811454 PRINTF0 ("Assertion failed: " string );\13821455 while (1);}13831456#else13841384- #define ASSERTMSG(expr,string)14571457+#define ASSERTMSG(expr,string)13851458#endif13861386-13871387-13881388-1389145913901460//---------------------------------------------------------------------------1391146113921392-#endif // #ifndef _GLOBAL_H_14621462+#endif // #ifndef _GLOBAL_H_1393146313941464// Please keep an empty line at the end of this file.13951395-