-
Notifications
You must be signed in to change notification settings - Fork 358
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
I2C Overhaul, Dependency Removal, and Peripheral Manager Redux #625
I2C Overhaul, Dependency Removal, and Peripheral Manager Redux #625
Conversation
…till removes BitBangI2C dependencies in favor of PicoPeripherals. Again, there was much rejoicing.
Since I2C and SPI access are now encapsulated, it would also make sense to take this opportunity to allow proper peripheral sharing across cores. Adding a recursive lock and methods to allow exclusive access for multiple read/write transactions (e.g. |
@dogtopus I do agree, but the first iteration of this is to get the new structure in place, and make sure that it doesn't break things in the process. Optimizations will come in a later PR, as there's some work that I would like to do to the Display functionality to clean things up. Right now, I'm assessing options for that part, which could mean ditching the OneBitDisplay library entirely, but it's a bit too early for me to tell. Display is the culprit for a lot of our I2C collisions, and likely the reason why things do not play nice across cores. |
…-CE into 20231115-peripherals
… in constructor and expected config returned to USB Host Manager.
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.
Looks fantastic, thank you for all the hard work!
I2C Overhaul
This moves configuration of I2C controller blocks to a global scope, instead of a per-addon scope.
Dependency Removal
This also removes a dependency on the BitBangI2C library that existed in name only and wrapped pico-sdk functionality. It has been replaced with a library developed for the project called PicoPeripherals that will handle core peripheral functionality (initialization, reads, writes, etc.).
Peripheral Manager
To round out the changes to I2C, a Peripheral Manager has been introduced. This manager was written to leverage on-chip peripheral devices as needs arise. In addition to I2C, SPI has been added to this manager, but no functionality currently leverages it.