📄 uart.c
字号:
/*C**************************************************************************
* 文件名: Uart.c
*----------------------------------------------------------------------------
* 版权: (c) 2004 TGE.
*----------------------------------------------------------------------------
* 释放: Spce061A
* 版本: 1.0
*----------------------------------------------------------------------------
* 目的:
* This is the demonstration software for SPCE061A
*****************************************************************************/
/*_____ 包括 ________________________________________________________*/
#include "Uart.h"
#include "..\\public\\public.h"
#include "..\\spce061\\061reg.h"
/*_____ 宏 ________________________________________________________*/
/*_____ 定义 ________________________________________________________*/
/*_____ 声明 ________________________________________________________*/
void UartInitial()
{
Set_UART_Command1(0x20); //Urat Reset
Set_UART_Command1(0x00); //Disable Tx&Rx IRQ and UART Parity
Set_UART_BaudScalarLow(0x80);
Set_UART_BaudScalarHigh(0x02); //Set UART Baud Rate 9600 Bps
Set_UART_Command2(C_UART_Tx_Pin_ENB); //Enable Tx
}
void UartSendData(unsigned int Data)
{
Set_UART_Data(Data); //Send Data
while( !(Get_UART_Command2() & C_UART_Tx_RDY) ); //Wait Send Over
}
void UartSendString(unsigned char * pData)
{
while(NULL != (*pData))
{
UartSendData((*pData));
pData++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -