背景:以前都是玩ARM的,各家给的底层支持库都很完备。最近接触MPC5643L,power架构的,加之芯片很多都是汽车级的需求设计的,与工控常用的ARM芯片差异还是不小。加之freescale相应的示例太少,所有底层的操作都得直接取操作寄存器,全是硬编码,也没有宏定义,个人感觉不太好上手,心塞呀。
问题:eDMA模块关于TCD寄存器中smod字段,起什么作用该怎么理解?
以下是手册中过于smod的描述,看了好几遍,还是无法理解,求大侠们帮忙,感激不尽~
Name: smod[0:4]
Description: Source address modulo
Value:
0 Source address modulo feature is disabled.
non-0 The value defines a specific address bit which is selected to be either the value after saddr + soff calculation is performed or the original register value. This feature provides the ability to easily implement a circular data queue. For data queues requiring power-of-2 “size” bytes, the queue should be based at a 0-modulo-size address and the smod field set to the appropriate value to freeze the upper address bits. The bit select is defined as ((1 << smod[4:0]) - 1) where a resulting 1 in a bit location selects the next state address for the corresponding address bit location and a 0 selects the original register value for the corresponding address bit location. For this application, the soff is typically set to the transfer size to implement post-increment addressing with the smod function constraining the addresses to a 0-modulo-size range.
|