Core2 for AWS IoT EduKit BSP 1.5.1
Macros | Enumerations | Functions
axp192.h File Reference

Functions for the AXP192 Power Management Unit (PMU) More...

#include "stdint.h"

Go to the source code of this file.

Macros

#define AXP192_DC_VOLT_STEP   25
 
#define AXP192_DC_VOLT_MIN   700
 
#define AXP192_DC_VOLT_MAX   3500
 
#define AXP192_LDO_VOLT_STEP   100
 
#define AXP192_LDO_VOLT_MIN   1800
 
#define AXP192_LDO_VOLT_MAX   3300
 
#define AXP192_VOFF_VOLT_STEP   100
 
#define AXP192_VOFF_VOLT_MIN   2600
 
#define AXP192_VOFF_VOLT_MAX   3300
 
#define AXP192_LDO23_DC123_EXT_CTL_REG   0x12
 
#define AXP192_DC1_EN_BIT   (0)
 
#define AXP192_DC3_EN_BIT   (1)
 
#define AXP192_LDO2_EN_BIT   (2)
 
#define AXP192_LDO3_EN_BIT   (3)
 
#define AXP192_DC2_EN_BIT   (4)
 
#define AXP192_EXT_EN_BIT   (6)
 
#define AXP192_DC1_VOLT_REG   0x26
 
#define AXP192_DC2_VOLT_REG   0x23
 
#define AXP192_DC3_VOLT_REG   0x27
 
#define AXP192_LDO23_VOLT_REG   0x28
 
#define AXP192_VBUS_IPSOUT_CTL_REG   0x30
 
#define AXP192_VOFF_VOLT_REG   0x31
 
#define AXP192_POWEROFF_REG   0x32
 
#define AXP192_CHG_CTL1_REG   0x33
 
#define AXP192_CHG_CTL2_REG   0x34
 
#define AXP192_SPARE_CHG_CTL_REG   0x35
 
#define AXP192_PEK_CTL_REG   0x36
 
#define AXP192_CHG_BOOL_REG   0x01
 
#define AXP192_ADC1_ENABLE_REG   0x82
 
#define BAT_VOLT_BIT   (7)
 
#define BAT_CURRENT_BIT   (6)
 
#define ACIN_VOLT_BIT   (5)
 
#define ACIN_CURRENT_BIT   (4)
 
#define VBUS_VOLT_BIT   (3)
 
#define VBUS_CURRENT_BIT   (2)
 
#define APS_VOLT_BIT   (1)
 
#define TS_BIT   (0)
 
#define AXP192_ACIN_ADC_VOLTAGE_REG   0x56
 
#define AXP192_ACIN_ADC_CURRENT_REG   0x58
 
#define AXP192_VBUS_ADC_VOLTAGE_REG   0x5A
 
#define AXP192_VBUS_ADC_CURRENT_REG   0x5C
 
#define AXP192_BAT_ADC_VOLTAGE_REG   0x78
 
#define AXP192_BAT_ADC_CURRENT_IN_REG   0x7A
 
#define AXP192_BAT_ADC_CURRENT_OUT_REG   0x7C
 
#define AXP192_GPIO0_CTL_REG   0x90
 
#define AXP192_GPIO0_VOLT_REG   0x91
 
#define AXP192_GPIO1_CTL_REG   0x92
 
#define AXP192_GPIO2_CTL_REG   0x93
 
#define AXP192_GPIO34_CTL_REG   0x95
 
#define AXP192_GPIO34_STATE_REG   0x96
 
#define AXP192_GPIO012_STATE_REG   0x94
 

Enumerations

enum  Axp192_ChargeVolt_t { CHARGE_VOLT_4100mV = 0b0000 , CHARGE_VOLT_4150mV = 0b0001 , CHARGE_VOLT_4200mV = 0b0010 , CHARGE_VOLT_4360mV = 0b0011 }
 List of available charging voltages. More...
 
enum  Axp192_ChargeCurrent_t {
  CHARGE_Current_100mA = 0b0000 , CHARGE_Current_190mA , CHARGE_Current_280mA , CHARGE_Current_360mA ,
  CHARGE_Current_450mA , CHARGE_Current_550mA , CHARGE_Current_630mA , CHARGE_Current_700mA ,
  CHARGE_Current_780mA , CHARGE_Current_880mA , CHARGE_Current_960mA , CHARGE_Current_1000mA ,
  CHARGE_Current_1080mA , CHARGE_Current_1160mA , CHARGE_Current_1240mA , CHARGE_Current_1320mA
}
 List of available charging current rates. More...
 
