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

📄 dmadebug.c

📁 USB固件驱动,ISP1581评估板的MPEG方案源码
💻 C
字号:
//***********************************************************************
//									     								*
//                P H I L I P S   P R O P R I E T A R Y          		*
//                                                                      *
//          COPYRIGHT (c)   1999 BY PHILIPS SINGAPORE (APIC).    		*
//                    --  ALL RIGHTS RESERVED  --                 		*	
//                                                                      *
// 	File Name	:       DMADebug.c                                      *
// 	Author		:       Albert Goh					 					*
// 	Created		:      	3 March 2000                               		*
//                  	                                                *
//***********************************************************************
//***********************************************************************
//                                                                      *
// GDMADebug.c is the file that contain the routine for the GDMA debug  *
// It will be able to configured as master for slave for the debugging	*
//                                                                      *
//***********************************************************************
//***********************************************************************
//                                                                      *
//  Module History														*
//  **************														*
//																		*
//  Date   	Version			Author				Changes					*
//  ====	=======			======				=======					*
//  030300	  0.1 			Albert				Created    				*
//                                                                      *
//                                                                      *
//***********************************************************************

//***********************************************************************
//*																		*
//*	                     Include Files Definition						*
//*																		*
//***********************************************************************

#include "standard.h"
#include "Kernel.h"
#include "D14.h"
//***********************************************************************
//*																		*
//*	                 External Variable Definition 					    *
//*																		*
//***********************************************************************

extern USB_DEVICE USB_Device;
extern DMA_INT_FLAG DMA_Int_Flag;
extern USB_INT_FLAG USB_Int_Flag;
extern volatile D14_CNTRL_REG xdata	D14_Cntrl_Reg;
//extern D14_CNTRL_REG pdata *D14_Cntrl_Ptr;
extern void Start_mSEC_Timer(Data);
extern UC Data;
extern UI Temp;
extern KERNEL Kernel_Flag;
extern ULI 	bytecount;
extern FILESIZE	idata FileSize;
extern UI	count;
extern UC idata Endpt_FIFO[64];
extern UC Type;

//***********************************************************************
//*																		*
//*	                     Variable Definition 							*
//*																		*
//***********************************************************************

//***********************************************************************
//*																		*
//*	                     Prototype Definition 							*
//*																		*
//***********************************************************************

//***********************************************************************
//*																		*
//*	                     Routine Definition								*
//*																		*
//***********************************************************************
void DMA_Init(void);
//***********************************************************************
//*										    							*
//*	Routine 	:	                                               		*
//*	Input		:	                 									*
//*	Output		:	                                   					*
//*	Function	:	                                         			*
//*																		*
//***********************************************************************
void DMA_Init(void)
{
int i;
//	DMA_EXT_EOT = 0;	//Stop for external DMA Master controller (P10).

	EOT = 1;	//Stop external DMA
 	for(i=0; i<1000;i++)
	EOT = 0;	//Enable External DMA 
	D14_Cntrl_Reg.D14_DMA_COMMAND = 0x0F; //Clear Buffer CMD.
	D14_Cntrl_Reg.D14_DMA_COMMAND = 0x0E; //Validate Buffer CMD.
	D14_Cntrl_Reg.D14_DMA_COMMAND = 0x11; //Reset DMA CMD.


//	D14_Cntrl_Reg.D14_DMA_CONFIG.VALUE =  0x9800;//0x9900 //setting as listed below. 
	D14_Cntrl_Reg.D14_DMA_CONFIG.VALUE |=  0x9900; //setting as listed below. 

//	D14_Cntrl_Reg.D14_DMA_CONFIG.BITS.WIDTH = 1; //set to 16bit data bus
//	D14_Cntrl_Reg.D14_DMA_CONFIG.BITS.DMA_MODE = 0x2;//Use DACK as a strobe signal
//	D14_Cntrl_Reg.D14_DMA_CONFIG.BITS.BURST = 0x01;//DREQ is asserted and negated for each byte/word transferred.
//	D14_Cntrl_Reg.D14_DMA_CONFIG.BITS.CNTENA = 0x01;//Set to 1, disable the DMA transfer counter.
//	D14_Cntrl_Reg.D14_DMA_CONFIG.BITS.ATA_MODE = 0;	//set to 0 for DMA slave mode



	D14_Cntrl_Reg.D14_DMA_HARDWARE.VALUE |= 0x64;	//setting as listed below. 
//	D14_Cntrl_Reg.D14_DMA_HARDWARE.VALUE = 0x24;	//setting as listed below. 

//	D14_Cntrl_Reg.D14_DMA_HARDWARE.BITS.DREQ_POL =	1; //Set DREQ active high
//	D14_Cntrl_Reg.D14_DMA_HARDWARE.BITS.ACK_POL	= 0; //Set DACK active low
//	D14_Cntrl_Reg.D14_DMA_HARDWARE.BITS.ACK_POL	= 1 ; if Value = 0x2c //Set DACK active low
// 	D14_Cntrl_Reg.D14_DMA_HARDWARE.BITS.MASTER = 0; //set to GDMA slave mode
//	D14_Cntrl_Reg.D14_DMA_HARDWARE.BITS.EOT_POL = 1;//set EOT active high
//	D14_Cntrl_Reg.D14_DMA_HARDWARE.BITS.ENDIAN = 1; //Modified Endian to swapped mode 


	D14_Cntrl_Reg.D14_DMA_INT_ENABLE.VALUE |= 0x0008; //enable EXT_EOT



	D14_Cntrl_Reg.D14_DMA_ENDPOINT = 3;		//set to DMA IN endpoint 1,  b:0000 0011
								

//	Kernel_Flag.BITS.Out_Reset_Done = 0;
//	Kernel_Flag.BITS.In_Reset_Done = 0;
//	Kernel_Flag.BITS.MPIO_Out_Reset_Done = 0;
///	Kernel_Flag.BITS.MPIO_In_Reset_Done = 0;

//	DMA_EXT_EOT = 1;
	
	Kernel_Flag.BITS.Transfer_Start = 1;	
}


⌨️ 快捷键说明

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