SLVAE86B september   2019  – august 2023 BQ75614-Q1 , BQ79612-Q1 , BQ79614-Q1 , BQ79616 , BQ79616-Q1 , BQ79631-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Command Frames
    1. 1.1 Structure
      1. 1.1.1 Initialization Byte
      2. 1.1.2 Device ID Address
      3. 1.1.3 Register Address
      4. 1.1.4 Data
      5. 1.1.5 CRC
    2. 1.2 Command Frame Template Tables
    3. 1.3 ReadReg and WriteReg Functions
      1. 1.3.1 ReadReg
      2. 1.3.2 WriteReg
      3. 1.3.3 Packet Types Available in Sample Code
  5. Quick Start Guide
  6. Wake Sequence
  7. Auto-Addressing
    1. 4.1 Steps
    2. 4.2 Example Commands for ThreeDevices
  8. Read Cell Voltages
    1. 5.1 Steps
    2. 5.2 Example Commands for ThreeDevices
    3. 5.3 Convert to Voltages
  9. Cell Balancing
    1. 6.1 Steps
    2. 6.2 Example Commands
  10. OVUV
    1. 7.1 Steps
  11. OTUT
    1. 8.1 Steps
  12. Reverse Addressing
    1. 9.1 Steps
    2. 9.2 Example Commands for ThreeDevices
  13. 10Revision History

ReadReg

The basic structure for the ReadReg function is as follows:

#_of_Read_Bytes = ReadReg(Device_Address, Register_Address, Incoming_Data_Byte_Array, #_Data_Bytes, ms_Before_Time_Out, Packet_Type)

Device_Address, #_Data_Bytes, and ms_Before_Time_Out are integers while Incoming_Data_Byte_Array and Register_Address are hex values with the prefix "0x". Device_Address is ignored for broadcast/stack reads.

For example:

nRead = ReadReg(nDev_ID, 0x0306, bFrame, 12, 0, FRMWRT_SGL_R);

This line reads 12 bytes of data from register 0x0306 of the device nDev_ID and stores it in a local byte array (on the microcontroller) called bFrame. The packet type is a single device read.