enum  Axp192_SpareChargeVolt_t { SPARE_CHARGE_VOLT_3100mV = 0x00 , SPARE_CHARGE_VOLT_3000mV = 0x01 , SPARE_CHARGE_VOLT_2500mV = 0x03 }
 
enum  Axp192_SpareChargeCurrent_t { SPARE_CHARGE_Current_50uA = 0x00 , SPARE_CHARGE_Current_100uA = 0x01 , SPARE_CHARGE_Current_200uA = 0x02 , SPARE_CHARGE_Current_400uA = 0x03 }
 
enum  Axp192_StartupTime_t { STARTUP_128mS = 0x00 , STARTUP_512mS = 0x01 , STARTUP_1S = 0x02 , STARTUP_2S = 0x03 }
 List of possible durations the power button must be held to power on the Core2 for AWS IoT EduKit. More...
 
enum  Axp192_PoweroffTime_t { POWEROFF_4S = 0x00 , POWEROFF_6S = 0x01 , POWEROFF_8S = 0x02 , POWEROFF_10S = 0x03 }
 List of possible durations the power button must be held to power off the Core2 for AWS IoT EduKit. More...
 

Functions

void Axp192_Init ()
 Initializes the AXP192 over I2C. More...
 
void Axp192_EnableLDODCExt (uint8_t value)
 Extends the DC voltage range of the Low-Dropout regulator (LDO) on the AXP192. More...
 
void Axp192_EnableExten (uint8_t state)
 Enables or disables extending the Low-Dropout (LDO) voltage on the AXP192. More...
 
void Axp192_EnableLDO2 (uint8_t state)
 Enables or disables Low-Dropout (LDO) 2 on the AXP192. More...
 
void Axp192_EnableLDO3 (uint8_t state)
 Enables or disables Low-Dropout (LDO) 3 on the AXP192. More...
 
void Axp192_EnableDCDC1 (uint8_t state)
 Enables or disables DC/DC 1 Buck Boost converter on the AXP192. More...
 
void Axp192_EnableDCDC2 (uint8_t state)
 Enables or disables DC/DC 2 Buck Boost converter on the AXP192. More...
 
void Axp192_EnableDCDC3 (uint8_t state)
 Enables or disables DC/DC 3 Buck Boost converter. More...
 
void Axp192_SetLDO23Volt (uint16_t ldo2_voltage, uint16_t ldo3_voltage)
 Set both LDO 2 and LDO 3 voltage on the AXP192. More...
 
void Axp192_SetLDO2Volt (uint16_t voltage)
 Set the LDO 2 voltage on the AXP192. More...
 
void Axp192_SetLDO3Volt (uint16_t voltage)
 Set the Low-Dropout (LDO) 3 voltage on the AXP192. More...
 
void Axp192_SetDCDC1Volt (uint16_t voltage)
 Set the DC/DC 1 Buck Boost converter voltage on the AXP192. More...
 
void Axp192_SetDCDC2Volt (uint16_t voltage)
 Set the DC/DC 2 Buck Boost converter voltage on the AXP192. More...
 
void Axp192_SetDCDC3Volt (uint16_t voltage)
 Set the DC/DC 3 Buck Boost converter voltage on the AXP192. More...
 
void Axp192_SetVoffVolt (uint16_t voltage)
 Set the battery low-voltage to cut-off on the AXP192. More...
 
void Axp192_EnablePWRONShortWake ()
 Enable sleep and short wake mode on AXP192. More...
 
float Axp192_GetVbusVolt ()
 Gets VBUS voltage on the AXP192. More...
 
float Axp192_GetAcinVolt ()
 Gets ACIN voltage on the AXP192. More...
 
float Axp192_GetBatVolt ()
 Gets battery voltage on the AXP192. More...
 
float Axp192_GetVbusCurrent ()
 Gets VBUS current flowing through the AXP192. More...
 
float Axp192_GetAcinCurrent ()
 Gets ACIN current flowing through the AXP192. More...
 
float Axp192_GetBatCurrent ()
 Gets battery current flowing through the AXP192. More...
 
