?? uart.h
字號(hào):
/*----------------------------------------------------------------------------
* Copyright (c) 2001 by National Semiconductor Corporation
* National Semiconductor Corporation
* 2900 Semiconductor Drive
* Santa Clara, California 95051
*
* All rights reserved
*
*<<<-------------------------------------------------------------------------
* File Contents:
* Uart.cpp - Overlapped serial IO communication class.
*
* Project: USB Demo Application
* Author : Yan Nosovitsky
* Date : Dec 2001
*----------------------------------------------------------------------->>>*/
#ifndef _UART_H_
#define _UART_H_
#include <windows.h>
class Uart
{
private:
HANDLE uartHandle; // Device handle
public:
Uart();
~Uart() { CloseUART(); }
// For more definitions see <winbase.h>
BOOL OpenUART(LPCSTR lpszPortNum = "com1",
DWORD dwBaudRate = CBR_19200,
BYTE byParity = ODDPARITY,
BYTE byStopBits = ONESTOPBIT,
BYTE byByteSize = 8);
void CloseUART(VOID);
bool WriteData(BYTE* pdata, DWORD len);
DWORD ReadData(BYTE* pdest, DWORD len, DWORD dwMaxWait = 10000);
private:
BOOL IsNT(VOID);
};
#endif // _UART_H_
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -