main.c

来自「TL16C752 串口扩展芯片驱动 VDSP 环境」· C语言 代码 · 共 67 行

C
67
字号
#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 + =
减小字号Ctrl + -
显示快捷键?