void Axp192_EnableCharge (uint16_t state)
 Enables or disables the battery charging circuit on the AXP192. More...
 
void Axp192_SetChargeVoltage (Axp192_ChargeVolt_t volt)
 Set the battery charge voltage on the AXP192. More...
 
void Axp192_SetChargeCurrent (Axp192_ChargeCurrent_t cur)
 Set the battery charge current on the AXP192. More...
 
void Axp192_SetSpareBatCharge (uint8_t enable, Axp192_SpareChargeVolt_t volt, Axp192_SpareChargeCurrent_t current)
 
void Axp192_GetApsVoltage ()
 
void Axp192_GetInternalTemp ()
 
void Axp192_SetAdc1Enable (uint8_t value)
 Enables or disables the ADC on the AXP192. More...
 
void Axp192_SetAdc2Enable ()
 
void Axp192_IsBatIn ()
 
void Axp192_IsCharging ()
 
void Axp192_PowerOff ()
 Powers down the device. More...
 
void Axp192_SetPressPoweroffTime (Axp192_PoweroffTime_t time)
 Sets how long the power button needs to be held to power off all components connected to the AXP192. More...
 
void Axp192_SetPressStartupTime (Axp192_StartupTime_t time)
 Sets how long the power button needs to be held to power on all components connected to the AXP192. More...
 
void Axp192_WriteDataStash ()
 
void Axp192_ReadDataStash ()
 
void Axp192_SetGPIO4Mode (uint8_t mode)
 Sets the mode of GPIO 4 on the AXP192 for charging control. More...
 
void Axp192_SetGPIO4Level (uint8_t level)
 Sets the signal status level of GPIO 4. More...
 
void Axp192_SetGPIO2Mode (uint8_t mode)
 Sets the mode of GPIO 2 on the AXP192. More...
 
void Axp192_SetGPIO2Level (uint8_t level)
 Sets the average voltage level of GPIO 2 on the AXP192 if the mode is set to PWM. More...
 
void Axp192_SetGPIO0Mode (uint8_t mode)
 Sets the mode of GPIO 0 on the AXP192. More...
 
void Axp192_SetGPIO0Volt (uint16_t volt)
 Sets the voltage of GPIO 0 on the AXP192. More...
 
void Axp192_SetGPIO1Mode (uint8_t mode)
 Sets the mode of GPIO 1 on the AXP192. More...
 
void Axp192_SetGPIO1Level (uint8_t level)
 Sets the average voltage level of GPIO 1 on the AXP192 if the mode is set to PWM. More...
 

Detailed Description

Functions for the AXP192 Power Management Unit (PMU)

Macro Definition Documentation

◆ AXP192_DC_VOLT_STEP

#define AXP192_DC_VOLT_STEP   25

◆ AXP192_DC_VOLT_MIN

#define AXP192_DC_VOLT_MIN   700

◆ AXP192_DC_VOLT_MAX

#define AXP192_DC_VOLT_MAX   3500

◆ AXP192_LDO_VOLT_STEP

#define AXP192_LDO_VOLT_STEP   100

◆ AXP192_LDO_VOLT_MIN

#define AXP192_LDO_VOLT_MIN   1800

◆ AXP192_LDO_VOLT_MAX

#define AXP192_LDO_VOLT_MAX   3300

◆ AXP192_VOFF_VOLT_STEP

#define AXP192_VOFF_VOLT_STEP   100

◆ AXP192_VOFF_VOLT_MIN

#define AXP192_VOFF_VOLT_MIN   2600

◆ AXP192_VOFF_VOLT_MAX

#define AXP192_VOFF_VOLT_MAX   3300

◆ AXP192_LDO23_DC123_EXT_CTL_REG

#define AXP192_LDO23_DC123_EXT_CTL_REG   0x12

◆ AXP192_DC1_EN_BIT

#define AXP192_DC1_EN_BIT   (0)

◆ AXP192_DC3_EN_BIT

#define AXP192_DC3_EN_BIT   (1)

◆ AXP192_LDO2_EN_BIT

#define AXP192_LDO2_EN_BIT   (2)

◆ AXP192_LDO3_EN_BIT

#define AXP192_LDO3_EN_BIT   (3)

◆ AXP192_DC2_EN_BIT

#define AXP192_DC2_EN_BIT   (4)

◆ AXP192_EXT_EN_BIT

#define AXP192_EXT_EN_BIT   (6)

◆ AXP192_DC1_VOLT_REG

#define AXP192_DC1_VOLT_REG   0x26

◆ AXP192_DC2_VOLT_REG

#define AXP192_DC2_VOLT_REG   0x23

◆ AXP192_DC3_VOLT_REG

#define AXP192_DC3_VOLT_REG   0x27

◆ AXP192_LDO23_VOLT_REG

#define AXP192_LDO23_VOLT_REG   0x28

◆ AXP192_VBUS_IPSOUT_CTL_REG

#define AXP192_VBUS_IPSOUT_CTL_REG   0x30

◆ AXP192_VOFF_VOLT_REG

#define AXP192_VOFF_VOLT_REG   0x31

◆ AXP192_POWEROFF_REG

#define AXP192_POWEROFF_REG   0x32

◆ AXP192_CHG_CTL1_REG

#define AXP192_CHG_CTL1_REG   0x33

◆ AXP192_CHG_CTL2_REG

#define AXP192_CHG_CTL2_REG   0x34

◆ AXP192_SPARE_CHG_CTL_REG

#define AXP192_SPARE_CHG_CTL_REG   0x35

◆ AXP192_PEK_CTL_REG

#define AXP192_PEK_CTL_REG   0x36

◆ AXP192_CHG_BOOL_REG

#define AXP192_CHG_BOOL_REG   0x01

◆ AXP192_ADC1_ENABLE_REG

#define AXP192_ADC1_ENABLE_REG   0x82

◆ BAT_VOLT_BIT

#define BAT_VOLT_BIT   (7)

◆ BAT_CURRENT_BIT

#define BAT_CURRENT_BIT   (6)

◆ ACIN_VOLT_BIT

#define ACIN_VOLT_BIT   (5)

◆ ACIN_CURRENT_BIT

#define ACIN_CURRENT_BIT   (4)

◆ VBUS_VOLT_BIT

#define VBUS_VOLT_BIT   (3)

◆ VBUS_CURRENT_BIT

#define VBUS_CURRENT_BIT   (2)

◆ APS_VOLT_BIT

#define APS_VOLT_BIT   (1)

◆ TS_BIT

#define TS_BIT   (0)

◆ AXP192_ACIN_ADC_VOLTAGE_REG

#define AXP192_ACIN_ADC_VOLTAGE_REG   0x56

◆ AXP192_ACIN_ADC_CURRENT_REG

#define AXP192_ACIN_ADC_CURRENT_REG   0x58

◆ AXP192_VBUS_ADC_VOLTAGE_REG

#define AXP192_VBUS_ADC_VOLTAGE_REG   0x5A

◆ AXP192_VBUS_ADC_CURRENT_REG

#define AXP192_VBUS_ADC_CURRENT_REG   0x5C

◆ AXP192_BAT_ADC_VOLTAGE_REG

#define AXP192_BAT_ADC_VOLTAGE_REG   0x78

◆ AXP192_BAT_ADC_CURRENT_IN_REG

#define AXP192_BAT_ADC_CURRENT_IN_REG   0x7A

◆ AXP192_BAT_ADC_CURRENT_OUT_REG

#define AXP192_BAT_ADC_CURRENT_OUT_REG   0x7C

◆ AXP192_GPIO0_CTL_REG

#define AXP192_GPIO0_CTL_REG   0x90

◆ AXP192_GPIO0_VOLT_REG

#define AXP192_GPIO0_VOLT_REG   0x91

◆ AXP192_GPIO1_CTL_REG

#define AXP192_GPIO1_CTL_REG   0x92

◆ AXP192_GPIO2_CTL_REG

#define AXP192_GPIO2_CTL_REG   0x93

◆ AXP192_GPIO34_CTL_REG

#define AXP192_GPIO34_CTL_REG   0x95

◆ AXP192_GPIO34_STATE_REG

#define AXP192_GPIO34_STATE_REG   0x96

◆ AXP192_GPIO012_STATE_REG

#define AXP192_GPIO012_STATE_REG   0x94

Enumeration Type Documentation

◆ Axp192_ChargeVolt_t

List of available charging voltages.

Enumerator
CHARGE_VOLT_4100mV 

Charge at 4.10v.

CHARGE_VOLT_4150mV 

Charge at 4.15v.

CHARGE_VOLT_4200mV 

Charge at 4.20v.

