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

📄 linxgate.h

📁 freescale最新的16位单片机
💻 H
字号:

#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -