forked from freebsd/freebsd-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- bulk of twsi_transfer and twsi_intr are protected with the mutex to ensure a consistent view of the state; - use msleep_sbt instead of pause_sbt, so that wakeup has any effect; - call wakeup in a single place; - remove most of redundant writes of the control register; the hardware executes a next stage of I2C protocol when the interrupt flag is cleared, so it should be easier to reason about the hardware state and behavior when the flag is cleared in a single place; - detect more unexpected conditions; - support more message combinations including: - transfers with no data bytes (S + addr + P) - read message with NO_STOP flag; - better structure the code to handle protocol transitions; - improve diagnostic messages and code formatting. Tested with: icee, ds1307, htu21, pcf8591, max44009
- Loading branch information
Showing
1 changed file
with
131 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters