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.

LAUNCHXL-F280025C: 關於CAN bus receive data的DLC

Part Number: LAUNCHXL-F280025C

我參考範例”can_ex5_simple_receive”, 

裡面說到: Message Data Length: "Don't care" for a Receive mailbox,

但我需要知道receive data的DLC, 請問要如何得到?

  • 您好,我已向资深工程师寻求帮助。有了结果我会第一时间回复。

  • 以下函数可用于使用 IFx 寄存器读取 DLC 字段:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //*****************************************************************************
    //
    // CAN_readMessageWithDLC
    //
    //*****************************************************************************
    bool CAN_readMessageWithDLC(uint32_t base,
    uint32_t objID,
    uint16_t *msgData,
    uint16_t *msgLen)
    {
    bool status;
    //
    // Check the pointers.
    //
    ASSERT(msgLen != 0U);
    //
    //Read the message first this fills the IF2 registers
    //with received message for that mailbox
    //
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX