初中生
最后登录1970-1-1
在线时间 小时
注册时间2019-4-13
|
最近在学习STM32的USB接口,看到文档中说USB接口对那段512字节的地址是16位访问,CPU是32位访问, 所以通过地址有个乘以2的关系,不理解为啥。
Due to the common APB bridge limitation on word addressability, all packet memory
locations are accessed by the APB using 32-bit aligned addresses, instead of the actual
memory location addresses utilized by the USB peripheral for the USB_BTABLE register
and buffer description table locations.
In the following pages two location addresses are reported: the one to be used by
application software while accessing the packet memory, and the local one relative to USB
Peripheral access. To obtain the correct STM32F10xxx memory address value to be used in
the application software while accessing the packet memory, the actual memory location
address must be multiplied by two.
在代码中看到如下的宏:
#define _pEPTxAddr(bEpNum) ((uint32_t *)((_GetBTABLE()+bEpNum*8 )*2 + PMAAddr))
这个是如何理解呢?
|
|