📄 dma0_config.c
字号:
/******************************************************************************/
//
// Name: BF533 EZ-KIT DMA Setup DSP作业(求FFT和DMA综合)
//
/******************************************************************************
// (C) Copyright 2006 - 王启源,指导教师:吴强 导师:阮晓钢 人工智能与机器人研究所,
// File Name: DMA_Config.c
// Date Modified: 5/21/07 $Revision: 1.00 $
// Software: VisualDSP++4.5
// Hardware: ADSP-BF533 EZ-KIT Board
// Special Connections: None
// Purpose: The file sets up the DMA transfer
// By: Lions Wang BJUT AI&Robots Tuttor: Ruan Xiaogang.
// See also: 实验报告
// explaination: 当然可以用直接写的方式将XYZ写入SDRAM但是那样损失了DSPcore的速度
// ALL RIGHTS RESERVED.
*********************************************************************************/
#include <services/services.h>
//#include "ezkitutilities.h"
#include <cdefBF533.h>
#define Line_Length 1024
#define Frame_Length 1
#include<fract.h>
//void Init_MYMDMA0(fract16 *Sorse1ADDR,fract16 *Goal1ADDR,u32 DMA_Count1,fract16 *Sorse1ADDR,fract16 *Goal1ADDR,u32 DMA_Count1)
void Init_MYMDMA0(fract16 *Sorse1ADDR,fract16 *Goal1ADDR,u32 DMA_Count1)
{
//Target address of the DMA
*pMDMA_D0_START_ADDR = Goal1ADDR;
//Line_Length 16bit transfers will be executed
*pMDMA_D0_X_COUNT =DMA_Count1;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_D0_X_MODIFY = 0x2;
//Frame_Length 16bit transfers will be executed
*pMDMA_D0_Y_COUNT = Frame_Length;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_D0_Y_MODIFY = 0x2;
//PPI Peripheral is used
*pMDMA_D0_PERIPHERAL_MAP = 0x0040;
//MDMA Config: Enable MDMA | Memory write MDMA | 2-D MDMA | Discard MDMA FIFO before start | enable assertation of interrupt | NDSIZE for stop mode | Enable STOP MDMA
*pMDMA_D0_CONFIG = DMAEN | DMA2D| WNR|WDSIZE_16| DI_EN;
//SORSE address of the DMA
*pMDMA_S0_START_ADDR = Sorse1ADDR+1;
// u32 *Response_Count=0x00020000; // location to store result from system services calls
// Response_Count=0x00001000;
// *Response_Count=0x00002000;
//Line_Length 16bit transfers will be executed
*pMDMA_S0_X_COUNT = DMA_Count1;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_S0_X_MODIFY = 0x2;
//Frame_Length 16bit transfers will be executed
*pMDMA_S0_Y_COUNT = Frame_Length;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_S0_Y_MODIFY = 0x2;
//PPI Peripheral is used
*pMDMA_S0_PERIPHERAL_MAP = 0x0040;
//MDMA Config: Enable MDMA | Memory write MDMA | 2-D MDMA | Discard MDMA FIFO before start | enable assertation of interrupt | NDSIZE for stop mode | Enable STOP MDMA
*pMDMA_S0_CONFIG = DMAEN | DMA2D| WDSIZE_16| DI_EN;
//*pMDMA_S0_CONFIG = DMAEN | DI_EN | WNR |DMA2D| WDSIZE_16| DI_EN;
}//end Init_DMA0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -