Probe for different Controller Types
g_BatteryCtrlAddr: 0x00 - 0xFF
This routine probes the type of battery controller. This is done by checking
dedicated I2C-bus addresses on the SMBus. The following addresses and their
corresponding controller type are supported:
- 0x0A in case of Atmel, and
- 0x16 for the TI bq40z50.
Abstract SBS_Commands for different Manufacturer Registers
SBS_DesignCapacity, //!< 0x18 Word: in [mAh / 10mWh]
SBS_DesignVoltage, //!< 0x19 Word: in [mV]
SBS_SpecificationInfo, //!< 0x1A Word: Version and Revision
SBS_ManufactureDate, //!< 0x1B Word: [Year-1980:7|Month:4|Day:5]
Expansion of item data
This routine returns a formatted data string of the specified item data.
It uses BatteryRegReadWord() and BatteryRegReadBlock() to read the data
directly from the battery controller.
case FRMT_MILLIAMP: // Current in [±mA], +:charging, -:discharging
sprintf (strBuf, "%5dmA", (int16_t)data);
break;
https://github.com/peterloes/HRD/blob/master/Software/drivers/Display.c
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.