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

📄 da.c

📁 三星2410开发板的da转换的源码
💻 C
字号:

#include <stdlib.h>
#include <string.h>

//Shin, On Pil
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"

#include "2410etc.h"
#include "2410IIC.h"
#include "2410iis.h"
#include "2410int.h"
#include "2410RTC.h"
#include "2410swi.h"
//#include "cpuspeed.h"
//#include "lcdpwr.h"
#include "timer.h"

//Kang, Weon Tark
#include "adc.h"
#include "dma.h"
#include "dma2.h"
#include "eint.h"
#include "extdma.h"
#include "k9s1208.h"
#include "mmu.h"
#include "nwait.h"
#include "sdi.h"
#include "stone.h"
#include "ts_auto.h"
#include "ts_sep.h"
#include "usbfifo.h"

//Shin, Jeong Seuk
#include "IrDA.h"
#include "lcd.h"
#include "lcdlib.h"
#include "glib.h"
#include "palette.h"
#include "spi.h"
#include "uart0.h"
#include "uart1.h"
#include "uart2.h"

//Kong, In Wook
#include "etc.h"
#include "flash.h"
#include "idle.h"
#include "pd6710.h"
#include "pll.h"
#include "power.h"
#include "pwr_c.h"
#include "stop.h"



void delay11(int i)//延时
{
	int k,j;
	for(k=0;k<=i;k++)
	   for(j=0;j<50;j++);
}
void Test_DA(void)
{
	int i,j;
	char rx;
	short x=0xffff;
	short t[64]={128,134,140,146,152,158,163,168,173,177,
     181,184,187,189,190,191,192,191,190,189,187,184,181,177,
     173,168,163,158,152,146,140,134,128,121,115,109,103,97,92,
     87,82,78,74,71,68,66,65,64,64,64,65,66,68,71,74,78,82,87,
     92,97,103,109,115,121};
/*******定义DA转换芯片的地址**********/
	volatile short * DAAdr=(volatile short*)(0x28800000);
	volatile short * DAAdr1=(volatile short*)(0x28800400);

    Uart_Printf(" DA-Output=2.5sin(2*pi*50/3200*k)\n  ");

    Uart_Printf(" press ESC to exit\n  ");
    
	while(1)
	{
/*******向DA转换芯片中写入数据*********/
	for(i=0;i<64;i++)
		{   //Uart_Printf("%x\n",t[j][i]);
			//x=(t[i]<<16)|0x0000ffff;
			x=t[i];
			*DAAdr=x;
			*DAAdr1=x;
			delay11(2);
		}
 		if(rUTRSTAT0&0x1)
		  {
 			rx=rURXH0;
// 			Uart_Printf("%c",rx);
 		  }
 		if(rx==ESC_KEY)
 		  break;

	}	
}

⌨️ 快捷键说明

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