2016-01-15 06:25 AM
I need to read from a device with a variable length response, where the length of the following data is specified in the first byte received. I don't see a way to accomplish this using the HAL, as it appears you need to know the rx length at the time of the call. I think this is a fairly common scenario. Does anyone have any ideas how to work around this short of writing my own I2C implementation?
2016-04-26 07:51 AM
2016-04-29 09:47 AM
it could be that?
... HAL_I2C_Master_Receive_IT(&handle, addr, data, 1); ... void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c) { static uint8_t frame = 0; if (frame) { HAL_I2C_Master_Receive_IT(&handle, addr, data, 1); frame = 0; } else { HAL_I2C_Master_Receive_IT(&handle, addr, &data[1], *(hi2c->pBuffPtr)); // *(hi2c->pBuffPtr) -> data[0] frame = 1; // use the data } } not tested!2017-02-09 09:51 PM
Hi, I'm having the same issue. Has anyone had any success in doing this?
2017-06-10 05:06 PM