SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP517Regs.hpp
Go to the documentation of this file.
1
31#pragma once
32#include <stdint.h>
33
45
47 struct bmu {
48 static constexpr uint8_t STATUS0 = 0x00;
49 static constexpr uint8_t STATUS1 = 0x01;
50 static constexpr uint8_t DATA_BUFFER0 = 0x04;
51 static constexpr uint8_t BC_DETECT = 0x05;
52 static constexpr uint8_t FAULT0 = 0x06;
53 static constexpr uint8_t FAULT1 = 0x08;
54 static constexpr uint8_t MODULE_EN0 = 0x0B;
55 static constexpr uint8_t DATA_BUFFER1 = 0x0C;
56 static constexpr uint8_t DATA_BUFFER2 = 0x0D;
57 };
58
60 struct ctrl {
61 static constexpr uint8_t COMMON_CFG = 0x10;
62 static constexpr uint8_t GPIO_CFG = 0x11;
63 static constexpr uint8_t BATFET_CTRL = 0x12;
64 static constexpr uint8_t RBFET_CTRL = 0x13;
65 static constexpr uint8_t DIE_TEMP_CFG = 0x14;
66 static constexpr uint8_t MIN_SYS_VOLTAGE = 0x15;
67 static constexpr uint8_t INPUT_VOLT_LIMIT = 0x16;
68 static constexpr uint8_t INPUT_CURR_LIMIT = 0x17;
69 static constexpr uint8_t RESET_CFG = 0x18;
70 static constexpr uint8_t MODULE_EN1 = 0x19;
71 static constexpr uint8_t WATCHDOG_CTRL = 0x1A;
72 static constexpr uint8_t LOW_BAT_WARN = 0x1B;
73 static constexpr uint8_t PWRON_CFG = 0x1C;
74 static constexpr uint8_t VBUS_OV_CHG_PWRON = 0x1D;
75 static constexpr uint8_t BOOST_CFG = 0x1E;
76 static constexpr uint8_t MPPT_CFG = 0x22;
77 };
78
80 struct bc12 {
81 static constexpr uint8_t CTRL0 = 0x28;
82 static constexpr uint8_t CTRL1 = 0x29;
83 static constexpr uint8_t CTRL2 = 0x2A;
84 static constexpr uint8_t CTRL3 = 0x2B;
85 };
86
88 struct led {
89 static constexpr uint8_t CHGLED_CFG = 0x30;
90 static constexpr uint8_t BREATH_CL = 0x32;
91 static constexpr uint8_t BREATH_CH = 0x33;
92 static constexpr uint8_t BREATH_CSR = 0x34;
93 static constexpr uint8_t BREATH_NS = 0x36;
94 static constexpr uint8_t BREATH_NMIN = 0x37;
95 static constexpr uint8_t BREATH_M = 0x38;
96 };
97
99 struct irq {
100 static constexpr uint8_t ENABLE0 = 0x40;
101 static constexpr uint8_t ENABLE1 = 0x41;
102 static constexpr uint8_t ENABLE2 = 0x42;
103 static constexpr uint8_t ENABLE3 = 0x43;
104 static constexpr uint8_t STATUS0 = 0x48;
105 static constexpr uint8_t STATUS1 = 0x49;
106 static constexpr uint8_t STATUS2 = 0x4A;
107 static constexpr uint8_t STATUS3 = 0x4B;
108 };
109
111 struct ts {
112 static constexpr uint8_t PIN_CFG = 0x50;
113 static constexpr uint8_t HYSL2H = 0x52;
114 static constexpr uint8_t HYSH2L = 0x53;
115 static constexpr uint8_t DATA_CFG0 = 0x5C;
116 static constexpr uint8_t DATA_CFG1 = 0x5D;
117 static constexpr uint8_t SOURCE_SEL = 0x82;
118 };
119
121 struct jeita {
122 static constexpr uint8_t VLTF_CHG = 0x54;
123 static constexpr uint8_t VHTF_CHG = 0x55;
124 static constexpr uint8_t VLTF_WORK = 0x56;
125 static constexpr uint8_t VHTF_WORK = 0x57;
126 static constexpr uint8_t STD_ENABLE = 0x58;
127 static constexpr uint8_t STD_SETTING0 = 0x59;
128 static constexpr uint8_t STD_SETTING1 = 0x5A;
129 static constexpr uint8_t STD_SETTING2 = 0x5B;
130 };
131
133 struct chg {
134 static constexpr uint8_t IPRECHG_ITRICHG = 0x61;
135 static constexpr uint8_t ICC_SETTING = 0x62;
136 static constexpr uint8_t ITERM_CTRL = 0x63;
137 static constexpr uint8_t CV_CHG_VOLTAGE = 0x64;
138 static constexpr uint8_t THERMAL_REG_THRESH = 0x65;
139 static constexpr uint8_t CHG_TIMER_CFG = 0x67;
140 static constexpr uint8_t BAT_DETECT_CTRL = 0x68;
141 };
142
144 struct gauge {
145 static constexpr uint8_t BAT_PARAM = 0x70;
146 static constexpr uint8_t FUEL_GAUGE_CTRL = 0x71;
147 static constexpr uint8_t BAT_TEMP = 0x72;
148 static constexpr uint8_t BAT_SOH = 0x73;
149 static constexpr uint8_t BAT_PERCENT = 0x74;
150 };
151
153 struct adc {
154 static constexpr uint8_t ENABLE = 0x90;
155 static constexpr uint8_t BAT_VOLT_H = 0x91;
156 static constexpr uint8_t BAT_VOLT_L = 0x92;
157 static constexpr uint8_t BAT_CURR_H = 0x93;
158 static constexpr uint8_t BAT_CURR_L = 0x94;
159 static constexpr uint8_t TS_VOLT_H = 0x95;
160 static constexpr uint8_t TS_VOLT_L = 0x96;
161 static constexpr uint8_t VBUS_CURR_H = 0x97;
162 static constexpr uint8_t VBUS_CURR_L = 0x98;
163 static constexpr uint8_t VBUS_VOLT_H = 0x99;
164 static constexpr uint8_t VBUS_VOLT_L = 0x9A;
165 static constexpr uint8_t DATA_SEL = 0x9B;
166 static constexpr uint8_t DATA_H = 0x9C;
167 static constexpr uint8_t DATA_L = 0x9D;
168 };
169
171 struct factory {
172 static constexpr float FACTORY_TS = 0.5f;
173 static constexpr float FACTORY_DIE_TEMPERATURE = 0.2f;
174 static constexpr float FACTORY_VBUS_VOLTAGE = 2.0f;
175 static constexpr float FACTORY_VBAT_VOLTAGE = 1.0f;
176 static constexpr float FACTORY_CHARGE_CURRENT = 0.25f;
177 static constexpr float FACTORY_DISCHARGE_CURRENT = 0.25f;
178 static constexpr float FACTORY_VBUS_CURRENT = 1.0f;
179 static constexpr float FACTORY_VSYS_VOLTAGE = 1.0f;
180 static constexpr float FACTORY_BAT_CURRENT = 0.25f;
181 };
182
183};
ADC channel control and measurement result registers.
static constexpr uint8_t BAT_VOLT_H
BAT voltage ADC high.
static constexpr uint8_t ENABLE
ADC channel enable control.
static constexpr uint8_t VBUS_CURR_H
VBUS current ADC high.
static constexpr uint8_t BAT_CURR_H
BAT current ADC high.
static constexpr uint8_t DATA_H
ADC data high.
static constexpr uint8_t VBUS_CURR_L
VBUS current ADC low.
static constexpr uint8_t BAT_CURR_L
BAT current ADC low.
static constexpr uint8_t VBUS_VOLT_H
VBUS voltage ADC high.
static constexpr uint8_t VBUS_VOLT_L
VBUS voltage ADC low.
static constexpr uint8_t TS_VOLT_L
TS voltage ADC low.
static constexpr uint8_t BAT_VOLT_L
BAT voltage ADC low.
static constexpr uint8_t DATA_SEL
ADC data select.
static constexpr uint8_t DATA_L
ADC data low.
static constexpr uint8_t TS_VOLT_H
TS voltage ADC high.
BC1.2 charger-detection registers.
static constexpr uint8_t CTRL2
BC1.2 control2.
static constexpr uint8_t CTRL3
BC1.2 control3.
static constexpr uint8_t CTRL0
BC1.2 control0.
static constexpr uint8_t CTRL1
BC1.2 control1.
BMU status, data buffer, fault, and module-enable registers.
static constexpr uint8_t FAULT1
BMU fault1.
static constexpr uint8_t FAULT0
BMU fault0.
static constexpr uint8_t MODULE_EN0
Module enable control0.
static constexpr uint8_t STATUS1
BMU status1.
static constexpr uint8_t BC_DETECT
BC_detect (status/result)
static constexpr uint8_t DATA_BUFFER0
Data Buffer0.
static constexpr uint8_t DATA_BUFFER1
Data Buffer1.
static constexpr uint8_t DATA_BUFFER2
Data Buffer2.
static constexpr uint8_t STATUS0
BMU status0.
Battery charger parameter registers.
static constexpr uint8_t ICC_SETTING
ICC setting.
static constexpr uint8_t BAT_DETECT_CTRL
Battery detection control.
static constexpr uint8_t IPRECHG_ITRICHG
Iprechg/Itrichg setting.
static constexpr uint8_t ITERM_CTRL
Iterm setting and control.
static constexpr uint8_t CHG_TIMER_CFG
Charger timer configure.
static constexpr uint8_t CV_CHG_VOLTAGE
CV charger voltage setting.
static constexpr uint8_t THERMAL_REG_THRESH
Thermal regulation threshold setting.
Common control and power-path configuration registers.
static constexpr uint8_t RBFET_CTRL
RBFET control.
static constexpr uint8_t INPUT_VOLT_LIMIT
Input voltage limit control.
static constexpr uint8_t WATCHDOG_CTRL
Watchdog control.
static constexpr uint8_t LOW_BAT_WARN
Low Battery warning threshold setting.
static constexpr uint8_t MIN_SYS_VOLTAGE
Minimum system voltage control.
static constexpr uint8_t COMMON_CFG
Common configure.
static constexpr uint8_t INPUT_CURR_LIMIT
Input current limit control.
static constexpr uint8_t MODULE_EN1
Module enable control1.
static constexpr uint8_t DIE_TEMP_CFG
Die temperature configure.
static constexpr uint8_t BOOST_CFG
Boost configure.
static constexpr uint8_t PWRON_CFG
PWRON configure.
static constexpr uint8_t VBUS_OV_CHG_PWRON
VBUS_OV/CHG_PWRON configure.
static constexpr uint8_t RESET_CFG
Reset configure.
static constexpr uint8_t BATFET_CTRL
BATFET control.
static constexpr uint8_t MPPT_CFG
MPPT configure.
static constexpr uint8_t GPIO_CFG
GPIO configure.
Factory conversion scales for raw ADC measurements.
static constexpr float FACTORY_CHARGE_CURRENT
16-Bit(including sign bit)
static constexpr float FACTORY_BAT_CURRENT
16-Bit(including sign bit)
static constexpr float FACTORY_DIE_TEMPERATURE
14-Bit(including sign bit)
static constexpr float FACTORY_VBUS_CURRENT
14-Bit(including sign bit)
static constexpr float FACTORY_VBAT_VOLTAGE
14-Bit(including sign bit)
static constexpr float FACTORY_VSYS_VOLTAGE
14-Bit(including sign bit)
static constexpr float FACTORY_VBUS_VOLTAGE
14-Bit(including sign bit)
static constexpr float FACTORY_TS
14-Bit(including sign bit)
static constexpr float FACTORY_DISCHARGE_CURRENT
16-Bit(including sign bit)
Basic battery gauge status registers.
static constexpr uint8_t FUEL_GAUGE_CTRL
Fuel gauge control.
static constexpr uint8_t BAT_SOH
Battery SOH (RO)
static constexpr uint8_t BAT_PERCENT
Battery percentage (RO)
static constexpr uint8_t BAT_PARAM
Battery parameter.
static constexpr uint8_t BAT_TEMP
Battery temperature (RO)
PMIC interrupt enable and status registers.
static constexpr uint8_t ENABLE2
IRQ Enable 2.
static constexpr uint8_t ENABLE0
IRQ Enable 0.
static constexpr uint8_t ENABLE1
IRQ Enable 1.
static constexpr uint8_t ENABLE3
IRQ Enable 3.
static constexpr uint8_t STATUS2
IRQ Status 2.
static constexpr uint8_t STATUS3
IRQ Status 3.
static constexpr uint8_t STATUS1
IRQ Status 1.
static constexpr uint8_t STATUS0
IRQ Status 0.
JEITA temperature-threshold and standard charge-profile registers.
static constexpr uint8_t STD_SETTING0
JEITA standard setting 0.
static constexpr uint8_t STD_SETTING2
JEITA standard setting 2.
static constexpr uint8_t VLTF_WORK
VLTF_WORK setting.
static constexpr uint8_t STD_SETTING1
JEITA standard setting 1.
static constexpr uint8_t VHTF_WORK
VHTF_WORK setting.
static constexpr uint8_t VHTF_CHG
VHTF_CHG setting.
static constexpr uint8_t VLTF_CHG
VLTF_CHG setting.
static constexpr uint8_t STD_ENABLE
JEITA standard Enable control.
Charge LED and breathing LED control registers.
static constexpr uint8_t BREATH_CL
Breath LED control0 (CL)
static constexpr uint8_t BREATH_CH
Breath LED control1 (CH)
static constexpr uint8_t BREATH_NMIN
Breath LED control4 (NMIN)
static constexpr uint8_t BREATH_NS
Breath LED control3 (NS)
static constexpr uint8_t CHGLED_CFG
CHGLED configure.
static constexpr uint8_t BREATH_CSR
Breath LED control2 (CSR)
static constexpr uint8_t BREATH_M
Breath LED control5 (M)
TS pin and temperature-sense registers.
static constexpr uint8_t HYSL2H
TS_HYSL2H setting.
static constexpr uint8_t HYSH2L
TS_HYSH2L setting.
static constexpr uint8_t SOURCE_SEL
TS source select.
static constexpr uint8_t DATA_CFG1
TS data configure 1.
static constexpr uint8_t DATA_CFG0
TS data configure 0.
static constexpr uint8_t PIN_CFG
TS pin configure.
AXP517 PMIC registers (non-TCPC).