uart_userconfig.h

来自「epson usb2.0 控制芯片 S1R72V05 固件程序。」· C头文件 代码 · 共 97 行

H
97
字号
/*
================================================================================
* @file   UART_UserConfig.h
* @brief  User defined definitions
* @author 2006/03/29 Michiru Kagaya
* Copyright (C)SEIKO EPSON Corp. All Rights Reserved.
================================================================================
*/
#ifndef UART_USER_CONFIG_H
#define UART_USER_CONFIG_H

#ifdef __cplusplus
	extern "C" {
#endif /* defined(__cplusplus) */

#ifndef _MSC_VER
	#include "kernel.h"
#endif

//-------------------------------------------------------
// When the software is OS dependent,please use the following functions
// to update in order to match the OS.
//--------------------------------------------------------
#define UART_DELAY_TIME			10		// 10ms

#ifdef _MSC_VER
	#define UART_DISABLE_INT()
	#define UART_ENABLE_INT()
	#define UART_DELAY( dlyTim )
#else
	#define UART_DISABLE_INT()		loc_cpu();
	#define UART_ENABLE_INT()		unl_cpu();
	#define UART_DELAY( dlyTim )	dly_tsk( dlyTim );
#endif // _MSC_VER

// The numbr of validate channel
#define MAX_UART_CHANNEL	1

// --- Baud rate ---
enum {
	UART_FUNC_BRATE_BEGIN = 1,		// Begin identifier
	UART_FUNC_BRATE_9600,			//	 9600bps
	UART_FUNC_BRATE_19200,			//	19200bps
	UART_FUNC_BRATE_38400,			//	38400bps
	UART_FUNC_BRATE_57600,			//	57600bps
	UART_FUNC_BRATE_115200,			// 115200bps
	UART_FUNC_BRATE_234000,			// 234000bps
	UART_FUNC_BRATE_468000,			// 468000bps
	UART_FUNC_BRATE_921600,			// 921600bps
	UART_FUNC_BRATE_END,			// End identifier
};

// Data bit
enum {
	UART_FUNC_DATABIT_BEGIN = 1,	// Begin identifier
	UART_FUNC_DATABIT_5,			// Data bit 5
	UART_FUNC_DATABIT_6,			// Data bit 6
	UART_FUNC_DATABIT_7,			// Data bit 7
	UART_FUNC_DATABIT_8,			// Data bit 8
	UART_FUNC_DATABIT_END,			// End indentifier
};


// --- Parity ---
enum {
	UART_FUNC_PRITY_BEGIN = 1,		// Begin identifier
	UART_FUNC_PRITY_NONE,			// No parity
	UART_FUNC_PRITY_ODD,			// Even parity
	UART_FUNC_PRITY_EVEN,			// Odd parity
	UART_FUNC_PRITY_MARK,			// MARK parity
	UART_FUNC_PRITY_SPACE,			// SPACE parity
	UART_FUNC_PRITY_END,			// End indentifier
};

// --- Flow control ---
enum {
	UART_FUNC_FLOW_BEGIN = 1,		// Begin identifier
	UART_FUNC_FLOW_NONE,			// No flow control
	UART_FUNC_FLOW_HARDWARE,		// Hardware control
	UART_FUNC_FLOW_XONXOFF,			// Xon/XOff
	UART_FUNC_FLOW_END,				// End indentifier
};

// --- Stop bit ---
enum {
	UART_FUNC_STOPBIT_BEGIN = 1,	// Begin identifier
	UART_FUNC_STOPBIT_1,			// 1bit
	UART_FUNC_STOPBIT_2,			// 2bit
	UART_FUNC_STOPBIT_END,			// End indentifier
};

#ifdef __cplusplus
	}
#endif // __cplusplus

#endif // UART_USER_CONFIG_H

⌨️ 快捷键说明

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