summaryrefslogtreecommitdiffstats
path: root/firmware/export/axp192-defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/axp192-defs.h')
-rw-r--r--firmware/export/axp192-defs.h308
1 files changed, 0 insertions, 308 deletions
diff --git a/firmware/export/axp192-defs.h b/firmware/export/axp192-defs.h
deleted file mode 100644
index 13b465351b..0000000000
--- a/firmware/export/axp192-defs.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/* Internal header for axp192 driver - not for general inclusion */
-
-#ifndef DEFREG
-# define DEFREG(...)
-#endif
-#ifndef DEFFLD
-# define DEFFLD(...)
-#endif
-
-#define DEFBIT(regname, fldname, bitpos, ...) \
- DEFFLD(regname, fldname, bitpos, bitpos, __VA_ARGS__)
-
-DEFREG(PWRSTS, 0x00)
-DEFREG(CHGSTS, 0x01)
-DEFREG(CHIPID, 0x03)
-DEFREG(VBUSSTS, 0x04)
-DEFREG(DATA0, 0x06)
-DEFREG(DATA1, 0x07)
-DEFREG(DATA2, 0x08)
-DEFREG(DATA3, 0x09)
-DEFREG(DATA4, 0x0a)
-DEFREG(DATA5, 0x0b)
-DEFREG(PWRCTL1, 0x10)
-DEFREG(PWRCTL2, 0x12)
-DEFREG(DCDC2VOLT, 0x23)
-DEFREG(DCDC2RAMP, 0x25)
-DEFREG(DCDC1VOLT, 0x26)
-DEFREG(DCDC3VOLT, 0x27)
-DEFREG(LDO2LDO3VOLT, 0x28)
-DEFREG(VBUSIPSOUT, 0x30)
-DEFREG(VOFF, 0x31)
-DEFREG(PWROFF, 0x32)
-DEFREG(CHGCTL1, 0x33)
-DEFREG(CHGCTL2, 0x34)
-DEFREG(BKPCHGCTL, 0x35)
-DEFREG(PEKPARAM, 0x36)
-DEFREG(DCDCFREQ, 0x37)
-DEFREG(VLTFCHG, 0x38)
-DEFREG(VHTFCHG, 0x39)
-DEFREG(APSLOW1, 0x3a)
-DEFREG(APSLOW2, 0x3b)
-DEFREG(VLTFDCHG, 0x3c)
-DEFREG(VHTFDCHG, 0x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ID, 1)
-DEFBIT(VBUSSTS, SESS_END, 0)
-
-DEFBIT(CHGSTS, OVER_TEMP, 7)
-DEFBIT(CHGSTS, CHARGING, 6)
-DEFBIT(CHGSTS, BATT_PRESENT, 5)
-DEFBIT(CHGSTS, BATT_ERROR, 3)
-DEFBIT(CHGSTS, LOW_CHARGE, 2)
-
-/* NOTE: These two bits are mirrored in the upper nibble of PWRCTL2.
- * Modifications through one register will immediately reflect in the
- * other register. */
-DEFBIT(PWRCTL1, EXTEN_SW, 2)
-DEFBIT(PWRCTL1, DCDC2_SW, 0)
-
-DEFBIT(PWRCTL2, EXTEN_SW, 6)
-DEFBIT(PWRCTL2, DCDC2_SW, 4)
-DEFBIT(PWRCTL2, LDO3_SW, 3)
-DEFBIT(PWRCTL2, LDO2_SW, 2)
-DEFBIT(PWRCTL2, DCDC3_SW, 1)
-DEFBIT(PWRCTL2, DCDC1_SW, 0)
-
-DEFFLD(DCDC2VOLT, VALUE, 5, 0)
-
-DEFBIT(DCDC2RAMP, ENABLE, 2)
-DEFBIT(DCDC2RAMP, SLOPE, 0)
-
-DEFFLD(DCDC1VOLT, VALUE, 6, 0)
-DEFFLD(DCDC3VOLT, VALUE, 6, 0)
-
-DEFFLD(LDO2LDO3VOLT, LDO2_VALUE, 7, 4)
-DEFFLD(LDO2LDO3VOLT, LDO3_VALUE, 3, 0)
-
-DEFBIT(VBUSIPSOUT, ACCESS, 7)
-DEFBIT(VBUSIPSOUT, VHOLD_LIM, 6)
-DEFFLD(VBUSIPSOUT, VHOLD_LEV, 5, 3)
-DEFBIT(VBUSIPSOUT, VBUS_LIM, 1)
-DEFBIT(VBUSIPSOUT, LIM_100mA, 0)
-
-DEFFLD(VOFF, VALUE, 3, 0)
-
-DEFBIT(PWROFF, SHUTDOWN, 7)
-DEFBIT(PWROFF, MON_EN, 6)
-DEFFLD(PWROFF, LEDFUNC, 5, 4)
-DEFBIT(PWROFF, LEDCTL, 3)
-DEFBIT(PWROFF, DELAY, 1, 0)
-
-D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T(IRQEN2, BATTERY_ERROR, 5)
-DEFBIT(IRQEN2, BATTERY_ERROR_CLR, 4)
-DEFBIT(IRQEN2, CHARGING_STARTED, 3)
-DEFBIT(IRQEN2, CHARGING_COMPLETE, 2)
-DEFBIT(IRQEN2, BATTERY_OVER_TEMP, 1)
-DEFBIT(IRQEN2, BATTERY_UNDER_TEMP, 0)
-DEFBIT(IRQEN3, INTERNAL_OVER_TEMP, 7)
-DEFBIT(IRQEN3, LOW_CHARGE_CURRENT, 6)
-DEFBIT(IRQEN3, DCDC1_UNDER_VOLT, 5)
-DEFBIT(IRQEN3, DCDC2_UNDER_VOLT, 4)
-DEFBIT(IRQEN3, DCDC3_UNDER_VOLT, 3)
-DEFBIT(IRQEN3, SHORT_PRESS, 1)
-DEFBIT(IRQEN3, LONG_PRESS, 0)
-DEFBIT(IRQEN4, POWER_ON_N_OE, 7)
-DEFBIT(IRQEN4, POWER_OFF_N_OE, 6)
-DEFBIT(IRQEN4, VBUS_VALID, 5)
-DEFBIT(IRQEN4, VBUS_INVALID, 4)
-DEFBIT(IRQEN4, VBUS_SESS_AB, 3)
-DEFBIT(IRQEN4, VBUS_SESS_END, 2)
-DEFBIT(IRQEN4, APS_UNDER_VOLT, 0)
-
-DEFBIT(IRQSTS1, ACIN_OVER_VOLTAGE, 7)
-DEFBIT(IRQSTS1, ACIN_INSERT, 6)
-DEFBIT(IRQSTS1, ACIN_REMOVE, 5)
-DEFBIT(IRQSTS1, VBUS_OVER_VOLTAGE, 4)
-DEFBIT(IRQSTS1, VBUS_INSERT, 3)
-DEFBIT(IRQSTS1, VBUS_REMOVE, 2)
-DEFBIT(IRQSTS1, VBUS_BELOW_VHOLD, 1)
-DEFBIT(IRQSTS2, BATTERY_INSERT, 7)
-DEFBIT(IRQSTS2, BATTERY_REMOVE, 6)
-DEFBIT(IRQSTS2, BATTERY_ERROR, 5)
-DEFBIT(IRQSTS2, BATTERY_ERROR_CLR, 4)
-DEFBIT(IRQSTS2, CHARGING_STARTED, 3)
-DEFBIT(IRQSTS2, CHARGING_STOPPED, 2)
-DEFBIT(IRQSTS2, BATTERY_OVER_TEMP, 1)
-DEFBIT(IRQSTS2, BATTERY_UNDER_TEMP, 0)
-DEFBIT(IRQSTS3, INTERNAL_OVER_TEMP, 7)
-DEFBIT(IRQSTS3, LOW_CHARGE_CURRENT, 6)
-DEFBIT(IRQSTS3, DCDC1_UNDER_VOLT, 5)
-DEFBIT(IRQSTS3, DCDC2_UNDER_VOLT, 4)
-DEFBIT(IRQSTS3, DCDC3_UNDER_VOLT, 3)
-DEFBIT(IRQSTS3, SHORT_PRESS, 1)
-DEFBIT(IRQSTS3, LONG_PRESS, 0)
-DEFBIT(IRQSTS4, POWER_ON_N_OE, 7)
-DEFBIT(IRQSTS4, POWER_OFF_N_OE, 6)
-DEFBIT(IRQSTS4, VBUS_VALID, 5)
-DEFBIT(IRQSTS4, VBUS_INVALID, 4)
-DEFBIT(IRQSTS4, VBUS_SESS_AB, 3)
-DEFBIT(IRQSTS4, VBUS_SESS_END, 2)
-DEFBIT(IRQSTS4, APS_UNDER_VOLT, 0)
-
-/* NOTE: IRQEN5 and IRQSTS5 are only listed on the Chinese datasheet. */
-DEFBIT(IRQEN5, TIME_OUT, 7)
-DEFBIT(IRQEN5, GPIO2_CHANGE, 2)
-DEFBIT(IRQEN5, GPIO1_CHANGE, 1)
-DEFBIT(IRQEN5, GPIO0_CHANGE, 0)
-
-DEFBIT(IRQSTS5, TIME_OUT, 7)
-DEFBIT(IRQSTS5, GPIO2_CHANGE, 2)
-DEFBIT(IRQSTS5, GPIO1_CHANGE, 1)
-DEFBIT(IRQSTS5, GPIO0_CHANGE, 0)
-
-DEFFLD(DCDCMODE, VALUE, 3, 1)
-
-DEFBIT(ADCEN1, BATTERY_VOLTAGE, 7)
-DEFBIT(ADCEN1, BATTERY_CURRENT, 6)
-DEFBIT(ADCEN1, ACIN_VOLTAGE, 5)
-DEFBIT(ADCEN1, ACIN_CURRENT, 4)
-DEFBIT(ADC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