LibreSolar / bms-firmware

Firmware for LibreSolar BMS boards based on bq769x0, bq769x2 or ISL94202
https://libre.solar/bms-firmware/
Apache License 2.0
146 stars 67 forks source link

drivers: bq769x2 interface: fix datamem and subcmd naming #46

Closed martinjaeger closed 7 months ago

martinjaeger commented 7 months ago

This is mainly a clean-up for the bq769x2 driver.

The chip differentiates between sub-commands and data memory, which are both used the same way and can both write or read data.

So far, the used function contained _subcmd_ in its name, which was confusing when used for the data memory. In addition to that some functions were implemented for subcommand data types that don't exist in the IC.

The unit tests partly used invalid register addresses 0x0, which was not detected because CONFIG_ASSERT was not enabled. This is now fixed as well.