f53x_linsnooper_uart.h
来自「8051试验程序 基础教材」· C头文件 代码 · 共 95 行
H
95 行
//-----------------------------------------------------------------------------
// F53x_UART.h
//-----------------------------------------------------------------------------
// Copyright 2006 Silicon Laboratories, Inc.
// http://www.silabs.com
//
// File Description:
//
// Header file with function prototypes relevant to F53x_UART.c
//
// FID:
// Target: C8051F53x
// Tool chain: KEIL C51 7.20
// Command Line: None
// Project Name: LIN Snooper
//
// Release 1.0
// -Initial Revision
// -01 NOV 2006
//
//
//-----------------------------------------------------------------------------
// Header File Preprocessor Directive
//-----------------------------------------------------------------------------
#ifndef __UART_H__
#define __UART_H__
//-----------------------------------------------------------------------------
// Constant Definitions
//-----------------------------------------------------------------------------
//#define BAUDRATE 9600
//#define BAUDRATE 14400
//#define BAUDRATE 28800
//#define BAUDRATE 57600
#define BAUDRATE 115200
// MACRO Definitions
//-----------------------------------------------------------------------------
// MACRO: UART_Send_CRLF()
// Parameters: NONE
// Definition: Macro that sends CR (0x0D) and LF (0x0A) via UART
// Obs:
//-----------------------------------------------------------------------------
#define UART_Send_CRLF() UART_Send_Word("\r\n",2)
//-----------------------------------------------------------------------------
// MACRO: UART_Send_SPACE()
// Parameters: NONE
// Definition: Macro that sends SPACE (0x20) via UART
// Obs:
//-----------------------------------------------------------------------------
#define UART_Send_SPACE() UART_Send_Byte(' ')
//-----------------------------------------------------------------------------
// Function Prototypes
//-----------------------------------------------------------------------------
#ifdef F53x_UARTS_SOURCE
void UART0_Initialize(void);
void UART0_ISR(void);
void UART_Send_Byte(uchar byte);
void UART_Send_Word(uchar __code *buf, uchar numb);
void UART_Send_HEX(uchar byte, uchar type)
void UART_Send_DEC(uchar byte, uchar zeros);
void Inc_UART_BUFFER_PUSH(void);
void Inc_UART_BUFFER_GET(void);
void Dec_UART_BUFFER_GET(void);
#else
extern void UART0_Initialize(void);
extern __interrupt void UART0_ISR(void);
extern void UART_Send_Byte(uchar byte);
extern void UART_Send_Word(uchar __code *buf, uchar numb);
extern void UART_Send_HEX(uchar byte, uchar type);
extern void UART_Send_DEC(uchar byte, uchar zeros);
extern void Inc_UART_BUFFER_PUSH(void);
extern void Inc_UART_BUFFER_GET(void);
extern void Dec_UART_BUFFER_GET(void);
extern uchar UART_BUFFER[UART_BUFFER_SIZE];
extern uchar UART_BUFFER_PUSH;
extern uchar UART_BUFFER_GET;
extern uchar UART_EVENT;
#endif // endif definition of F53x_UARTS_SOURCE
#endif // endif definition of __UART_H__
//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?