Commit Graph

4 Commits

Author SHA1 Message Date
Christian Mauderer
f7a204e3d7 bsp/atsam/i2c: Add error return and fix edge cases
The driver didn't return with an error on (for example) a NACK on the
bus. This adds the expected error return. Due to the new case that a
transfer can be interrupted on an error, there were some new edge cases.
This patch therefore also fixes these edge cases by removing the
transfer_state that more or less duplicated the interrupt states.

Fixes #4591
2022-02-10 09:03:19 +01:00
Christian Mauderer
f71c620f7e bsp/atsam/i2c: Simplify driver
Do some clean ups. Remove superfluous variables. Eliminate some overly
complex logic (information about transfer and remaining bytes has been
tracked redundantly in multiple variables).

This patch doesn't change the behavior of the driver.

Update #4591
2022-02-10 09:02:56 +01:00
Sebastian Huber
5cb23f4b88 bsp/atsam: Use binary semaphore for I2C
Remove superfluous sleep before each I2C transfer.  Reset I2C module
after transfer timeouts.

Update #3534.
2018-10-01 09:01:29 +02:00
Sebastian Huber
a2dad96ab7 bsps: Move I2C drivers to bsps
This patch is a part of the BSP source reorganization.

Update #3285.
2018-04-23 15:18:43 +02:00