CHARGE_VOLT_4360mV 

Charge at 4.36v.

◆ Axp192_ChargeCurrent_t

List of available charging current rates.

Enumerator
CHARGE_Current_100mA 

Charge at 100mA.

CHARGE_Current_190mA 

Charge at 190mA.

CHARGE_Current_280mA 

Charge at 280mA.

CHARGE_Current_360mA 

Charge at 360mA.

CHARGE_Current_450mA 

Charge at 450mA.

CHARGE_Current_550mA 

Charge at 550mA.

CHARGE_Current_630mA 

Charge at 630mA.

CHARGE_Current_700mA 

Charge at 700mA.

CHARGE_Current_780mA 

Charge at 780mA.

CHARGE_Current_880mA 

Charge at 880mA.

CHARGE_Current_960mA 

Charge at 960mA.

CHARGE_Current_1000mA 

Charge at 1000mA.

CHARGE_Current_1080mA 

Charge at 1080mA.

CHARGE_Current_1160mA 

Charge at 1160mA.

CHARGE_Current_1240mA 

Charge at 1240mA.

CHARGE_Current_1320mA 

Charge at 1320mA.

◆ Axp192_SpareChargeVolt_t

Enumerator
SPARE_CHARGE_VOLT_3100mV 
SPARE_CHARGE_VOLT_3000mV 
SPARE_CHARGE_VOLT_2500mV 

◆ Axp192_SpareChargeCurrent_t

Enumerator
SPARE_CHARGE_Current_50uA 
SPARE_CHARGE_Current_100uA 
SPARE_CHARGE_Current_200uA 
SPARE_CHARGE_Current_400uA 

◆ Axp192_StartupTime_t

List of possible durations the power button must be held to power on the Core2 for AWS IoT EduKit.

Enumerator
STARTUP_128mS 

Power button hold for 128ms to turn on.

STARTUP_512mS 

Power button hold for 512ms to turn on.

STARTUP_1S 

Power button hold for 1s to turn on.

STARTUP_2S 

Power button hold for 2s to turn on.

◆ Axp192_PoweroffTime_t

List of possible durations the power button must be held to power off the Core2 for AWS IoT EduKit.

Enumerator
POWEROFF_4S 

Power button hold for 4s to turn off.

POWEROFF_6S 

Power button hold for 6s to turn off.

POWEROFF_8S 

Power button hold for 8s to turn off.

POWEROFF_10S 

Power button hold for 10s to turn off.

Function Documentation

◆ Axp192_Init()

void Axp192_Init ( )

Initializes the AXP192 over I2C.

It is a wrapper to Axp192_I2CInit().

◆ Axp192_EnableLDODCExt()

void Axp192_EnableLDODCExt ( uint8_t  value)

Extends the DC voltage range of the Low-Dropout regulator (LDO) on the AXP192.

Parameters
[in]valueDesired voltage of the LDO.

◆ Axp192_EnableExten()

void Axp192_EnableExten ( uint8_t  state)

Enables or disables extending the Low-Dropout (LDO) voltage on the AXP192.

Parameters
[in]stateDesired state of LDO extention. 1 to enable, 0 to disable.

◆ Axp192_EnableLDO2()

void Axp192_EnableLDO2 ( uint8_t  state)

Enables or disables Low-Dropout (LDO) 2 on the AXP192.

Parameters
[in]stateDesired state of LDO 2. 1 to enable, 0 to disable.

◆ Axp192_EnableLDO3()

void Axp192_EnableLDO3 ( uint8_t  state)

Enables or disables Low-Dropout (LDO) 3 on the AXP192.

Parameters
[in]stateDesired state of LDO 3. 1 to enable, 0 to disable.

◆ Axp192_EnableDCDC1()

void Axp192_EnableDCDC1 ( uint8_t  state)

Enables or disables DC/DC 1 Buck Boost converter on the AXP192.

Parameters
[in]stateDesired state of DC/DC 1. 1 to enable, 0 to disable.

◆ Axp192_EnableDCDC2()

void Axp192_EnableDCDC2 ( uint8_t  state)

Enables or disables DC/DC 2 Buck Boost converter on the AXP192.

Parameters
[in]stateDesired state of DC/DC 2. 1 to enable, 0 to disable.

◆ Axp192_EnableDCDC3()

void Axp192_EnableDCDC3 ( uint8_t  state)

