📄 linsci.h
字号:
#ifndef LINSCI_H
#define LINSCI_H
/******************************************************************************
*
* Copyright (C) 2005 Freescale Semiconductor, Inc.
* All Rights Reserved
*
* Filename: linsci.h
*
* Revision:
*
* Functions: SCI routins header file
*
* Description:
*
* Notes:
*
******************************************************************************/
/****************************************************************************
* All extern declarations of common-purpose RAM variables shall be here.
***************************************************************************/
/****************************************************************************
* Some of the variables (more often used) can be declared using LIN_ZPAGE
* modifier (applicable only for HC08).
* It require to perform zero page RAM placement optimisation.
***************************************************************************/
#if defined(S08) && defined(CW08)
#pragma DATA_SEG SHORT ZeroSeg
#endif /* defined(S08) && defined(CW08) */
extern LIN_ZPAGE LIN_BYTE LIN_TmpSCIStatus; /* byte to clear SCI status, and to receive byte */
#if defined(S08) && defined(CW08)
#pragma DATA_SEG DEFAULT
#endif /* defined(S08) && defined(CW08) */
/****************************************************************************/
/*** Functions ***/
/****************************************************************************/
#if !defined(LINAPI_1_0)
void LIN_SCIInit( void );
#endif /* !defined(LINAPI_1_0) */
void LIN_SCISetBaudRate( LIN_WORD baudRate );
/****************************************************************************/
/*** Interrupt Driven routins ***/
/****************************************************************************/
#if !defined(LINAPI_1_0)
#endif /* !defined(LINAPI_1_0) */
/****************************************************************************/
/*** Macros ***/
/****************************************************************************/
#if defined(S08DZ60)
#define LIN_SCDRPut(data) ( LIN_SCDR = (data) )
#endif /* defined(S08DZ60) */
/**************************************************************************
* Function : LIN_SCISendZero
*
* Description: Send Zero byte
*
* Returns: none
*
* Notes: 1. 13 zero bits sended
*
**************************************************************************/
#if defined(S08DZ60)
#define LIN_SCISendBreakSignal() \
LIN_TmpSCIStatus = LIN_SCSR1; /* Read SCI status register to clear it */ \
LIN_SCCR2 |= (LIN_SCCR2_SBK); /* Send 13 bit break */\
LIN_SCCR2 &= ~LIN_SCCR2_SBK
#endif /* defined(S08DZ60) */
/**************************************************************************
* Function : LIN_SCISendWakeup
*
* Description: Send Wakeup message
*
* Returns: none
*
* Notes: none
*
**************************************************************************/
#define WAKEUP_BYTE 0x80
#if defined(S08DZ60)
#define LIN_SCISendWakeup() \
LIN_TmpSCIStatus = LIN_SCSR1; /* Read SCI status register to clear it */ \
LIN_SCDRPut(WAKEUP_BYTE) /* Send wakeup frame */
#endif /* defined(S08DZ60) */
#endif /* !define (LINSCI_H) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -