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

📄 uart.h

📁 硬件: PC机 1台 SeaARM2410教学实验开发平台 1台 软件: Windows 98/2000/XP操作系统 ADS 1.2集成开发环境
💻 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);
extern void  UART_Init(void);
extern void Uart_Init1(int pclk,int baud);
extern int  UART_Select(uint8  no);


extern void Uart_Printf(char *fmt,...);
extern char Uart_Getch(void);


/********************************************************************************************************/
    #ifdef __cplusplus
    }
    #endif  

#endif      // IN_UART    

#endif      // __UART_H
/*********************************************************************************************************
**                            End Of File
********************************************************************************************************/

⌨️ 快捷键说明

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