📄 linsci.h
字号:
#ifndef LINSCI_H
#define LINSCI_H
/******************************************************************************
*
* Copyright (C) 2005 Freescale Semiconductor, Inc.
* All Rights Reserved
*
* Filename: linsci.h
*
* Functions: SCI routins header file
*
* Description:
*
* Notes:
*
******************************************************************************/
/****************************************************************************
* All extern declarations of common-purpose RAM variables shall be here.
***************************************************************************/
#if defined(USEZEROPAGE)
#pragma DATA_SEG __SHORT_SEG ZeroSeg
#endif /* defined(USEZEROPAGE) */
extern LIN_ZPAGE LIN_BYTE LIN_TmpSCIStatus; /* byte to clear SCI status, and to receive byte */
#if defined(USEZEROPAGE)
#pragma DATA_SEG DEFAULT
#endif /* defined(USEZEROPAGE) */
/****************************************************************************/
/*** Functions ***/
/****************************************************************************/
#if !defined(LINAPI_1_0)
void near LIN_SCIInit( void );
#endif /* !defined(LINAPI_1_0) */
void near LIN_SCISetBaudRate( LIN_WORD baudRate );
/****************************************************************************/
/*** Interrupt Driven routins ***/
/****************************************************************************/
#if !defined(LINAPI_1_0)
#endif /* !defined(LINAPI_1_0) */
/****************************************************************************/
/*** Macros ***/
/****************************************************************************/
#define LIN_SCDRPut(data) ( LIN_SCIDRL = (data) )
/**************************************************************************
* Function : LIN_SCISendBreak
*
* Description: Send Break
*
*
* Returns: none
*
* Notes:
*
**************************************************************************/
#define LIN_SCISendBreakSignal() \
LIN_TmpSCIStatus = LIN_SCISR1; /* Read SCI status register to clear it */\
LIN_SCICR2 |= LIN_SCICR2_SBK; /* Enable SCI Tx completed interrupt and send 13 bit break*/\
LIN_SCICR2 &= ~LIN_SCICR2_SBK /* send 13 bit break once */
/**************************************************************************
* Function : LIN_SCISendWakeup
*
* Description: Send Wakeup message
*
*
* Returns: none
*
* Notes: none
*
*
**************************************************************************/
#define WAKEUP_BYTE 0x80
#define LIN_SCISendWakeup() \
LIN_TmpSCIStatus = LIN_SCISR1; /* Read SCI status register to clear it */\
LIN_SCDRPut(WAKEUP_BYTE); /* Send wakeup frame */\
LIN_SCICR2 |= LIN_SCICR2_TCIE /* Enable SCI Tx completed interrupt */\
#endif /* !define (LINSCI_H) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -