SLUAAX5 August 2024 BQ25750 , BQ40Z80 , MSPM0L1306
The code for the MCU to poll the gauge for ChargingVoltage() is shown below.
From TI’s SMBus Library, a predefined function is called to communicate with the gauge through SMBus. The target address is the device address, and the result of the request is stored in the voltage array. The same sequence is repeated for the ChargingCurrent() where the SMBus command is 0x14.
The code to translate ChargingCurrent () is such to be compatible with the charger.
From TI’s I2C Library, a predefined function is called to communicate with the charger through I2C. The endianness of the data must be considered during transmission. The I2C_TARGET_ADDRESS is the charger address shown below.
The code to translate ChargingVoltage() is such to be compatible with the charger.
Then, the same TI function shown in Figure 3-8 is called to communicate with the charger.