Enables or disables DC/DC 3 Buck Boost converter.

Parameters
[in]stateDesired state of DC/DC 3. 1 to enable, 0 to disable.

◆ Axp192_SetLDO23Volt()

void Axp192_SetLDO23Volt ( uint16_t  ldo2_voltage,
uint16_t  ldo3_voltage 
)

Set both LDO 2 and LDO 3 voltage on the AXP192.

Parameters
[in]ldo2_voltageDesired voltage of LDO 2.
[in]ldo3_voltageDesired voltage of LDO 3.

◆ Axp192_SetLDO2Volt()

void Axp192_SetLDO2Volt ( uint16_t  voltage)

Set the LDO 2 voltage on the AXP192.

Parameters
[in]voltageDesired voltage of LDO 2.

◆ Axp192_SetLDO3Volt()

void Axp192_SetLDO3Volt ( uint16_t  voltage)

Set the Low-Dropout (LDO) 3 voltage on the AXP192.

Parameters
[in]voltageDesired voltage of LDO 3.

◆ Axp192_SetDCDC1Volt()

void Axp192_SetDCDC1Volt ( uint16_t  voltage)

Set the DC/DC 1 Buck Boost converter voltage on the AXP192.

Parameters
[in]voltageDesired voltage of DC/DC 1.

◆ Axp192_SetDCDC2Volt()

void Axp192_SetDCDC2Volt ( uint16_t  voltage)

Set the DC/DC 2 Buck Boost converter voltage on the AXP192.

Parameters
[in]voltageDesired voltage of DC/DC 2.

◆ Axp192_SetDCDC3Volt()

void Axp192_SetDCDC3Volt ( uint16_t  voltage)

Set the DC/DC 3 Buck Boost converter voltage on the AXP192.

Parameters
[in]voltageDesired voltage of DC/DC 3.

◆ Axp192_SetVoffVolt()

void Axp192_SetVoffVolt ( uint16_t  voltage)

Set the battery low-voltage to cut-off on the AXP192.

Note
This value should not be set lower than the 3.0v default to avoid damaging the built-in battery.
Parameters
[in]voltageLow battery cut-off voltage.

◆ Axp192_EnablePWRONShortWake()

void Axp192_EnablePWRONShortWake ( )

Enable sleep and short wake mode on AXP192.

◆ Axp192_GetVbusVolt()

float Axp192_GetVbusVolt ( )

Gets VBUS voltage on the AXP192.

Returns
The voltage from the VBUS power source.

◆ Axp192_GetAcinVolt()

float Axp192_GetAcinVolt ( )

Gets ACIN voltage on the AXP192.

Returns
The voltage of the ACIN power source.

◆ Axp192_GetBatVolt()

float Axp192_GetBatVolt ( )

Gets battery voltage on the AXP192.

Returns
The voltage of the battery power source.

◆ Axp192_GetVbusCurrent()

float Axp192_GetVbusCurrent ( )

Gets VBUS current flowing through the AXP192.

Returns
The current usage of the VBUS power source.

◆ Axp192_GetAcinCurrent()

float Axp192_GetAcinCurrent ( )

Gets ACIN current flowing through the AXP192.

Returns
The current usage of ACIN power source.

◆ Axp192_GetBatCurrent()

float Axp192_GetBatCurrent ( )

Gets battery current flowing through the AXP192.

Returns
The current usage of battery power source.

◆ Axp192_EnableCharge()

void Axp192_EnableCharge ( uint16_t  state)

Enables or disables the battery charging circuit on the AXP192.

Parameters
[in]stateDesired state of the battery charging circuit. 1 to enable, 0 to disable.

◆ Axp192_SetChargeVoltage()

void Axp192_SetChargeVoltage ( Axp192_ChargeVolt_t  volt)

Set the battery charge voltage on the AXP192.

Note
This is the voltage applied to the battery for charging. This is not the voltage of the battery. Default is 4.2v.
Parameters
[in]voltDesired voltage to charge the battery.

◆ Axp192_SetChargeCurrent()

void Axp192_SetChargeCurrent ( Axp192_ChargeCurrent_t  cur)

Set the battery charge current on the AXP192.

Note
This is the current applied to the battery for charging. This is not the current of the battery. Default is 100mA.
Parameters
[in]curDesired current to charge the battery.

◆ Axp192_SetSpareBatCharge()

