📄 iar-
字号:
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: Uart0.h
** Last modified Date: 2006-11-18
** Last Version: v1.0
** Description: 串口驱动头文件
**
**------------------------------------------------------------------------------------------------------
** Created By: Zhou Shaogang
** Created date: 2006-11-18
** Version: v1.0
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Description:
**
********************************************************************************************************/
#ifndef __UART0_H__
#define __UART0_H__
/************************************************************************************
** Function name: Uart0Init
** Descriptions: 初始化Uart0
** Input: BaudRate: 波特率
** Prio: 中断优先级
** Output: TRUE :成功
** FALSE:失败
** Created by: Zhou Shaogang
** Created Date: 2006-11-18
**----------------------------------------------------------------------------------
** Modified by:
** Modified Date:
**----------------------------------------------------------------------------------
************************************************************************************/
extern uint8 ucBuffer[200];
extern uint8 ucBit;
extern uint8 ucNum;
extern uint8 Uart0Init(uint32 BaudRate, uint8 Prio);
/************************************************************************************
** Function name: Uart0Send
** Descriptions: 发送多个字节数据
** Input: Buffer:发送数据存储位置
** NByte:发送数据个数
** Output: 无
** Created by: Zhou Shaogang
** Created Date: 2006-11-18
**----------------------------------------------------------------------------------
** Modified by:
** Modified Date:
**----------------------------------------------------------------------------------
************************************************************************************/
extern void Uart0Send(uint8 *Buffer, uint16 NByte);
/* 宏定义,设置FIFO的收发深度 */
#ifndef UART_O_IFLS
#define UART_O_IFLS 0x00000034
#endif
#define UARTFifoLevelSet(ulBase, RecLvl, TraLvl) HWREG(ulBase + UART_O_IFLS) = (HWREG(ulBase + UART_O_IFLS) & 0xFFFFFFC0) | (RecLvl<<3) | TraLvl
/* 宏定义,检查发送FIFO是否为空 */
#ifndef UART_O_FR
#define UART_O_FR 0x00000018
#endif
#ifndef UART_FR_TXFE
#define UART_FR_TXFE 0x00000080
#endif
#define UARTTraFifoEmp(ulBase) ( (HWREG(ulBase + UART_O_FR) & UART_FR_TXFE) ? true : false )
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -