📄 uarttest.c
字号:
/*
* Copyright 2005 by SEED.
* All rights reserved. Property of SEED.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/*
* ======== uarttest.c ========
*/
/*#include <std.h>
#include <log.h>
#include <gio.h>
#include <iom.h>
#ifdef _6x_
extern far LOG_Obj trace;
#else
extern LOG_Obj trace;
#endif*/
#include "DM642.h"
void main()
{
int temp,time1,time2;
int i,j;
int tmp1;
if(PCFGLOCK == 1)
{
PCFGLOCK = 0x10c0010c;
}
PERCFG =0x00000010;
temp = PERCFG;
for(i=0;i<=1300;i++)
temp = PERCFG;
///DSP中断设置
CSR = CSR&0xfffffffe;//末位置0
/* MUXH = 0x19;
MUXL=0x630000a4;
EXTPOL= 0x0000000f;//设置外部中断电平*/
IER = 0x633; //0x403; ////中断使能
ICR = 0xffff;
CSR = CSR|1;//末位置1
/////////////EMIF//////////////
GBLCTL = 0x00052078;
CECTL0 = 0xffffffd3;
CECTL1 = 0x73a28e01;
CECTL2 = 0x73a28e01;
CECTL3 = 0x73a28e01;
SDTIM = 0x0000081b;
SDEXT = 0x001faf4d;
CESEC1 = 0x00000002;
CESEC0 = 0x00000002;
CESEC2 = 0x00000002;
CESEC3 = 0x00000073;
SDCTL = 0x57115000;
//---------------------------------------------------------------------------------
*((volatile unsigned char *)0xa00f0003)= 0x80; for(j=0;j<700000;j++);//lcr
*((volatile unsigned char *)0xa00f0000)= 0x30; for(j=0;j<700000;j++);//sudu
*((volatile unsigned char *)0xa00f0001)= 0x00; for(j=0;j<700000;j++);
*((volatile unsigned char *)0xa00f0003)= 0x03; for(j=0;j<700000;j++);//lcr
*((volatile unsigned char *)0xa00f0004)= 0x09; for(j=0;j<700000;j++);//mcr
*((volatile unsigned char *)0xa00f0002)=0x0f; for(j=0;j<700000;j++);// //fcr
*((volatile unsigned char *)0xa00f0002)= 0x09; for(j=0;j<700000;j++);
*((volatile unsigned char *)0xa00f0001)= 0x01; //ie
for(i=0;i<700000;i++);
*((volatile unsigned char *)0xa0000004)= 0x80;
// HWI_enable();
// IRQ_enable(IRQ_EVT_DMAINT1);
vpcap();
/* while(1)
{
i++;
}*/
}
void Serial1()
{
int j,i;
ICR = 0x10;
i = *((volatile unsigned char *)0xa00f0000);///READ UART DATA
for(j=0;j<500000;j++);
*((volatile unsigned char *)0xa00f0000)=i;////WRITE BACK
}
void echo()
{
int i;
// while(1)
i++;
}
void e1()
{
int i;
i++;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -