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.

[参考译文] AM263P4-Q1:AM263Px:如何在使用 EEPROM_Read () 和 EEPROM_WRITE () 时指定超时周期

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1626866/am263p4-q1-am263px-how-to-specify-a-timeout-period-when-using-eeprom_read-and-eeprom_write

器件型号: AM263P4-Q1

eeprom_read() 和 eeprom_write() 将返回错误、传递的参数无效、如果 I2C 总线忙或发生超时。当使用 eeprom_read() 和 eeprom_write() 时、如何指定超时期?
注意:我使用的是 AM263Px MCU+ SDK 09.02.00 和 AM263Px MCU+ SDK 11.00.00。

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

    Imaoka、

    eeprom_read() 和 eeprom_write() 函数没有超时参数。 在 I2C 驱动器级别控制超时。

    EEPROM 驱动程序在内部使用 I2C_Transaction、该 I2C 事务具有一个超时字段:

    typedef struct I2C_Transaction_s {
        // ... other fields ...
        uint32_t timeout; // <-- Timeout is here
        // ...
    } I2C_Transaction;

    但是、EEPROM 驱动程序调用 I2C_Transaction_init ()、它将超时设置为 SystemP_WAIT_FOREVER(无限期等待)、并且不会暴露覆盖它的方法。

    这里的选项是编写一个自定义 EEPROM 函数来绕过驱动程序,并直接使用 I2C_TRANSFER() 与自定义超时。

    此致、

    Brennan