Skip to content

i2c: API should define fine-grained error responses #12277

@pabigot

Description

@pabigot

The I2C API defines only -EIO as a diagnostic response to a failure in transfers. This is too coarse. At a minimum failure to receive an acknowledgment should be distinguished from all other failures, as some devices use that to indicate that a triggered measurement is not yet complete (e.g. SHT21/Si7021 in no-hold mode). This error can be recovered by trying again later; other errors may be truly fatal.

Appropriate error codes for supported I2C failure types across supported boards should be identified based on existing practice outside Zephyr, and implemented in all drivers that are capable of detecting I2C NAK.

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresarea: I2C

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions