zmk icon indicating copy to clipboard operation
zmk copied to clipboard

feat(sensors): Battery charging status detection

Open ReFil opened this issue 2 years ago • 2 comments

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

ReFil avatar Sep 04 '23 20:09 ReFil

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

ReFil avatar Dec 13 '23 10:12 ReFil

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

ReFil avatar Mar 21 '24 14:03 ReFil