dma_config.c

来自「BF533的程序」· C语言 代码 · 共 48 行

C
48
字号
/******************************************************************************/
//
// Name: 	BF532-based EZ-KIT DMA Setup
//
/******************************************************************************

Purpose:		The file sets up the DMA transfer
				
				

*********************************************************************************/


#include <cdefBF533.h>
#define Line_Length 720
#define Frame_Length 576



void Init_DMA(void)
{

	//Target address of the DMA
	*pDMA0_START_ADDR = 0x00;	

	//Line_Length 16bit transfers will be executed
	*pDMA0_X_COUNT = Line_Length;

	//The modifier is set to 2 because of the 16bit transfers
	*pDMA0_X_MODIFY = 0x2;	
														
	//Frame_Length 16bit transfers will be executed
	*pDMA0_Y_COUNT = Frame_Length;

	//The modifier is set to 2 because of the 16bit transfers
	*pDMA0_Y_MODIFY = 0x2;	

	//PPI Peripheral is used
	*pDMA0_PERIPHERAL_MAP = 0x0;	
	
	//DMA Config: Enable DMA | Memory write DMA | 2-D DMA | Discard DMA FIFO before start | enable assertation of interrupt | NDSIZE for stop mode | Enable STOP DMA
	*pDMA0_CONFIG =0x10b7; //DMAEN | DI_EN | WNR | WDSIZE_16| DMA2D | RESTART | DI_EN;	
	

}//end Init_DMA


⌨️ 快捷键说明

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