forked from ZigEmbeddedGroup/microzig
-
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.
RP2040 I2C Refactor (ZigEmbeddedGroup#213)
* Various performance improvements to I2C reads/writes related to how/when polling occurs * Simplified API so that all reading/writing happens in 3 functions * Corrected tranlation of baud rate to register settings * Tweaked how I2C is "initalized" and "deinitialized" * Moved most of the error handling responsibility onto the caller of the I2C API, for example code no longer calls `panic()`, but rather bubbles up an error to the caller for them to make a decision on * Added "const correctness" to API * Added comments being explicit about what features of the hardware this API doesn't support * Removed const correctness stuff * Changed from_instance_number namespace * Changed translate_baudrate namespace + moved tests * Changed some terminology! * Updated some function names and reverted some design patterns after further discussion * Fixed example and changed how instances are accessed * Removed redundant calls to get_regs() --------- Co-authored-by: Hayden Riddiford <hayden@terrakaffe.com>
- Loading branch information
Showing
6 changed files
with
467 additions
and
273 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,5 @@ pub fn get_cpu_id() u32 { | |
test "hal tests" { | ||
_ = pio; | ||
_ = usb; | ||
_ = i2c; | ||
} |
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
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
Oops, something went wrong.