📄 addr_relay.h
字号:
/* Copyright 2000 Delphi Delco Electronics Systems *//******************************************************************************** Module : MY2001 Volkswagen Beetle/A4** Instrument Cluster Communication Software**** Sub-Module : K-line Communication Management** Issued by : MEG-KFU Karl-Fredrik Uhlander**** File name : addr_relay.h**** Created : 1999-10-05**** Archive name : MEG-J/PROJ/1240VW_CLUSTER*********************************************************************************** $Revision: 1.11 $** $Date: Sep 25 2000 09:24:16 $**** $Log: J:\PROJ\1240VW_Cluster\PVCS\addr_relay.h_v $ * * Rev 2.0 Sep 25 2000 09:24:16 KFU * New revision number. * * Rev 1.9 Sep 22 2000 17:20:12 KFU * Disable of either W- or CAN- immo com implemented. * * Rev 1.8 Aug 16 2000 10:21:30 KFU * New flag. * * Rev 1.7 Jul 13 2000 17:12:22 KFU * Pin name changed. * * Rev 1.6 Jul 06 2000 16:18:26 KFU * Macro to get nr OBD ecu. * * Rev 1.5 Jun 21 2000 22:24:24 KFU * Small name change. * * Rev 1.4 Jun 18 2000 21:00:48 KFU * Temp check in. Code compiles. A lot of changes: * Diag gw to comfort, tp for comfort, diag gw changed to match the new can tp, * byte flags changed to bit flags, some defines changed to functions, and more... * * Rev 1.3 Mar 01 2000 11:01:52 KFU * New flag: "Wup_Detected_Enter_Immo_Mode" (true/false). * Used to prevent a possible error during addressing on K-line * at the same time as a Wup occurs on the W-line. * * Rev 1.2 Nov 17 1999 11:20:14 KFU * New API function: Disable Further Addressing(u8 address). * (see also source file header) * * Rev 1.1 Nov 05 1999 18:08:48 KFU * New global variable added: Functional_Addressing. * Will be used when cluster must have the functionality to * handle OBD and KWP 2000. * * Rev 1.0 Oct 24 1999 15:30:46 KFU * This is the former file k_line_address.h. * For further description, see source file.*******************************************************************************/#ifndef ADDR_RELAY_H#define ADDR_RELAY_H/* The definition of export simplifies definition of variables that should be * externally available (in other C-files). */#ifdef ADDR_RELAY_C #define export#else #define export extern#endif/************************************************************** ** Title: Disable_Further_Addressing ** ** Description: ** ** Disables parameter address for further addressing, ** i.e the address becomes "invisible" from the Testers ** point of view. ** Disabled addresses will only be resetted in the function ** "Diag_Comm_Init()" and therefor just resetted after a ** total power-up-reset. ** **************************************************************/export void Disable_Further_K_Line_Addressing(u8 address);typedef struct{ u16 icp:1; u16 gw:1; u16 immo:1; u16 radio_comf:1; u16 reserved:12;}TYPE_DISABLED_ADDRESS;typedef struct{ u16 asc_w_k_tx_close_relay:1; /* Byte 0 is the k-line part */ u16 k_line_address_valid:1; u16 functional_addressing:1; u16 drive_address:1; u16 comfort_address:1; u16 unsupported_k_line_address_detected:1; u16 unused1:2; u16 wup_detected_enter_immo_mode:1; /* Byte 1 is other stuff */ u16 unused2:7;}TYPE_ADDR_RELAY_EXT_FLAGS;typedef union{ TYPE_ADDR_RELAY_EXT_FLAGS flag; u8 all_flags[2]; /* Byte 0 is the k-line part */}TYPE_ADDR_RELAY_EXT;/* State machine return values. Communication modes. */typedef enum{ MODE_IDLE, MODE_DIAGNOSTICS, MODE_GATEWAY, MODE_IMMOBILIZER, MODE_FLASH_COMM}TYPE_COMMUNICATION_MODE;/* Public functions and variables */#define ASC_W_K_Tx_Close_Relay() {(Addr_Relay_Ext.flag.asc_w_k_tx_close_relay ? (WK_Relay_Control = 0):\ Addr_Relay_Ext.flag.asc_w_k_tx_close_relay);\ Addr_Relay_Ext.flag.asc_w_k_tx_close_relay = 0;}#define Wup_Detected_Enter_Immo_Mode Addr_Relay_Ext.flag.wup_detected_enter_immo_mode#define K_Line_Address_Valid Addr_Relay_Ext.flag.k_line_address_valid#define K_Line_Functional_Addressing() Addr_Relay_Ext.flag.functional_addressing#define K_Line_To_CAN_Drive_Diagnosis() Addr_Relay_Ext.flag.drive_address#define K_Line_To_CAN_Comfort_Diagnosis() Addr_Relay_Ext.flag.comfort_address#define K_Line_Is_In_Mode_Gateway() (Communication_Mode == MODE_GATEWAY)#define K_Line_GW_Get_ECU_Address(nr) Ecu_CAN_Address[nr]#define K_Line_GW_Get_Nr_OBD_ECU() 4 /* Acc. to spec and allocation table *//* Macroes to tell application whether CAN Drive or CAN Comfort is in diagnostic mode */#define K_Line_To_CD_Diagnosis_Active() Addr_Relay_Ext.flag.drive_address#define K_Line_To_CC_Diagnosis_Active() Addr_Relay_Ext.flag.comfort_address/* Macro to disable immo on W-line */#define Disable_Immobilization_On_W_Line() (Disable_Immo_Com_On_W_Line = TRUE)export TYPE_COMMUNICATION_MODE Communication_Mode;export TYPE_DISABLED_ADDRESS Disabled_Address;export TYPE_ADDR_RELAY_EXT Addr_Relay_Ext;export u8 K_Line_Address;export u8 Ecu_CAN_Address[4];export u8 Disable_Immo_Com_On_W_Line;/* Addresses and Relay functions */export void Init_Addresses_And_Relay(void);export TYPE_COMMUNICATION_MODE Addresses_And_Relay_State_Machine(void);#undef export#endif/* * $SOURCE: ip_project@flint.iac:01_a4_beetle_ip:addr_relay.h $ * $REVISION: 1.11 $ * $AUTHOR: flint.iac:/users/wileyeg/dsds/01a4beet:wileyeg $ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -