请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号: AM263P4-Q1
eeprom_read() 和 eeprom_write() 将返回错误、传递的参数无效、如果 I2C 总线忙或发生超时。当使用 eeprom_read() 和 eeprom_write() 时、如何指定超时期?
注意:我使用的是 AM263Px MCU+ SDK 09.02.00 和 AM263Px MCU+ SDK 11.00.00。
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
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