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.

[参考译文] TDA4VH-Q1:使用 I2C 驱动器将测试代码发送到就绪 EEPROM

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1432054/tda4vh-q1-test-code-to-ready-eeprom-using-i2c-driver

器件型号:TDA4VH-Q1

工具与软件:

大家好、我正在尝试从 EEPROM 器件 AT24CM01读取一个字节的数据。

关于写入与读取时应使用的器件地址、我只有一个问题。

例如

我使用下面的虚拟代码来写入一个字节:

#define  I2cChannel_EEPROM_WR_ADDR  (0U)

#define I2cChannel_EEPROM_WR_DATA  (1U)

#define I2cChannel_EEPROM_RD_ADDR  (2U)

#define I2cChannel_EEPROM_RD_DATA   (3U)

#define I2cSequence_EEPROM_Write_MCU_I2C0  (0U)

#define I2cSequence_EEPROM_READ_MCU_I2C0  (1U)

UINT8 EEPROM_Addr[2]=0x00、0x00};
uint8 Tx_Buffer_ 4524CM01[1]=0x22};
uint8 Rx_Buffer_ 4524CM01[1]=0};
void 函数()
 I2C_SetupEBDynamic (I2cChannel_EEPROM_WR_ADDR、0x50、&EEPROM_Addr[0]、NULL_ptr、2U);
 I2C_SetupEBDynamic (I2cChannel_EEPROM_WR_DATA、0x50、Tx_Buffer_ 24307CM01[0]、NULL_PTR、1U);
 I2C_AsyncTransmit (I2cSequence_EEPROM_Write_MCU_I2C0);
}

我使用下面的虚拟代码从同一地址读取一个字节

void 函数()

   I2C_SetupEBDynamic (I2cChannel_EEPROM_RD_ADDR、0x50、&EEPROM_Addr[0]、NULL_ptr、2U);
   I2C_SetupEBDynamic (I2cChannel_EEPROM_RD DATA、0x51u、NULL_PTR、Rx_Buffer_ 24CM01[0]1U);
   I2C_AsyncTransmit (I2cSequence_EEPROM_READ_MCU_I2C0);

}

因此、由于设备地址的最后一位写入时应为0、读取时应为1、我的问题是:在调用 I2C_SetupEBDynamic 时、我是否应该使用地址0x51而不是0x50来指示读取操作?

或者、当检测到读操作时、是否在将地址写入总线之前在内部激活该位?