Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/max17048/max17048.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ namespace esphome
static const char *const TAG = "max17048";

// Data sheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX17048-MAX17049.pdf
// NOTE: all registers must be accessed as 16-bit words (8-bit writes
// have no effect per the data sheet), so a word write through a
// misaligned address would span two registers.
constexpr uint16_t REG_VCELL = 0x02; // ADC measurement of VCELL. LSB: 78.125µV/cell
constexpr uint16_t REG_SOC = 0x04; // Battery state of charge. LSB: 1%/256
constexpr uint16_t REG_MODE = 0x06; // Operating mode
constexpr uint16_t REG_VERSION = 0x08; // Version number
constexpr uint16_t REG_HIBRT = 0x0B; // Hibernate threshold. Read/write. Default: 0x971C
constexpr uint16_t REG_CONFIG = 0x0C; // Configuration register. Read/write. Default: 0x00FF
constexpr uint16_t REG_HIBRT = 0x0A; // Hibernate thresholds. Read/write. Default: 0x8030
constexpr uint16_t REG_CONFIG = 0x0C; // Configuration register. Read/write. Default: 0x971C
constexpr uint16_t REG_VALRT = 0x14; // Voltage alert threshold. Read/write. Default: 0x00FF
constexpr uint16_t REG_CRATE = 0x16; // Current rate. LSB: 0.208%/hr
constexpr uint16_t REG_VRESET_ID = 0x18; // VCELL-reset-threshold and chip ID. Read/write. Default: 0x96??
Expand Down