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

📄 linerr.h

📁 飞思卡尔车身控制技术研讨会资料 里面有LIN的主从节点源程序
💻 H
字号:
#ifndef LINERR_H
#define LINERR_H

/******************************************************************************
*                                                       
*       Copyright (C) 2005 Freescale Semiconductor, Inc.
*       All Rights Reserved								              
*														                            
* Filename:     linerr.h                
*														                            
* Revision:      										                    
*														                            
* Functions:    LIN Error module header file
*														                            
* Description:  
*
* Notes:
*
******************************************************************************/

/****************************************************************************
 * All extern declarations of common-purpose RAM variables shall be here.
 ***************************************************************************/
#if defined(S08) && defined(CW08)
#pragma DATA_SEG SHORT ZeroSeg
#endif /* defined(S08) && defined(CW08) */

extern LINErrCounterType LIN_ErrTxCounter;       /* Shift counter for Tx errors */
extern LINErrCounterType LIN_ErrRxCounter;       /* Shift counter for Rx errors */

#if defined(S08) && defined(CW08)
#pragma DATA_SEG DEFAULT
#endif /* defined(S08) && defined(CW08) */

/****************************************************************************/
/***                     Macros                                           ***/
/****************************************************************************/

#define LIN_ShiftRxErr()    LIN_ErrRxCounter >>= 1
#define LIN_ShiftTxErr()    LIN_ErrTxCounter >>= 1


/**************************************************************************
 * Function :   LIN_SetRxErr
 *
 * Description: Shift Rx error counter and set high bit
 *
 * Returns:     none
 *
 * Notes:       none
 *
 **************************************************************************/
#if defined(S08) && defined(CW08)
#define LIN_SetRxErr()                                  \
        asm SEC;                                        \
        asm LDHX  @LIN_ErrRxCounter;                    \
        asm ROR ,X
#endif /* defined(S08) && defined(CW08) */



/**************************************************************************
 * Function :   LIN_SetTxErr
 *
 * Description: Shift Tx error counter and set high bit
 *
 * Returns:     none
 *
 * Notes:       none
 *
 **************************************************************************/
#if defined(S08) && defined(CW08)
#define LIN_SetTxErr()                                  \
        asm SEC;                                        \
        asm LDHX  @LIN_ErrTxCounter;                    \
        asm ROR ,X
#endif /* defined(S08) && defined(CW08) */



#endif /* !define (LINERR_H) */

⌨️ 快捷键说明

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