📄 dma1-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 4
#include<fract.h>
void Init_MYMDMA1(fract16 *SorseADDR,fract16 *GoalADDR,u32 DMA_Count)
{
//Target address of the DMA
*pMDMA_D1_START_ADDR = GoalADDR;
//Line_Length 16bit transfers will be executed
*pMDMA_D1_X_COUNT =DMA_Count;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_D1_X_MODIFY = 0x2;
//Frame_Length 16bit transfers will be executed
*pMDMA_D1_Y_COUNT = 1;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_D1_Y_MODIFY = 0x2;
//PPI Peripheral is used
*pMDMA_D1_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_D1_CONFIG = DMAEN | DI_EN | DMA2D| WNR|WDSIZE_16| DI_EN;
//SORSE address of the DMA
*pMDMA_S1_START_ADDR = SorseADDR+1;
//Line_Length 16bit transfers will be executed
*pMDMA_S1_X_COUNT = DMA_Count;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_S1_X_MODIFY = 0x2;
//Frame_Length 16bit transfers will be executed
*pMDMA_S1_Y_COUNT =1;
//The modifier is set to 2 because of the 16bit transfers
*pMDMA_S1_Y_MODIFY = 0x2;
//PPI Peripheral is used
*pMDMA_S1_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_S1_CONFIG = DMAEN | DI_EN |DMA2D| WDSIZE_16| DI_EN;
//*pMDMA_S1_CONFIG = DMAEN | DI_EN | WNR |DMA2D| WDSIZE_16| DI_EN;
}//end DMA1——init
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -