⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msg_process._h

📁 单片机中的中断处理模块
💻 _H
字号:
#ifndef __MSG_PROCESS__H
#define __MSG_PROCESS__H

#include "stdtypes.h"

#define MAX_MESSAGE_LENGTH      40
#define MAX_TX_MAILBOXES        2
#define MAX_RX_MAILBOXES        10
#define J1708_MID               0
#define	MIN_1587_MID		128
#define	MAX_1587_MID		253
#define PID_PAGE_ONE            0
#define PID_PAGE_TWO            1
#define	PID_ESC			254
#define	PID_EXT                 255
#define PID_ESC_2               510
#define PID_CMP                 197
#define PID_CDP                 198
#define MAX_SINGLE_PID		127
#define MAX_DOUBLE_PID		191
#define	PID_MULTISECTION	192
#define MAX_VARIABLE_PID	253
#define TRUE                    1
#define FALSE                   0

#define SECTION_END(x)   (((x) >> 4)==((x) & 0x0F))?1:0
#define SECTION_FIRST(x)   ((x) & 0x0F)?0:1

#define Diagnostic_count(code)  ((code) & 0x80)>>7
#define Diagnostic_status(code) ((code) & 0x40)>>6
#define Diagnostic_sdc(code)    ((code) & 0x20)>>5
#define Diagnostic_psi(code)    ((code) & 0x10)>>4
#define Diagnostic_fmi(code)    ((code) & 0x0F)
#define Diagnostic_data(count,status,sdc,psi,fmi)  ((count<<7)|(status<<6)|(sdc<<5)|(psi<<4)|(fmi))

#define MAX_PID_SID	511	/* Largest PID or SID value allowed */
#define MAX_DIAGNOSTIC 50//20

typedef struct
{
    UNS8	byte_count;
    UNS8	msg[MAX_MESSAGE_LENGTH];
}
MAILBOX;



typedef struct
{   
    UNS8    pid_sid;
	UNS8    code;
	UNS8    fmi;
	UNS8    count;
	
	UNS8    flag;/* have the fault set the flag*/
	
}
DIAGNOSTIC;

typedef union {

    struct
    {
        UNS8 pid;
        UNS8 page;
    }

    char_form;
    UNS16 pid_t_form;
} PID_UNION;

/* Indicates PID or SID, both, or SPN. */
typedef enum {
    F_PID = 0,		/* Indicates PID.  */
    F_SID = 1,		/* Indicates SID.  */
			/* Note: F_PID and F_SID are used to indicate
			 * the 'psi' field of the fault_id_t structure.
			 */
    F_ALL = 2,		/* Indicates both PID and SID. */
    F_SPN = 3		/* Indicates J1939 Suspect Parameter Number. */
    } PS_INDICATOR;
	
typedef	UNS16	PID;		/* Create an internal type for PID values. */


UNS8 get_c(UNS8 FiReadingLength);
void msg_process_init(void);
UNS8 build_sdi_struct(UNS8 data[],UNS8 len);
void build_menu_string(void);
UNS8 display_fault_detail(UNS8 data[],UNS8 len);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -