Skip to content
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

Persistent (flash) setting and initialization for battery capacity #53

Open
poynting opened this issue Aug 22, 2024 · 0 comments
Open

Comments

@poynting
Copy link
Collaborator

With the battery monitor on K5EM hardware, it's necessary to tell the battery monitor what the capacity of the battery is. This is currently set in the max17260 driver when the config structure is passed to Max17620::default_setup

void Max17620::default_setup (max17620_setup_t * setup) {

If a user wants to use this hardware with a different battery size, it's advised to set the appropriate battery capacity. This came up as I'm preparing to send Brian a new hardware that I believe he's planning to use with a KBT 300mAh battery. For this combination to measure and support the smaller battery size, it will be necessary to let the max17260 know that the capacity is different so that it can properly build the model.

My suggestion would be to have this as a default setting for the 500mAh battery, but to let the user modify it in the settings page, possibly under an "advanced settings" section that's normally hidden. Note that when this is changed, it will be necessary to force a re-set of the battery monitor over I2C either by physically removing power, or by forcing a power on reset of the 17620 by setting POR to 1. The max17260 driver will need an added method to force this re-load, as the default init method will see that the battery monitor is already initialized and skip re-initializing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant