uart270.h

来自「dm270 source code」· C头文件 代码 · 共 66 行

H
66
字号
/*
    DM270 ARM Evaluation Software

    (c)Texas Instruments 2003
*/

#ifndef _UART270_H_
#define _UART270_H_

/*----- Constant definitions for UART registers -----*/

#define UART_STOPBIT1	0
#define UART_STOPBIT2	1

#define UART_NO_PARITY		0
#define UART_ODD_PARITY		1
#define UART_EVEN_PARITY	2 

#define UART_PARITY_ENABLE	1     
#define UART_PARITY_DISABLE 0     

#define UART_CHAR_LEN_8 0
#define UART_CHAR_LEN_7 1

/* DTRR values */
#define DATA_VALID		0x1000
#define BREAK_DET		0x0800
#define FRAME_ERROR		0x0400
#define OVERRUN_ERROR	0x0200
#define PARITY_ERROR	0x0100

/* brsr values */
#define UART_2400		2400
#define UART_4800		4800
#define UART_9600		9600
#define UART_19200		19200
#define UART_38400		38400
#define UART_57600		57600
#define UART_115200		115200

#define UART_FIFO_RX		0
#define UART_FIFO_TX		1  

#define UART_CLEAR_FIFO	1

#define UART_TIMEOUT_NO_INT		0x00
#define UART_TIMEOUT3_INT		0x01
#define UART_TIMEOUT7_INT		0x02
#define UART_TIMEOUT15_INT		0x03

typedef enum {
	UART0,		///<	UART - 0	
	UART1		///<	UART - 1	
}UART_ID;	

typedef struct {
	unsigned int baudRate;
	unsigned char charLength;
	unsigned char stopBits;
	unsigned char parity;
} UART_ConfigData;

#endif /* _UART270_H_ */


⌨️ 快捷键说明

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