⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uart.h

📁 编译后直接运行的MP3播放器全部C语言源代码 一个包含FAT文件系统、系统引导 Boot、FLASH Driver等内容的
💻 H
字号:
// A general definition for the required UART functionality.// This will be used to gain platform abstraction.#ifndef _UART_H#define _UART_H// data typestypedef void* tUartHandle;#define INVALID_UART_HANDLE (tUartHandle)-1typedef enum{	eNOPARITY,	eODDPARITY, 	eEVENPARITY,	eMARKPARITY,	eSPACEPARITY,} tParity;typedef enum{	eONESTOPBIT,	eONE5STOPBITS,	eTWOSTOPBITS,} tStopBits;// prototypestUartHandle UartOpen(   // returns NULL on error	char* szPortName);  // COMx for windowsbool UartConfig(         // returns true on success, false on error	tUartHandle handle,  // the handle returned from UartOpen()	long lBaudRate,      // must be one of the "standard" baudrates	tParity nParity,     // what kind of parity	tStopBits nStopBits, // how many stop bits	int nByteSize);      // size of the "payload", can be 5 to 8long UartWrite(           // returns how much data was actually transmitted	tUartHandle handle,   // the handle returned from UartOpen()	unsigned char* pData, // pointer to the data to be transmitted	long lSize);          // how many byteslong UartRead(              // returns how much data was actually received	tUartHandle handle,     // the handle returned from UartOpen()	unsigned char* pBuffer, // pointer to the destination	long lSize);            // how many bytes to read (pBuffer must have enough room)void UartClose(tUartHandle handle);#endif // _UART_H

⌨️ 快捷键说明

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