SparkFun Thing Plus Charging Status in code

Picked up a SparkFun Thing Plus and looking at the MAX17048 example sketches, I can see a lot of data I can extract but am seemingly unable to find a simple “Is the unit currently charging” variable. I know that the board lights up yellow when it is charging, but I cannot find it in code as I’d like to put out on the OLED if the unit is currently charging or not similar to a cell phone where you have the icon of the lightning bolt when the device is plugged in so that the end user knows it is correctly plugged in and currently charging. The board itself will not be visible only the OLED screen.
Thanks in advance for letting me know what I’ve overlooked here.

ADDITION: I downloaded the example code on your site to use with the OLED done by Ho Yun “Bobby” Chan on Feb 10, 2023 and I’m seeing for some reason an alert status of “VBAT: Low” even when the battery is fully charged. Example below… not sure what could cause this and haven’t found any reference beyond battery low so any info on this could also help thanks!

14:53:46.927 → Combined MAX17043 Example & Qwiic OLED Example
14:53:46.927 → Voltage: 4.22 V
14:53:46.927 → Percentage: 105.25 %
14:53:46.927 → Alert: 1
14:53:46.927 →
14:53:47.113 → Voltage: 4.22 V
14:53:47.113 → Percentage: 105.09 %
14:53:47.113 → Alert: 1

Which “SparkFun Thing Plus” do you have, there’s at least a dozen different ones?

I didn’t realize there were so many with the exact same name. I just hit the page of the unit I purchased and this is th extended info.

SparkFun Thing Plus - ESP32-C6 DEV-22924

I ran the device with a few QWIIC boards including oled with a 1100mah lion battery and it lasted over 21 hours with battery from “105%” down to zero and died about 15 mins after hitting zero.

The icon showing battery strength however went from 3/3 down to 2/3 and stayed at 2/3 bars until it died.

Looking at the schematic, there’s a LED that shows if the battery is charging but the status pin on the battery charger IC the LED is connected too isn’t connected to anything else on the board to indicate status to the ESP32. That means there’s no way for the ESP to know for sure the battery is currently charging. You could monitor the battery fuel gauge over time and indicate a charging state when you see battery capacity increasing but there will be some lag and you might get some false data depending on what the board might be doing at a given time.

You’d need to modify the board to do this, but you could jumper a wire from the yellow “charging” LED over to a free I/O pin on the ESP32 and monitor that pin in code. That would give real time indication on charging status. The LED is connected to the STAT pin on the charger and it looks like that pin goes low whenever the charging IC is currently charging the battery.
image

That was a thought I had as well in case there was no code way inherent… thanks for the reply!