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-F280039C:f28003x_eqep.h 类型定义

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1128623/launchxl-f280039c-f28003x_eqep-h-types-definition

器件型号:LAUNCHXL-F280039C
主题中讨论的其他器件:C2000WARE

您好!

我想将数字电机控制库用作电机控制器的基础。 我正在使用"双轴伺服驱动器 FCL"中的一些代码。 在此项目中 、_motor_Vars_t_是包含许多算法变量的变量结构。 该结构的一个元素是:

    volatile struct EQEP_REGS *pQEPRegs;  // Aligned to lower 16-bits

eQEP_regs 在 f28003x_eQEP.h 中定义、我已将其包含在项目中。

此文件定义了前面提到的结构时会发生问题:

struct EQEP_REGS {
    Uint32                                   QPOSCNT;                      // Position Counter
    Uint32                                   QPOSINIT;                     // Position Counter Init
    Uint32                                   QPOSMAX;                      // Maximum Position Count
    Uint32                                   QPOSCMP;                      // Position Compare
    Uint32                                   QPOSILAT;                     // Index Position Latch
    Uint32                                   QPOSSLAT;                     // Strobe Position Latch
    Uint32                                   QPOSLAT;                      // Position Latch
    Uint32                                   QUTMR;                        // QEP Unit Timer
    Uint32                                   QUPRD;                        // QEP Unit Period
    Uint16                                   QWDTMR;                       // QEP Watchdog Timer
    Uint16                                   QWDPRD;                       // QEP Watchdog Period
    union   QDECCTL_REG                      QDECCTL;                      // Quadrature Decoder Control
    union   QEPCTL_REG                       QEPCTL;                       // QEP Control
    union   QCAPCTL_REG                      QCAPCTL;                      // Qaudrature Capture Control
    union   QPOSCTL_REG                      QPOSCTL;                      // Position Compare Control
    union   QEINT_REG                        QEINT;                        // QEP Interrupt Control
    union   QFLG_REG                         QFLG;                         // QEP Interrupt Flag
    union   QCLR_REG                         QCLR;                         // QEP Interrupt Clear
    union   QFRC_REG                         QFRC;                         // QEP Interrupt Force
    union   QEPSTS_REG                       QEPSTS;                       // QEP Status
    Uint16                                   QCTMR;                        // QEP Capture Timer
    Uint16                                   QCPRD;                        // QEP Capture Period
    Uint16                                   QCTMRLAT;                     // QEP Capture Latch
    Uint16                                   QCPRDLAT;                     // QEP Capture Period Latch
    Uint16                                   rsvd1[15];                    // Reserved
    union   REV_REG                          REV;                          // QEP Revision Number
    union   QEPSTROBESEL_REG                 QEPSTROBESEL;                 // QEP Strobe select register
    union   QMACTRL_REG                      QMACTRL;                      // QMA Control register
    union   QEPSRCSEL_REG                    QEPSRCSEL;                    // QEP Source Select Register
};

联合体主要是 UINT16、但我尚未定义 UINT16类型、是否缺少包含? 我已经尝试从 eQEP 上的 Resource Explorer 中获取示例、但这些示例不使用 f28003x_eqep.h、而是另一个文件。

在同一个库中、我还缺少 Int32的定义、哪个文件包含此类型定义?

谢谢、此致

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

    您好、Nicolas、

    尝试使用此头文件时是否遇到编译错误? 通常、这些整数类型将在 stdint.h 文件中定义

    此致、

    Peter

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

    尊敬的 Peter:

    是的、它会导致编译错误:  

    说明资源路径位置类型
    #20标识符"UINT16"未定义.ccsproject /MotorController 第104行、外部位置:C:\ti\c2000Ware_MotorControl_SDK_4_00_00_00\c2000ware\device_support\f28003x\headers\include\f28003x_eqep.h C/C++ problem

    我在 eQEP 之前明确包含了 stdint.h:

    #include "stdint.h"
    #include "f28003x_eqep.h"

    但编译错误仍然存在。

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

    Nicolas、

    让我邀请另 一位有关电机控制 SDK 的专家、看看他们是否知道可能缺少的任何文件兼容性。

    此致、

    Peter

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

    这些类型在 f28003x_device.h 中定义(与 f28003x_eQEP.h 位于同一文件夹中)、因此您可以为该文件添加#include。 我认为原始双轴示例#include 可能通过 f28x_project.h 文件提供、因此这也是一个选项(位于 device_support\f28003x\con\include 中)。

    如果仍然希望使用 stdint 类型、也可以将 Uint16替换为 uint16_t。

    惠特尼

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

    包含此标题即可解决此问题! 谢谢