HAL_I2C_Mem_Read () library does not add the read bit when trying to read from a register.
Hi
I am using HAl_I2C_Mem_Read library to read data from a register. But the HAl-I2C_Mem_Read does not add the LSb bit for read bit. For example if the device adress is 0x6C, the 8th bit shout be 1 for reading but it is 0 and I get an Ack failer. Even if I do like 0x6C|0x01 to make the 8th bit 1 for reading it still is 0 and I get ACK failer.
Hope that anyone can help with this.
This is the code.
HAL_StatusTypeDef MAX30205_readTemp(uint8_t dev_address)
{
HAL_StatusTypeDef ret;
uint64_t tempData[2];
// read from the register sDeviceName
ret = HAL_I2C_Mem_Read(&hi2c1, dev_address, 0x121, 2, tempData, 2, HAL_MAX_DELAY);
if(ret != HAL_OK)
{
return ret;
}
return HAL_OK;
}
Here I call the function MAX30205_readTemp(uint8_t dev_address) and send the device address:

