linxgate.h

来自「freescale最新的16位单片机」· C头文件 代码 · 共 76 行

H
76
字号

#ifndef __XGATE_H_
#define __XGATE_H_

#include <intrinsics_xgate.h>
#include "con_msg_dis.h"  // Disable some warning messages

/* XGATE vector table */
//typedef void (*_NEAR XGATE_Function)(int);
//typedef struct {
//  XGATE_Function pc;        /* pointer to the handler */
//  int dataptr;              /* pointer to the data of the handler */
//} XGATE_TableEntry;

//#pragma push
//#pragma CONST_SEG __GPAGE_SEG XGATE_CONST  /* for the HCS12X/XGATE shared setup, the XGATE constants must be in RAM. */
//#define XGATE_VECTOR_OFFSET 0
//extern const XGATE_TableEntry XGATE_VectorTable[];
//#pragma pop

/*                LIN Error Macros  */

/******************************************************************************
* VARIABLES 
******************************************************************************/

/* This wariable reflect the state of the LIN physical layer during LIN colision detection:
   - 0 -> OK
   - 1 -> RxD pin low, i.e. LIN signal wire connected to GND, 
   - 2 -> RxD pin high, i.e. LIN signal wire connected to Vsup */ 
extern unsigned char failLIN;

/******************************************************************************
* MACROS 
******************************************************************************/

#define XLIN_ShiftRxErr()    LIN_ErrRxCounter = (LINErrCounterType)_ror (LIN_ErrRxCounter,1)
#define XLIN_ShiftTxErr()    LIN_ErrTxCounter = (LINErrCounterType)_ror (LIN_ErrTxCounter,1)



/**************************************************************************
* Function :   XLIN_SetRxErr
*
* Description: Shift Rx error counter and set high bit
*														                            
*
* Returns:     none
*
* Notes:       none
*														                            
*
**************************************************************************/
#define XLIN_SetRxErr()                                  \
        LIN_ErrRxCounter = (LINErrCounterType)_ror (LIN_ErrRxCounter,1);                                        \
		LIN_ErrRxCounter |= 0x80

/**************************************************************************
* Function :   XLIN_SetTxErr
*
* Description: Shift Tx error counter and set high bit
*														                            
*
* Returns:     none
*
* Notes:       none
*														                            
*
**************************************************************************/
#define XLIN_SetTxErr()									  \
        LIN_ErrTxCounter = (LINErrCounterType)_ror (LIN_ErrTxCounter,1);     \
		LIN_ErrTxCounter |= 0x80


#endif /* __XGATE_H_ */

⌨️ 快捷键说明

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