OpenDevicePartnership / OpenDevicePartnership/embedded-services
HID-I2C: enable disjoint bus writes
@williampMSFT is already working on this.
Since Jul 29, 2026.
- Dominant language
- Rust
- Stars
- 23
- Forks
- 53
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 13
Description
See here for context. Basically, in the HID-I2C service, we want to not split our writes into multiple calls into the HAL, because that introduces multiple await points, which leads to clock stretching / hogging the bus. However, right now, the only way to instruct the I2C HAL trait to talk over the bus is to pass it a single slice, which means we'd need to memcpy the input report into a buffer that also contains its header. This is also not great for perf, so we're stuck between a rock and a hard place.
We think the solution is to extend the I2C HAL trait so have a respond_to_read variant that accepts a slice of slices rather than a single slice. This would let us pass disjoint memory to the HAL trait implementation, i.e. the header in one slice and the message in a second slice. This task tracks extending the HAL trait and leveraging the new method in the HID-I2C service.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.