gpt4 book ai didi

c - X_MODIFY在ADSP-BF537的DMA中起什么作用? (模拟设备)

转载 作者:行者123 更新时间:2023-11-30 17:19:44 25 4
gpt4 key购买 nike

我在试图找出 EZ-Kit Lite BF537 中的“X_MODIFY”时遇到了问题。 (Analog Devices)的意思,它是DMA配置的一部分。它到底改变了什么?这是循环开始后执行的步骤吗?

这是代码。你们可以在 Woon-Seng Gan 和 Sen M. Kuo 所著的嵌入式信号处理与微信号架构一书中的示例部分找到它。

*pDMA3_CONFIG = WNR | WDSIZE_32 | DI_EN | FLOW_1 | DMA2D | DI_SEL;
// Start address of data buffer
*pDMA3_START_ADDR = iRxBuffer1;
// DMA loop count
*pDMA3_X_COUNT = 2*INPUT_SIZE;
// DMA loop address increment
*pDMA3_X_MODIFY = 4;
*pDMA3_Y_COUNT = TOTAL_FRAME;
*pDMA3_Y_MODIFY = 4;

我正在处理音频帧,将来可能需要使用两个以上的 channel ,因此我想了解 X_MODIFY 如何影响我的数据。

非常感谢!

最佳答案

X_MODIFY 寄存器在 page 293 上进行了解释。您引用的书:

The X_COUNT register specifies the number of transfers that are required, and
the X_MODIFY register specifies the number of byte increments after every data
transfer. Note that the data transfer can be 8, 16, or 32 bits. Therefore, X_COUNT
is related to the number of words, and the word can be 8, 16, or 32 bits. However,
X_MODIFY is always expressed in number of bytes. Blackfin processors allow
one-dimensional (1D) and two-dimentional (2D) DMA modes. When the DMAx_
CONFIG register shown in Figure 7.1 is set to operate in 1D mode, only the X_
COUNT and X_MODIFY registers need to be set up. Otherwise, when 2D mode
is set, Y_COUNT and Y_MODIFY registers must also be set up in addition to the
X_COUNT and X_MODIFY registers. The 2D DMA can be considered as a nested
loop, where X_COUNT and X_MODIFY specify the inner look and Y_COUNT
and Y_modify specify the outer loop. The 2D DMA is particularly useful in
implementing double buffers for block processing mode and in addressing 2D data
like images. We show more examples on how to set up 2D DMA in Hands-On
Experiments 7.4 and 7.5.

根据您提供的设置,DMA channel 3(串行端口 0 接收、SPORT 0 Rx)的每次传输将为 32 位,每次传输后(内部循环内)内存地址将增加 4 个字节( X_MODIFY)。它也会在每个内部循环之间增加 4 个字节 (Y_MODIFY)。

实际上,您提供的内容设置了几个循环,基本上如下所示:

//SETUP DMA
// Config is set to: Memory write | Transfer size = 32 bits | generate interrupt
// | autobuffer | 2D DMA mode
// | interrupt is on completion of each X_COUNT loop
DMA3_START_ADDR = iRxBuffer1;
DMA3_X_COUNT = 2*INPUT_SIZE;
DMA3_X_MODIFY = 4;
DMA3_Y_COUNT = TOTAL_FRAME;
DMA3_Y_MODIFY = 4;

//Begin DMA
while (DMA3_CONFIG & DMAEN) { //autobuffer mode
DMA3_CURR_ADDR = DMA3_START_ADDR;
for(DMA3_CURR_Y_COUNT = DMA3_Y_COUNT; DMA3_CURR_Y_COUNT > 0; DMA3_CURR_Y_COUNT-- ) {
for(DMA3_CURR_X_COUNT = DMA3_X_COUNT; DMA3_CURR_X_COUNT > 0; DMA3_CURR_X_COUNT--){
//Transfer data from serial port 0 to memory at location DMA3_CURR_ADDR.
// Note that here is actually the hardware waiting for an interrupt to be
// generated by the receive side of serial port 0 indicating that data is
// available. Once it is available, the data is DMA'ed into memory and
// the process continues.
if(DMA3_CURR_X_COUNT > 1) {
DMA3_CURR_ADDR += DMA3_X_MODIFY;
}
}
if(DMA3_CURR_Y_COUNT > 1) {
DMA3_CURR_ADDR += DMA3_Y_MODIFY;
//Generate interrupt
}
}
DMA3_CURR_ADDR += DMA3_X_MODIFY;
//Generate interrupt
}

就我个人而言,我发现以下引用资料比 Google 提供的您引用的书籍的部分版本有用得多(但是,我有硬件背景):

  1. ADSP-BF537 Blackfin Processor Hardware Reference 5-75 – 5-94
  2. ADSP-BF537 Data Sheet Rev. J

X_MODIFY 在 ADSP-BF537 Blackfin Processor Hardware Reference 的第 5-88 页上指定:

DMAx_X_MODIFY/MDMA_yy_X_MODIFY Registers

关于c - X_MODIFY在ADSP-BF537的DMA中起什么作用? (模拟设备),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28809906/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com