buff[1] = I2C_ReceiveData(SMBus_NAME); while (!I2C_CheckEvent(SMBus_NAME, I2C_EVENT_MASTER_BYTE_RECEIVED)); pec = I2C_ReceiveData(SMBus_NAME); expected_pec = SMBus_CRC8(((uint32_t)ReadAddr << 16) | ((uint32_t)buff[0] << 8) | buff[1]); ...