主题中讨论的其他器件: BQ76952
你(们)好
我在 sluc583.zip 文件中找到了您的示例代码:bq769x0_I2C_SAMPLE_CODE_With CRC
我的问题是:为什么在计算 CRC 字节之前 I2C 从地址乘以2? 例如:
int I2CWriteRegisterByteWithCRC (unsigned char I2CSlaveAddress、unsigned char 寄存器、unsigned char 数据)
{
unsigned char DataBuffer[4];
unsigned int SentByte = 0;
DataBuffer[0]= I2CSlaveAddress << 1; ?????
DataBuffer[1]=寄存器;
DataBuffer[2]=数据;
DataBuffer[3]= CRC8 (DataBuffer、3、CRC_KEY);
return (I2CSendBytes (I2CSlaveAddress、DataBuffer + 1、3、SentByte));
}
I2CSendBytes 使用 I2CSlaveAddress、但计算得出的 CRC 字节不是使用该地址(0x08、但0x10)计算得出的、然后该命令应该被拒绝!
此致
Lars Jensen
LINAK A/S