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.

[参考译文] CCS:TMS570LS0914:命令寄存器(IF1CMD 和 IF2CMD)被声明为 uint8

Guru**** 2539500 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/741712/ccs-tms570ls0914-command-registers-if1cmd-and-if2cmd-were-declared-as-uint8

工具/软件:Code Composer Studio

当我查看由 Hal 生成的代码时、我发现 IF1CMD 和 IF2CMD 被声明为 uint8。 我想问、如果将它们声明为 uint32、会发生什么情况、因为当我声明为 uint8时、也可以发送数据、但其中一部分没有数据传输。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Tsukiko、您好!

    CMD 字段为8位宽(23:16)、必须使用 uint8来声明此字段(uint if1cmd)。 如果 reg_can.h 中的 IF1CMD 被声明为 UINT32、则此 cmd 寄存器和以下寄存器(MASK、ARB、msgCtrl、DATA 等)的地址将会混乱。 在 CAN.c 中写入 IF1CMD 的值将被写入屏蔽寄存器。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    感谢您的慷慨帮助、祝您万圣节快乐!