Skip to content

Refine I2C error outcomes - e.g. expose NACK separately somehow. #38506

@bscarlet

Description

@bscarlet

Some I2C devices communicate important state with I2C NACK - e.g. an EEPROM (such as the Microchip 24AA02E48) might report NACK while it's busy completing a write operation. The current Zephyr I2C API does not distinguish NACK from other non-success conditions, such as loss of arbitration - the different cases are all reported with a return code of -EIO. This makes writing a driver for such devices awkward, as to wait and retry when getting a NACK one apparently must react to more serious errors the same way.

I request that more fine-grained information about I2C errors be exposed somehow. For example, NACK in particular might be handled by returning a different return code - perhaps -EAGAIN. Alternately, the current API could be extended with a new function to return a more fine-grained I2C specific enum after an error occurs.

Metadata

Metadata

Assignees

Labels

Breaking API ChangeBreaking changes to stable, public APIsEnhancementChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsarea: I2C

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions