SLAAEB3A May 2023 – July 2024 MSPM0G3507 , MSPM0L1106 , MSPM0L1306
PRODUCTION DATA
Figure 3-5 lists the basic BQ769x2 register control functions based on the Inter-Integrated
Circuit (I2C) Driver Library (I2C_communication.h
) for M0.
These functions are used for MSPM0 to write and read the registers of the BQ device in byte. Referring to the BQ769x2 Technical Reference Manual and data sheet, direct commands, subcommands, and reads and writes to RAM registers can be realized on the register control functions. Figure 3-6 lists the prototype of functions.
Direct Commands, Command-Only Subcommands, and Subcommands with data are predefined functions available to simplify communication with the battery monitor.
The input parameters for the Direct Commands function are the command, the data, and the type. There are two types: read and write. The user can read data from the command address and store data in the Rx state of the global variable to be read for the read type. The user can write data to the command address for the write type.
For Command-Only Subcommands functions, the input parameter is the subcommand such as shut down and reset. This function formats the transfer array then writes the array to hex 3E, where the monitor then operates based on the command.
The Subcommands with data differs from the
command-only subcommands because there is data associated with each command, whether
functioning to read the data or write data. The input parameters are similar to the
BQ769x2 SetRegister
function, but the last input is typed
instead. This input can either be the defined macros R for read, W for write, or W2
for write two bytes.
The input parameters for the BQ769x2
SetRegister
function are the data memory register address, the
data memory intended to write, and the data length in bytes. First write hex 3E for
the initial write for subcommands in direct memory, and then write to register hex
60 for the checksum to enter the data transmitted was correct. Finally, there are
different cases for the three varying data lengths.
A complete list of commands is found in the BQ76952 Technical Reference Manual.