This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28P650DK: EtherCAT 与F28 访问的问题

Part Number: TMS320F28P650DK

你好,请问CPU访问EtherCAT是按照字去访问嘛?为什么访问的时候offset要除以2呢?memcpy的时候除以了2不会减少实际传输的数据大小嘛?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void
ESC_writeBlockISR(ESCMEM_ADDR *pData, uint16_t address, uint16_t len)
{
uint16_t wordValue;
//
// Create pointer to ESC Address
//
void * escDest = (void *)(ESC_BASE + (uint32_t)(address / 2U));
//
// Determine if length (in bytes) is even or odd
//
if((len & 0x1U) == 0x1U)
{
//
// Odd Length
//
//
// Copy even bytes of buffer data to ESC memory.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX