LIS2DE12 I2C write timeout
My application is very low power, and I need to save power wherever possible.
To this end, I do the following:
LIS2DE12_WriteReg(LIS2DE12_MEMS_I2C_ADDRESS, 0x20, 0x08);Which basically puts the accelerometer in power down mode. The LIS2DE12_WriteReg basically uses HAL_I2C_Mem_Write.
I seem to constantly get a HAL_TIMEOUT returned whenever I try to put the accelerometer in power down mode. I even set the timeout to a high value, and its still the same problem.
Inside LIS2DE12_WriteReg , this is what happens:
HAL_StatusTypeDef i2c_write_status;
i2c_write_status = HAL_I2C_Mem_Write(&hi2c1, deviceAddress, WriteAddr, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&Data, 1, 10000);
DEBUG_LOG_ACC("I2C Bus Status(A): %d", HAL_I2C_GetError(&hi2c1));
DEBUG_LOG_ACC("I2C Write Status(A): %d", i2c_write_status);i2c_write status always returns HAL_TIMEOUT.
Thanks for your time.
Tim
