serial_lpc23xx_v1_00.h

来自「LPC2300 MP3 Player code」· C头文件 代码 · 共 41 行

H
41
字号
//Using  : Use for interfacing with UART of LPC23xx
//Description : please predefine device index of interface, 
//	for example #define CONSOLE		0 --> using serial port 0 as console

#ifndef _SERIAL_LPC23XX_H_
#define _SERIAL_LPC23XX_H_

#define MAX_SERIAL		4
#define SER_FIFO_SIZE	16

#define U_RBR          	0x00
#define U_THR          	0x00
#define U_DLL          	0x00
#define U_DLM          	0x04
#define U_IER          	0x04
#define U_IIR          	0x08
#define U_FCR          	0x08
#define U_LCR          	0x0C
#define U_LSR          	0x14
#define U_SCR          	0x1C
#define U_ACR          	0x20
#define U_ICR          	0x24
#define U_FDR          	0x28
#define U_TER          	0x30

#define SER_RXD_RDY 	0x01
#define SER_OVR_ERR 	0x02
#define SER_PAR_ERR 	0x04
#define SER_FRM_ERR 	0x08
#define SER_TXD_EMP		0x40

void SerialInit(unsigned char dev,unsigned char dll,unsigned char fdr); //initial UART
unsigned char SerialIsRxError(unsigned char dev);
unsigned char SerialIsRxReady(unsigned char dev);
char SerialGetRx(unsigned char dev);	
unsigned char SerialIsTxEmpty(unsigned char dev);
void SerialSendTx(unsigned char dev,char c);

#endif

⌨️ 快捷键说明

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