-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
esp32: Add LDO driver for ESP32-P4 #18538
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
base: master
Are you sure you want to change the base?
Conversation
03d2896 to
be39634
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18538 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22300 22300
=======================================
Hits 21939 21939
Misses 361 361 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Code size report: |
projectgus
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.
Thanks for submitting this, @artemy! It looks very useful.
I have left a few pretty minor inline comments. Also, I noticed the commit of this PR is showing as authored by Damien - I think maybe you accidentally squashed your change into unrelated commit 78ff170. Should be easy enough to fix with git commit --amend --reset-author.
As noted in the linked issue there's another requirement on some boards that one or more LDO channels need to be enabled for some GPIOs to work at all. I think this can be done by specific board_init.c files calling the ESP-IDF LDO API directly though, so separate to this change.
This commit adds support for LDO driver for ESP32-P4 SOCs Signed-off-by: Artem Makarov <gh@artemy.nl>
be39634 to
ab0ed31
Compare
|
Thank you for your comments, @projectgus. I've modified my PR accordingly. |
Signed-off-by: Artem Makarov <gh@artemy.nl>
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 great, thanks again @artemy!
I flashed this to a DFRobot "Firebeetle 2 P4" board and by doing l = LDO(4, 3300, adjustable=True) I was able to access the SDCard slot and also set Pin 48 high (both powered from LDO 4 on this particular board).[*]
Could also use adjust_voltage() to drop the voltage on Pin 48. Nice!
[*] Long term it'd be good for both these particular things to work without extra Python code, but it was a quick way to try out the new driver.
Summary
ESP32P4 includes a 4-channel LDO controller that can be used to supply power to external hardware, e.g. screens.
Testing
I've tested this on an ESP32-P4 board that I own.