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.

[参考译文] TM4C123GE6PZ:tSensorCallback 自定义类型的定义

Guru**** 2486815 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/734757/tm4c123ge6pz-definition-of-the-tsensorcallback-custom-type

器件型号:TM4C123GE6PZ

您好!

在查找 "ISL29023Init" init 函数的 tSensorCallback 的 typedef 时遇到问题。

是否可以将我指向包含它的头文件?

ISL29023Init (tISL29023 *psInst、tI2CMInstance *psI2CInst、

      uint_fast8_t ui8I2CAddr、 tSensorCallback  * pfnCallback、

      void *pvCallbackData)

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

    typedef void (tSensorCallback)(void * pvData、uint_fast8_t ui8Status);
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    上面这行所做的是定义一个被称为"tsensorCallback"的函数类型。
    这样、随后的写入操作将:

    tSensorCallback x;
    等效于写入:
    void x (void *pvData,uint_fast8_t ui8Status);

    我是否正确理解了这一点?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!
    您的理解是正确的。