serial.h

来自「AT91所有开发板的资料 AT91所有开发板的资料」· C头文件 代码 · 共 106 行

H
106
字号

/*************************************************************
 *
 *	ARM Strategic Support Group
 *
 *************************************************************/

/*************************************************************
 *
 *	Module		: serial.h
 *	Description	: simple code to drive the serial port on the
 *				  Evaluator7T.
 * 	Tool Chain	: ARM Developer Suite 1.0
 * 	Platform	: Evaluator7T
 * 	History		:
 *
 *		2000-3-29 Andrew N. Sloss
 *		- started serial module
 *
 **************************************************************/
 
/**************************************************************
 * IMPORT
 **************************************************************/
 
// none...

/**************************************************************
 * MACROS
 **************************************************************/

#define BAUD_9600	   	(162 << 4)

#define COM1_DEBUG		(1)
#define COM0_USER		(0)

/**************************************************************
 * DATATYPES
 **************************************************************/

// none...

/**************************************************************
 * STATICS
 **************************************************************/

// none...

/**************************************************************
 * ROUTINES
 **************************************************************/

/* -- serial_initcom0user --------------------------------------
 *
 * Description	: initializes the USER/COM0 serial port.
 *
 * Parameters	: unsigned baudrate - baudrate i.e. 9600
 * Return		: none...
 * Notes		: none...
 *
 */

void serial_initcom0user (unsigned baudrate);

/* -- serial_initcom1debug -------------------------------------
 *
 * Description	: initializes the DEBUG/COM1 serial port.
 *
 * Parameters	: unsigned baudrate - baudrate i.e. 9600
 * Return		: none...
 * Notes		: none...
 *
 */
 
void serial_initcom1debug (unsigned baudrate);

/* -- serial_print ---------------------------------------------
 *
 * Description	: print out a string through the com port
 *
 * Parameters	: unsigned port - USER/DEBUG
 * 				: char *s - string to be printed out.
 * Return		: none...
 * Notes		: none...
 *
 */

void serial_print (unsigned port, char *s);		
	
/* -- serial_getkey --------------------------------------------
 *
 * Description	: standard implementation of getkey.
 *
 * Parameters	: none...
 * Return		: none...
 * Notes		: 
 *
 *			waits until a key is pressed then echo's back.
 *
 */	
	
void serial_getkey (void);	
		
/*****************************************************************
 * END OF serial.h 
 *****************************************************************/

⌨️ 快捷键说明

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