-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(sensors): Battery charging status detection #1923
base: main
Are you sure you want to change the base?
Conversation
I've added the same detection functionality to the VDDH sense driver. I haven't tested it with vddh yet as i haven't got a suitable test setup yet, but i will be designing a board to do it soon |
feat(battery): Initial battery charging state setection
I've just given this a major refactor to use interrupts to detect the charging state so it's not polled on the timer, confirmed working on VDDH and BVD, tested with a custom display widget on a board using a BQ24075 and VDDH and BVD and TP4054 on a different board, also added the charging state to the battery state changed event as well. Slightly reworked the documentation too with these changes in mind |
|
||
:::note Charging indication | ||
|
||
The battery charging status is not consumed by any built-in indicators currently and it cannot be conveyed to the host over BLE. |
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.
I wonder if this is a bit confusing, because the widgets still show a charging indicator tied to the USB status, right?
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.
I considered converting all the display widgets in this pr but that's already been done in #2153 and i didn't want to document a feature that didn't exist yet or hijack someone else's PR. If #2153 gets merged first I'll rebase this with that in mind, if this gets merged first the other PR can document it
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.
Makes sense, let's see how it goes.
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.
yea i think whichever one gets merged first, the other one will just rebase on top
Adds the ability to detect if the battery is charging if the charger is connected to a GPIO on the microcontroller
Can tie into #1456 for an all encompassing battery state underglow effect.
the chg-gpios parameter is entirely optional so shouldn't break existing boards/configs and hasn't so far in my testing