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

📄 serial.h

📁 lpc2368 usb cdc的测试程序
💻 H
字号:
/*----------------------------------------------------------------------------
 *      Name:    serial.h
 *      Purpose: serial port handling
 *      Version: V1.00
 *----------------------------------------------------------------------------
 *      This file is part of the uVision/ARM development tools.
 *      This software may only be used under the terms of a valid, current,
 *      end user licence from KEIL for a compatible version of KEIL software
 *      development tools. Nothing else gives you the right to use it.
 *
 *      Copyright (c) 2005-2007 Keil Software.
 *---------------------------------------------------------------------------*/

#include "type.h"

#define SER_BUF_SIZE 64
//#define SER_BUF_SIZE 256

/*----------------------------------------------------------------------------
 buffer handling related prototypes
 *---------------------------------------------------------------------------*/
typedef struct {
	int   in;
	int   out;
	char *buf;
} buf_t;


void buf_Init (buf_t *buf, char *buffer);
BOOL buf_Put  (buf_t *buf, char  c);
BOOL buf_Get  (buf_t *buf, char *c);
int	 buf_Free (buf_t *buf);

/*----------------------------------------------------------------------------
 Serial interface related prototypes
 *---------------------------------------------------------------------------*/
extern void ser_SetLineCoding (DWORD baudrate, BYTE databits, BYTE parity, BYTE stopbits);
extern void ser_Init          (void);
extern BYTE ser_GetMSR        (void);
extern BYTE ser_GetLSR        (void);
extern int  ser_GetChar       (void);
extern int  ser_PutChar       (int);
extern int  ser_PutString     (const char *);
extern BOOL ser_AvailChar     (void);

⌨️ 快捷键说明

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