📄 lpc_lib_uart.h
字号:
/***********************************************************************
Embest Info&Tech Co., Ltd. All rights reserved.
www.embedinfo.com
file : lpc_lib_uart.h
author : embest
establish: 2006.4.3
modify :
notes : the uart communication library head file
***********************************************************************/
/*-------------------------------------------------------------------*/
/* compiler condition */
/*---------------------------------------------------------------- --*/
#ifndef lpc_lib_uart
#define lpc_lib_uart
/*-------------------------------------------------------------------*/
/* include files */
/*---------------------------------------------------------------- --*/
#include "..\..\com\type_redefine.h"
#include "..\..\com\lpc22xx_register.h"
#include "..\..\com\lpc_lib_pll\lpc_lib_pll.h"
#include "..\..\com\lpc_lib_spi\lpc_lib_spi.h"
#include "..\..\com\22eb06_lib_modulecontrol\22eb06_lib_modulecontrol.h"
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
/*-------------------------------------------------------------------*/
/* constant define */
/*---------------------------------------------------------------- --*/
#define P0_0_TXD0_PINSEL0 (0x01)
#define P0_1_RXD0_PINSEL0 (0x01<<2)
#define P0_0_TXD0_PINSEL0_MASK (0x03)
#define P0_1_RXD0_PINSEL0_MASK (0x03<<2)
#define P0_UART0_PINSEL0 (P0_0_TXD0_PINSEL0+P0_1_RXD0_PINSEL0)
#define P0_UART0_PINSEL0_MASK (P0_0_TXD0_PINSEL0_MASK+P0_1_RXD0_PINSEL0_MASK)
#define P0_UART1_PINSEL0_MASK (0x0F<<16)
#define P0_UART1_PINSEL0 (0x05<<16)
/*-------------------------------------------------------------------*/
/* function/variable declare */
/*-------------------------------------------------------------------*/
void uart0_init(INT32U BaudRate);
void uart0_sendch(INT8U data);
void uart0_sendstr(INT8U *str);
INT8U uart0_getch(void);
void uart0_getstr(INT8U *str);
INT8U uart0_getkey(void);
void uart0_printf(INT8U *fmt,...);
void uart0_close(void);
void uart1_init(INT32U BaudRate);
void uart1_sendch(INT8U data);
INT8U uart1_getch(void);
INT8U uart1_getkey(void);
void uart1_close(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -