uart.h

来自「混泰CH7023,CH7024,CH7025视频解码芯片」· C头文件 代码 · 共 54 行

H
54
字号
#ifndef _UART_H
#define _UART_H

/***************************************************************************************

	FileName: 		UART.H

	CPU:  			Samsung 2410
	
	System:			WinCE 4.2

	Description:	This class can be used to operator UART to send or receive chars.
	
	Author:   		JUNFENG WANG

	Create Date:	2007-5-10	

	Modify:			2007-6-22	By JUNFENG WANG
	
*****************************************************************************************/

#include "s3c2410.h"

#define UART_NO_INPUT 0

class UART{
private:
	static volatile S3C2410_IOPreg *s2410IOP;
	static volatile S3C2410_UART0reg *s2410UART;

public:
	UART(){}
	~UART(){}
private:
	//init GPIO for UART
	void Initialize();

public:
	//send one byte...
	void SendByte(UCHAR const data);
	//send multiple bytes...
	void SendString(UCHAR* const str);
	//receive one key from keyboard...
	UCHAR GetKey();
	//See if there is input
	UCHAR TryGetKey();
	
public:
	//just for test...
	UINT Test();
};


#endif //UART_H

⌨️ 快捷键说明

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