-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
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.