void Axp192_SetSpareBatCharge ( uint8_t  enable,
Axp192_SpareChargeVolt_t  volt,
Axp192_SpareChargeCurrent_t  current 
)

◆ Axp192_GetApsVoltage()

void Axp192_GetApsVoltage ( )

◆ Axp192_GetInternalTemp()

void Axp192_GetInternalTemp ( )

◆ Axp192_SetAdc1Enable()

void Axp192_SetAdc1Enable ( uint8_t  value)

Enables or disables the ADC on the AXP192.

Parameters
[in]valueDesired value of the ADC.

◆ Axp192_SetAdc2Enable()

void Axp192_SetAdc2Enable ( )

◆ Axp192_IsBatIn()

void Axp192_IsBatIn ( )

◆ Axp192_IsCharging()

void Axp192_IsCharging ( )

◆ Axp192_PowerOff()

void Axp192_PowerOff ( )

Powers down the device.

Note
Since the microcontroller and all the peripherals are powered by the AXP192, calling this function powers down the device.

◆ Axp192_SetPressPoweroffTime()

void Axp192_SetPressPoweroffTime ( Axp192_PoweroffTime_t  time)

Sets how long the power button needs to be held to power off all components connected to the AXP192.

Note
The default is POWEROFF_6S (6 seconds).
Parameters
[in]timeDesired time to hold the power button to turn off power.

◆ Axp192_SetPressStartupTime()

void Axp192_SetPressStartupTime ( Axp192_StartupTime_t  time)

Sets how long the power button needs to be held to power on all components connected to the AXP192.

Default is STARTUP_128mS (128 milliseconds).

Parameters
[in]timeDesired time to hold the power button to turn on power.

◆ Axp192_WriteDataStash()

void Axp192_WriteDataStash ( )

◆ Axp192_ReadDataStash()

void Axp192_ReadDataStash ( )

◆ Axp192_SetGPIO4Mode()

void Axp192_SetGPIO4Mode ( uint8_t  mode)

Sets the mode of GPIO 4 on the AXP192 for charging control.

Parameters
[in]modeDesired mode of GPIO 4. 0 for NMOS open-drain ouput, 1 for universal input. Default value for the Core2 for AWS is 1, and not meant to be changed.

◆ Axp192_SetGPIO4Level()

void Axp192_SetGPIO4Level ( uint8_t  level)

Sets the signal status level of GPIO 4.

Parameters
[in]levelDesired signal status level of GPIO 4.

◆ Axp192_SetGPIO2Mode()

void Axp192_SetGPIO2Mode ( uint8_t  mode)

Sets the mode of GPIO 2 on the AXP192.

Parameters
[in]modeDesired mode of GPIO 2. 0 for PWM, 1 for ADC input. Default value for the Core2 for AWS is 1, and not meant to be changed.

◆ Axp192_SetGPIO2Level()

void Axp192_SetGPIO2Level ( uint8_t  level)

Sets the average voltage level of GPIO 2 on the AXP192 if the mode is set to PWM.

Parameters
[in]levelDesired average voltage level of GPIO 2.

◆ Axp192_SetGPIO0Mode()

void Axp192_SetGPIO0Mode ( uint8_t  mode)

Sets the mode of GPIO 0 on the AXP192.

Parameters
[in]modeDesired mode of GPIO 0. 0 for Low-Dropout, 1 for ADC input. Default value for the Core2 for AWS is 0, and not meant to be changed.

◆ Axp192_SetGPIO0Volt()

void Axp192_SetGPIO0Volt ( uint16_t  volt)

Sets the voltage of GPIO 0 on the AXP192.

Parameters
[in]voltDesired voltage of GPIO 0. Default value for the Core2 for AWS is 3300mV.

◆ Axp192_SetGPIO1Mode()

void Axp192_SetGPIO1Mode ( uint8_t  mode)

Sets the mode of GPIO 1 on the AXP192.

Parameters
[in]modeDesired mode of GPIO 1. 0 for PWM, 1 for ADC input. Default value for the Core2 for AWS is 1, and not meant to be changed.

◆ Axp192_SetGPIO1Level()

void Axp192_SetGPIO1Level ( uint8_t  level)

Sets the average voltage level of GPIO 1 on the AXP192 if the mode is set to PWM.

Parameters
[in]levelDesired average voltage level of GPIO 1.