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

📄 main.c

📁 TL16C752 串口扩展芯片驱动 VDSP 环境
💻 C
字号:
#include "uart.h"
#include <cdefbf533.h>
#include <ccblkfn.h>
#include <stdio.h>

UART_Config UartConfig ={
	   0x00,/*寄存器IER*/
	   0x57,/*寄存器FCR*/
	   0x03,/*寄存器LCR*/
	   0x01,/*寄存器MCR*/
};

main()
{
	*pEBIU_AMBCTL0 = 0x78B078B0;
	*pEBIU_AMBCTL1 = 0x78B078B0;
	*pEBIU_AMGCTL |= 0xF;
	ssync();
	
	char *point = 0x20300020;
/*	while(1)
	{
		point = 0x20300020;
		//value = *point;
		*point = 0x5a;
		
	}*/

	int i,value[16],in,out;
	char *s = "hello world!\n\r";
/*
	for(i=0;i<16;i++)
	{
		value[i] = UART_rget(i*2);
	}
*/
/*	while(1)
	{
	UART_rset(3*2,0x3c);
	out = UART_rget(3*2);
	}*/
	
	UART_open(UART_BAUD9600,&UartConfig);
/*	
	for(i=0;i<10;i++)
	{
		value[i] = UART_rget(i*2);
	}
*/	
	while(*s)
	{
		UART_putChar(*s++);
	}
	
	//s = "Another string!";
	
	UART_puts(s);
	
	while(1)
	{
		s = "Another string!owsdhfoewfjsodfwejfashodfwfswuhahahahahawowo\n\r";
		UART_puts(s);
	}
	
	
}

⌨️ 快捷键说明

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