#pragma once

#define AXP216_SLAVE_ADDRESS                            (0x34)

#define XPOWERS_AXP216_CHIP_ID                          (0x41)

//CONTROL REGISTER
#define XPOWERS_AXP216_STATUS                           (0x00)
#define XPOWERS_AXP216_MODE_CHGSTATUS                   (0x01)
#define XPOWERS_AXP216_DATA_BUFFER1                     (0x04)
#define XPOWERS_AXP216_DATA_BUFFER2                     (0x05)
#define XPOWERS_AXP216_DATA_BUFFER3                     (0x06)
#define XPOWERS_AXP216_DATA_BUFFER4                     (0x07)
#define XPOWERS_AXP216_DATA_BUFFER5                     (0x08)
#define XPOWERS_AXP216_DATA_BUFFER6                     (0x09)
#define XPOWERS_AXP216_DATA_BUFFER7                     (0x0A)
#define XPOWERS_AXP216_DATA_BUFFER8                     (0x0B)
#define XPOWERS_AXP216_DATA_BUFFER9                     (0x0C)
#define XPOWERS_AXP216_DATA_BUFFERA                     (0x0D)
#define XPOWERS_AXP216_DATA_BUFFERB                     (0x0E)
#define XPOWERS_AXP216_DATA_BUFFERC                     (0x0F)

#define XPOWERS_AXP216_IC_TYPE                          (0x03)

#define XPOWERS_AXP216_DC12345_ALDO12_CTL               (0x10)
#define XPOWERS_AXP216_LDO123_CTL                       (0x12)
#define XPOWERS_AXP216_OUTPUT_CTL                       (0x13)
#define XPOWERS_AXP216_ELDO1_VCTL                       (0x19)
#define XPOWERS_AXP216_ELDO2_VCTL                       (0x1A)
#define XPOWERS_AXP216_DCDC1_VCTL                       (0x21)
#define XPOWERS_AXP216_DCDC2_VCTL                       (0x22)
#define XPOWERS_AXP216_DCDC3_VCTL                       (0x23)

#define XPOWERS_AXP216_DCDC4_VCTL                       (0x24)
#define XPOWERS_AXP216_DCDC5_VCTL                       (0x25)
#define XPOWERS_AXP216_DCDC23_VOLX                      (0x27)
#define XPOWERS_AXP216_ALDO1_VCTL                       (0x28)
#define XPOWERS_AXP216_ALDO2_VCTL                       (0x29)
#define XPOWERS_AXP216_ALDO3_VCTL                       (0x2A)
#define XPOWERS_AXP216_VBUS_IPSOUT                      (0x30)
#define XPOWERS_AXP216_VOFF_SET                         (0x31)
#define XPOWERS_AXP216_OFF_CTL                          (0x32)
#define XPOWERS_AXP216_CHARGE1                          (0x33)
#define XPOWERS_AXP216_CHARGE2                          (0x34)
#define XPOWERS_AXP216_CHARGE3                          (0x35)
#define XPOWERS_AXP216_PEK_SET                          (0x36)
#define XPOWERS_AXP216_OFFLEVEL                         (0x37)
#define XPOWERS_AXP216_VLTF_CHGSET                      (0x38)
#define XPOWERS_AXP216_VHTF_CHGSET                      (0x39)
#define XPOWERS_AXP216_DCDC_FREQ                        (0x3B)
#define XPOWERS_AXP216_TLTF_DISCHGSET                   (0x3C)
#define XPOWERS_AXP216_THTF_DISCHGSET                   (0x3D)
#define XPOWERS_AXP216_DCDC_MODESET                     (0x80)
#define XPOWERS_AXP216_ADC_CTL                          (0x82)
#define XPOWERS_AXP216_ADC_SPEED                        (0x84)
#define XPOWERS_AXP216_TS_ADC                           (0x85)
#define XPOWERS_AXP216_TIMER_CTL                        (0x8A)
#define XPOWERS_AXP216_HOTOVER_CTL                      (0x8F)

//GPIO REGISTER
#define XPOWERS_AXP216_GPIO1_CTL                        (0x92)
#define XPOWERS_AXP216_GPIO1_LDO_CTL                    (0x93)
#define XPOWERS_AXP216_GPIO01_STATUS                    (0x94)
#define XPOWERS_AXP216_GPIO1_PULLDOWN_CTL               (0x97)

//XPOWERS INTERRUPT REGISTER
#define XPOWERS_AXP216_INTEN1                           (0x40)
#define XPOWERS_AXP216_INTEN2                           (0x41)
#define XPOWERS_AXP216_INTEN3                           (0x42)
#define XPOWERS_AXP216_INTEN4                           (0x43)
#define XPOWERS_AXP216_INTEN5                           (0x44)

//XPOWERS INTERRUPT STATUS REGISTER
#define XPOWERS_AXP216_INTSTS1                          (0x48)
#define XPOWERS_AXP216_INTSTS2                          (0x49)
#define XPOWERS_AXP216_INTSTS3                          (0x4A)
#define XPOWERS_AXP216_INTSTS4                          (0x4B)
#define XPOWERS_AXP216_INTSTS5                          (0x4C)

//XPOWERS ADC DATA REGISTER
#define XPOWERS_AXP216_INTERNAL_TEMP_H8                 (0x56)
#define XPOWERS_AXP216_INTERNAL_TEMP_L4                 (0x57)
#define XPOWERS_AXP216_TS_IN_H8                         (0x58)
#define XPOWERS_AXP216_TS_IN_L4                         (0x59)
#define XPOWERS_AXP216_BAT_VOLTAGE_H8                   (0x78)
#define XPOWERS_AXP216_BAT_VOLTAGE_L4                   (0x79)
#define XPOWERS_AXP216_BAT_CHGCURCUR_H8                 (0x7A)
#define XPOWERS_AXP216_BAT_CHGCURCUR_L4                 (0x7B)
#define XPOWERS_AXP216_BAT_DISCHGCUR_H8                 (0x7C)
#define XPOWERS_AXP216_BAT_DISCHGCUR_L4                 (0x7D)
#define XPOWERS_AXP216_FUEL_GAUGE_CTRL                  (0xB8)
#define XPOWERS_AXP216_FUEL_GAUGE_REULST                (0xB9)
#define XPOWERS_AXP216_BAT_CAPACITY_0                   (0xE0)
#define XPOWERS_AXP216_BAT_CAPACITY_1                   (0xE1)
#define XPOWERS_AXP216_BAT_LOW_WARNING_CTRL             (0xE6)
