?? uart.h
字號:
/*******************************************************************************************************
**UART.h
*******************************************************************************************************/
#ifndef __UART_H
#define __UART_H
#ifndef IN_UART
#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************************************************
** Function name: UART_Select
** Descriptions: 選擇要操作的串口。(UART0--0,UART1--1)
** 選擇串口后,必需調用一次UART_Init()進行初始化(只需要一次)。
** Input: no 要使用的串口
** Output: 返回上一次選用的串口
********************************************************************************************************/
extern int UART_Select(uint8 no);
/********************************************************************************************************
** Function name: UART_Init
** Descriptions: 初始化串口。設置為8位數據位,1位停止位,無奇偶校驗,波特率為UART_BPS
** Input: 無
** Output: 無
********************************************************************************************************/
extern void UART_Init(void);
/********************************************************************************************************
** Function name: UART_SendByte
** Descriptions: 向串口發送字節數據,并等待發送完畢。
** Input: data 要發送的數據
** Output: 無
********************************************************************************************************/
extern void UART_SendByte(uint8 data);
/********************************************************************************************************
** Function name: UART_SendStr
** Descriptions: 向串口發送一字符串。
** 對于'\n'字符,發送時會加入'\r'字符。
** Input: str 要發送的字符串的指針
** Output: 無
********************************************************************************************************/
extern void UART_SendStr(char const *str);
/********************************************************************************************************
** Function name: UART_GetKey
** Descriptions: 從UART口讀取一字節按鍵數據。
** 會一直等待,直到接收到1字節數據。
** Input: 無
** Output: 返回值即是讀出值
********************************************************************************************************/
extern int UART_GetKey(void);
/********************************************************************************************************/
#ifdef __cplusplus
}
#endif
#endif // IN_UART
#endif // __UART_H
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -