conn: Support common or canonical errors on buses
conn.i2c should have an i2c.NoAckError defined such that an app can tell whether an error indicates that the device did not ack a transfer. An example for this is polling an eeprom until it's ready (done with the previous write). conn.onewire has onewire.BusError to indicate that there was a problem on the 1-wire bus, which frequently happens with long buses that have poor electrical control (e.g. to high a slew rate). Maybe it would be worth to have a conn.NoResponseError that is generic across buses. (All these errors should follow the "interface" pattern in order to decouple types, i.e., the app tests whether an error implements an interface as opposed to testing the error's concrete type.)
Maybe it would be worth to have a conn.NoResponseError that is generic across buses.
yes, anything common should be in package conn.
Ported to https://github.com/periph/conn/issues/35.