-
Notifications
You must be signed in to change notification settings - Fork 159
ch32v: Add I2C hal #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ch32v: Add I2C hal #743
Conversation
mattnite
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides weighing in, looks good to me, pull the trigger when you're ready.
Damn that multi-second delay when typing comments.
|
Let me fix this up. Don't merge yet please |
|
I bricked my board (doing something else). I have to wait for a new one to arrive to properly test everything |
9a987ca to
6374220
Compare
b3b7bd3 to
ed4bb8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Lint Results
Found 1 issue on changed lines in 1 file:
- port/wch/ch32v/src/hals/i2c.zig: 1 issue
|
|
||
| pub fn main() !void { | ||
| // Board brings up clocks and time | ||
| microzig.board.init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should call this automatically in microzig_main as we do for hal.init?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nordic examples also follow this pattern of calling it explicitly. Would you propose that we add a extra case with the order of app -> board -> hal?, or should hal and board both have a chance to get called.
We do board-specific here because some boards would have different clock config based on whether they have an external clock, but I think that at the moment all of the existing boards are simply configured to use the internal oscillator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app -> board -> hal
exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I can do that, but since it will affect other boards and I'd have to remove the explicit invocation in a bunch of examples I'll do it in another PR.
Updating with new lint results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Lint Results
Found 6 issues on changed lines in 2 files:
- port/wch/ch32v/src/hals/drivers.zig: 5 issues
- port/wch/ch32v/src/hals/i2c.zig: 1 issue
mattnite
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He's back!
A lot of this functionality was informed by https://github.com/robinjanssens/WCH-Toolchain